Repository navigation
xpu families: refuse a token id at or past the embedding table before the lookup - #3047
Merged
Merged
Conversation
ashhart
marked this pull request as ready for review
November 12, 2026 17:46
Owner
Author
|
Review: ready. We have no AMD or Intel GPU, so we checked the new load-time shape checks against real checkpoints' safetensors headers and configs instead. Every check passes on every checkpoint we could read:
A few checkpoints would fail a new check, but none of them was ever supported on that path: 8-bit Nemotron and LFM3-VL on XPU, which are refused earlier, and Qwen3.8-27B MLX 8-bit on XPU, which this check now refuses by name. No bound refuses a legitimate id, and the checks are host-side compares with no added sync. Not checked: runtime on AMD or Intel hardware.
|
This was referenced Nov 13, 2026
… 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.
ashhart
force-pushed
the
security/token-ids-xpu
branch
from
November 13, 2026 02:02
8dc7346 to
6d8cfe4
Compare
ashhart
added a commit
that referenced
this pull request
Nov 13, 2026
Figures and scope corrected to the PRs (#2948, #2863, #2934, #2933, #2921, #2906, #2878, #2892, #2851, #2728, #3072, #2915, #2864, #2854 and others), promises of later work removed (#2903, #2875, #1630, #1720), #3074 and #3047/#3046 said as their PRs scope them, the duplicate #2861, #2585, #2321 and #2719 entries and two copies of released 1.2.5 lines removed, #1953's line named for its PR, and a line for #3255. Released sections unchanged.
1 task done
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 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. XPU paths: nemotron, gemma4, qwen27 and lfm3.
SECURITY.mdasks for private reports, so there is no public issue.atc overlap --json: not run.Checks on this head
8dc73464b46beac84f0cfe863949f66729961840python3 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 10 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; 48/48 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; 371/374 tests passed (3 skipped)zig build test-golden test-server-security test-pull-security: 76/76 steps succeeded; 23/23 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
oclocand nGEN headers, which write empty kernel images.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
XPU: nemotron, gemma4, qwen27 and lfm3 refuse a token id at or past the embedding table before the lookup.