Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Add an optional
--suppress-tokens FILEserver option for model-specific output token IDs. The file is read at engine startup and can contain a JSON array or an object with atarget_token_idsarray. The flag is scoped to a model's command line so switching models in the desktop app cannot carry a mask over to a different tokenizer.The target sampler excludes those IDs before selection, including the initial token and greedy or sampled DFlash2 verification rows. A suppressed draft proposal has zero target probability. Prompt tokens and raw scoring are unaffected. Startup rejects invalid, duplicate, out-of-vocabulary, and stop IDs. A request that would force a suppressed thinking-end token is refused. With the option omitted, no mask buffer or Metal dispatch is added.
Verification
make check-pythonpassed: 1,853 tests run, 8 skipped, with compilation, lint, and formatting checks also passing. The focused rerun of the 102 affected launcher, argument, startup, recovery, and packaging tests passed separately.target-samplingandtarget-sampling-16passed directly withMTL_SHADER_VALIDATION=1.d40c250fbinaries produced identical token IDs, speculative draft counts, and raw scores on the same requests.200001changed the first token to9850. No200001appeared in the masked batch, which accepted 273 speculative draft tokens.make check-source check-native-cpu check-native-buildpassed on the final patch. The fullmake checkrun reported Swift app failures; the same three cases reproduced in a focused rerun against the unchanged app bundle (login-shell settings, selected drawer tab visibility, and number formatting in the transcript).gguf_decode_q4k_m8_aunder shader validation. The same pipeline and diagnostic reproduced on clean upstreamd40c250fon the same machine.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.