Repository navigation
model-hf: a GLM folder's target load no longer plans the NextN tensors it does not use - #727
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: Target loading excludes unused tensors and preserves named failures for required trunk tensors.
Non-blocking
⚠ Reusable diagnosis: crates/model-hf/src/arch/glm5next.rs:1422. The planner-refusal probe lives only in the unit test. Expose it through an existing checkpoint tool or record, or explain why the named load errors provide sufficient diagnosis. This keeps real-folder investigations from rebuilding the probe.
Checked
Duplicates: 3 new functions checked; no duplicate requiring another owner. The existing module classifier also accepts mtp.; GGUF layer parsers accept a different namespace. Dryer reported 0 pairs.
Complexity: crapper flagged no changed functions.
Silent failure: 2 parsing/fallback sites followed. Unprefixed names are supported; malformed layer names reach a named mapper error.
Tests: static mutation review of all 3 added or changed tests. Removing either planner filter at crates/model-hf/src/arch/glm5next.rs:452 breaks the new successful-open cases; suppressing required-tensor errors at line 714 breaks the completeness assertions; dropping a mapped trunk tensor at line 734 breaks the rank test's tensor-set comparison.
Gates: the narrowed completeness check carries PIN(2026-10-23) and its reason; full-geometry NextN completeness remains tested. No numeric bands or lint levels moved.
Adversarial checks: trunk quantization refusal, missing boundary-layer tensors, malformed layer indices, and vision-only tables remain named errors. The production caller rejects MTP for folder TP loading. Qwen resolves refusals only for mapped sources.
Performance: folder loading only; no decode, prefill or kernel path changed.
Escape catalog: no C1–C4 pattern matched.
Notes
Tests were not run in this review. The PR reports a FAIL-first reproduction and 9 passing GLM tests. It carries no GPU gate evidence.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
GLM 체크포인트 폴더를 target으로 열 때, target이 쓰지 않는 NextN tensor의 양자화 거부가 로드를 막던 결함을 고칩니다.
Part of #565. Tracked in #699.
What and why
Opening a GLM-5.3 checkpoint folder as a target failed when the quantization planner refused a NextN tensor, for example a NextN
eh_proj.weightstored as U32. The target never reads NextN, so a refusal there should not stop the load. The folder open handed every tensor of the whole text model to the planner, NextN layers included, and returned the first refusal. The required-tensor check had the same reach and also asked for NextN tensors the target does not read. This came in with 146c130 (#519), which plans a checkpoint folder over N ranks.Fixes in
crates/model-hf/src/arch/glm5next.rs:placed_mappasses the planner only the layers of the geometry it is given, andopengives it the target trunk geometry. A refusal on a trunk tensor still fails the open.mapalready did moved intotext_nameandtext_layer, so the map and the planner filter read the three accepted name prefixes through one function. GGUFblk.*names are not taken as checkpoint names.The GGUF MTP path (
NextnInputs::read) still checks NextN's count, attention kind and required tensors and is unchanged. The only production caller of the folder open is the GLM tensor-parallel plan, which already refusesBLOOMERY_DRAFT=mtp, so this adds no NextN support for folders. The existing NextN-missing test stays: under the full geometry the planner and the required-tensor check still refuse a NextN problem, and the same fixture opened as a target gives the same rank bytes as before. The narrower check scope carries a datedPINcomment.The Qwen folder open is a separate path and is not touched here.
Code shape
mapand the planner filter.Read::alland the geometryrequiredused to return are removed, since nothing needs them now.PIN(2026-10-23):and its reason.cargo fmtis clean on the file (rustfmt --edition 2024 crates/model-hf/src/arch/glm5next.rs, andgit diff --check). I did not runcargo clippyfor this change.Duplication found or removed (
path:line): none. The two checkpoint-name parsers in other crates (crates/model/src/fixture/plan.rs:222,crates/model/src/arch/classify.rs:46) only accept GGUFblk.*names, sotext_layerdoes not reuse them.What I ran
FAIL first, on the commit that adds only the reproducing test to main, on a DGX Spark:
The failure is the U32 planner refusal on the NextN tensor reaching the target
open.On the head, on a Linux machine, with the target directory rebuilt from this head:
The new test covers a target that opens when only a NextN projection or expert is refused (the full geometry still refuses it, and every part of the opened target is read), the same U32 on a trunk attention projection or expert (the target refuses it), and all three name prefixes. The existing GLM folder tests, including the N = 1, 2 and 4 part match against the GGUF, pass.
Not run: the PR's other checks (lint,
cargo clippy, the workspace-wide tests and GPU gates). This change touches no GPU code, public signature or device arithmetic.What I ran into
This does not block the PR. A new HF folder draft caller would need the full geometry with the strict planner so that a NextN refusal reaches its draft choice; no such caller exists today.
Hardware
No GPU path changes. The tests are host-only and ran on a DGX Spark (FAIL first) and a Linux machine (head).
Release notes: Fixed: A GLM-5.3 checkpoint folder opens as a target even when a NextN tensor it does not use is refused by the quantization planner.
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.