Skip to content

Reject safetensors vocab shape mismatches#546

Open
wang-tong0 wants to merge 1 commit into
mainfrom
reject-safetensors-shape-mismatch
Open

Reject safetensors vocab shape mismatches#546
wang-tong0 wants to merge 1 commit into
mainfrom
reject-safetensors-shape-mismatch

Conversation

@wang-tong0

Copy link
Copy Markdown
Collaborator

Summary

  • add a lightweight safetensors header check after the existing config allowlist validation
  • verify embed/lm_head vocab and hidden dimensions match config.json without downloading full shard bodies
  • add regression coverage for the UID79-style 151669 vs 151936 vocab mismatch and transient header-read skips

Root cause

UID79 passed the config-based allowlist because config.json advertised a valid Qwen3-32B shape, but SGLang crashed at load time because the safetensors embedding weights had a smaller vocab dimension than config.vocab_size.

Validation

  • pytest -q tests/test_model_size_checker.py
  • check_model_size on UID79 model now returns pass=False with weight_shape_mismatch:model.embed_tokens.weight.dim0=151669 expected_vocab=151936

Note: the unrelated untracked docs/AFFINE_KEY_FILES_AND_CALL_GRAPH.md file was left out of this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant