Repository navigation
weight_map: refuse a projection whose checkpoint shape disagrees with the config (no OOB device read) - #310
Merged
Merged
Conversation
…ization (CWE-125)
AzeezIsh
added a commit
that referenced
this pull request
Nov 1, 2026
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
AzeezIsh
marked this pull request as ready for review
November 1, 2026 20:49
AzeezIsh
added a commit
that referenced
this pull request
Nov 1, 2026
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
4 of 7 tasks
data-angel
added a commit
to Enntity/atlas
that referenced
this pull request
Nov 1, 2026
Resolves the conflict with Atlas-Inf#310 in weight_map/quant_helpers_tests.rs by keeping both sides: the block-scale tests from this series and Atlas-Inf#310's ensure_checkpoint_shape test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
AzeezIsh
added a commit
that referenced
this pull request
Nov 1, 2026
…series; data-angel) Qwen-side KL + bench gate on reiner + spark2 (#220, receipts on the PR) at fa528fc: KL 0 vs main over 34,245 x2 + 36,765 positions incl. vision, BFCL 87.54/86.85 = main, greedy 8/8, tools 21/21, bench neutral. 354da21 = fa528fc + main (only the #310 conflict area changed). GLM-side results are data-angel's (see the PR). CI green except the PR benchmark gate.
This was referenced Nov 2, 2026
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.
Summary
Refuse an attention projection whose checkpoint shape disagrees with the
[n, k]the config implies, before upload and device quantization.Why: a checkpoint
q_projwith half the rows thatattn_output_gateimplies (q + gate fused) madequantize_to_nvfp4'snvfp4_global_absmaxread about 63 MB past the uploaded buffer.CUDA_ERROR_ILLEGAL_ADDRESSwith no tensor name, and destroyed the CUDA context. That's an out-of-bounds device read (CWE-125).compute-sanitizer memcheckhid it (that boot succeeded), so it was easy to misread as a race.Change:
weight_map::ensure_checkpoint_shape(store, name, n, k, why)checks the safetensors header shape is exactly[n, k]. Otherwise it fails with"<tensor>: checkpoint shape [a, b] but the config implies [n, k] (<rule>)".dense_auto→ quantize/shard sites: two inqwen35/load_layers/attention_arms.rs(also used byqwen4_expfull attention), two inqwen35_dense.rs.weight_packed) paths are untouched.Test plan
ensure_checkpoint_shape_rejects_a_short_q_proj: a short tensor errors, naming both shapes and the gate rule.control.pyoutputs byte-identical on Flash-Next FP4-Local, Flash-Next NVFP4 and Qwen3.8-27B NVFP4 (--num-drafts 1, K=2 verify); 4/4 requests answered on each.Generated with Devin