Repository navigation
hip families: refuse a token id at or past the embedding table before the lookup - #3046
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.
|
… 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-hip
branch
from
November 13, 2026 02:01
2e59e1b to
7f82afa
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.
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. ROCm paths: nemotron, flashnext, qwen3_5 and nemotron_parse's draft path.
SECURITY.mdasks for private reports, so there is no public issue.atc overlap --json: not run.Checks on this head
2e59e1b97875fdbd5c58e87abfcc36da2e8bd534python3 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 14 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 succeededsecurity:tests, through a temporary filter step: 4/4 steps succeeded; 4/4 tests passedzig 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; 881/885 tests passed (4 skipped)zig build test-golden test-server-security test-pull-security: 76/76 steps succeeded; 31/31 tests passedsecurity: a round refuses a token at or past the vocabulary before its plan is writtenzig 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
b38a4dd02. On this base only the passing side was rerun.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
ROCm: nemotron, flashnext, qwen3_5 and nemotron_parse refuse a token id at or past the embedding table before the lookup.