Repository navigation
Conversation
…re the lookup The embedding kernels read the table at the id they are given and none of them bounds it, so the host check is the only one. Each path now refuses an id at or past the vocabulary before it uploads the ids, and the loaders that took the table as stored refuse one whose rows are not the vocabulary's.
…ssistant and the tree feed gemma_assist_input clamps an id past the table to its last row, so the Metal assistant drafted from the wrong row for a pending id at or past the vocabulary; its hold now refuses one before any stream's work, as the DFlash drafter does. FZ_FEED's tree guesses become window ids and are refused when the feed is read. test-token-ids-metal-host runs both host tests on the shader-free engine module.
|
Review fixes pushed (7be24cf):
The other Metal drafter and MTP paths were already guarded: Nemotron, Flash Next, Qwen 27B DFlash, MiniMax DFlash2 and DSpark, Gemma 4 DFlash, Step-5 MTP and GLM DSA. Host steps: 10/10 with 111/111 tests, plus 19/19 compile steps. Overlap with #3054: both PRs edit Next: an M5 run, main against this branch, on Flash Next, Nemotron with MTP and Gemma 4.
|
|
M5 Ultra device run, main against this head, Flash Next: REVIEW. Sampled code prompts are slower: 200.2 to 189.3 tok/s at 1 stream (-5.4%) and 231.6 to 222.6 at 2 streams (-3.9%), and the two new runs sit below both base runs. So this does not land as is. The Gemma 4 and Nemotron runs are still to come, and we will look at what costs the sampled Flash Next rounds before going further.
|
|
Second M5 Ultra A/B confirms the loss and widens it: sampled chat 136.9 to 129.0 tok/s at 1 stream (-5.8%) and 196.2 to 189.2 at 2 (-3.5%), and greedy code 257.1 to 246.8 at 2 streams (-4.0%), with both new runs below both base runs in each. The new checks run on every shared verify round, but ids the engine produces are already in range, so we are moving the refusal to where ids enter from outside (prompts, prompt_token_ids, logit_bias, stop ids, recalled state), and then re-measuring.
|
What this changes
Before: on these paths a token id reached the embedding lookup unchecked, and no embedding kernel bounds its ids, so an id at or past the table read device memory past it. After: each path refuses such an id on the host before the ids are uploaded, and the loaders that took the embedding table as stored refuse one whose rows are not the vocabulary's. Metal paths: nemotron, gemma4, glm, glm_dsa, flashnext, the minimax_m3 drafters and step5's draft head.
SECURITY.mdasks for private reports, so there is no public issue.atc overlap --json: not run.Checks on this head
e8722866bb916997142850ae0fe4f2d43a2f22abpython3 tools/zig/lean_check.py, on the base and on this head: 345 on the base, 345 on this head, 0 new.zig fmt --checkon 24 files: passesgit diff --check: passeszig build native: 66/66 steps succeededzig build check-native-cuda-host compile-flashnext-mtp-parity-host compile-glm-native-open: 11/11 steps succeededzig build -Dhip=true check-native-hip-host test-native-hip-host test-environment-hip-host test-hip-family-offers-host test-qwen3-hip-host: 19/19 steps succeeded; 29/29 tests passedzig build xpu-nativewith stand-ins for Intel'soclocand nGEN headers: 47/47 steps succeededzig build test-step5-host test-lfm3-host test-lfm3-prefill-host test-minimax-info-host test-minimax-cuda-host test-xpu-refusal-host test-draft-xpu-host test-qwen27-config-xpu-host test-nemotron-round-depth-host test-nemotron-prefill-widths-host test-nemotron-mtp-policy-host test-nemotron-restored-head-host test-nemotron-subset-head-host test-nemotron-grants-host test-nemotron-copies-host test-gemma4-load-parts-host test-gemma4-owners-host test-gemma4-contract-host test-gemma4-prompt-head-host test-gemma4-tower-host test-glm-window-contract-host test-glm-contract-host test-glm-formats-host test-glm-copies-host test-flashnext-host test-flashnext-batch-host test-flashnext-mtp-plan-host test-flashnext-driver-host test-flashnext-single-session-host test-flashnext-scheduling-host test-flashnext-constraint-host test-flashnext-prefill-pairs-host test-flashnext-contract-host test-qwen35-rounds-host test-qwen35-verify-host test-qwen35-prefill-host test-qwen35-draft-frames-host: 194/194 steps succeeded; 977/981 tests passed (4 skipped)zig build test-golden test-server-security test-pull-security: 76/76 steps succeeded; 31/31 tests passedzig build testand every step that runs on a GPU were not run: this Mac's GPU was serving a model, and no CUDA, ROCm or Intel hardware was available.Receipt
Checklist
For a change that reaches inference:
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. Not measured: no served run.Notes for the reviewer
Suggested changelog line
Metal: nemotron, gemma4, glm, glm_dsa, flashnext, minimax_m3's drafters and step5's draft head refuse a token id at or past the embedding table before the lookup.