Repository navigation
gpu, glm5next: a route trace's load views only the layers the host computes - #739
Conversation
`folder::open` mapped and planned the folder's `mtp.` tensors before the seat chose a draft, and returned their refusal as the folder's: a folder whose MTP layer the draft does not read (an F32 input projection, say) refused the server even with `BLOOMERY_DRAFT=off`. The MTP layer is now prepared on its own (`folder::mtp`), and its refusal is held in `Opened::draft` beside a target that opens as before. A layer the preparation takes is then read by the draft's own reader (`MtpInputs::read`), so a partial layer the preparation passes is caught too, before the image seat reads the draft's word. The seat applies the existing draft rule to either refusal: a set `mtp` is refused with it, an unset draft goes off with `Draft38Off::FolderMtp`, and `off` stays as set.
…mputes A load made for a route trace keeps every layer's host leg, because the host service writes the trace. On Qwen3.8 and GLM-5.3 that also built a host view of each layer whose experts all sit on the card, and the host kernels refuse an NVFP4 stack, so an all-card NVFP4 load with `BLOOMERY_ROUTE_TRACE` set was refused. The host run now views a layer only where the host can compute its experts: one with an expert off the card, or any layer under a residency machine. The trace's service of a card-resident layer lists no expert, and `HostRun` writes that empty sum as zeros without a view, for the step and both union calls. A list that names an expert there is still refused by name. `gate_glm5next_e2e --only hostless` now opens the NVFP4 and the Q4_K fixtures for a trace, writes it, and holds every slot on the card and the plain load's logits. `gate_qwen4exp_nvfp4` adds (rt), the same on the NVFP4 checkpoint, and `gate_qwen4exp_e2e`'s whole-card plan counts the host views with every host leg kept.
There was a problem hiding this comment.
Verdict: CLEAN: No behavior defect or proven quality defect remains in the reviewed changes.
Non-blocking
⚠ Complete the dispatch proof: crates/gpu/src/host/run.rs:391 adds an empty-list check per host service: [derived] H checks per decoded token across H serviced layers for single-row decode.
Supply the move/split class's identical PTX proof (just canon-check BASE or equivalent scans) and the host dispatch path's same-lease base/head A/B required by AGENTS.md, at the reviewed commits.
Checked
Duplicates: 13 new functions/constants checked. The dryer pair at run.rs:436/463 serves different union policies; extracting its short wrappers adds elements. No qualifying duplicate remains. Gate helpers were also searched manually.
Complexity: traced is a new load/trace/compare pipeline. hostless and card_whole add coverage checks; run adds a gate call; Draft38Off::fmt adds one match arm. No kernel body changed.
Silent failure: 3 paths followed. MTP preparation and reader errors reach named refusals or draft-off reasons. Missing-view calls write zero only for empty lists with valid shapes; listed experts and malformed shapes return errors.
Tests: static inspection shows that propagating the MTP error at qwen35moe/folder.rs:156, dropping the reader refusal at serve_seats/qwen38.rs:963, removing the zero path at host/run.rs:391, or restoring traced views at body38.rs:1890 or gpu-glm5next/body.rs:1687 would fail the corresponding unit/gate assertions. Tests were not executed here.
Gates: the changed GLM host-view clause has a dated PIN and FAIL-first output; numeric bands are unchanged. No gate was removed.
Escape catalog: no C1–C4 pattern matched. Residency loads retain every host view; step services reject invalid layers and non-finite activations before the new zero path.
Notes
GPU evidence is incomplete: the reported runs name head 5bf6f0a17 and base b9dfc4a, rather than the reviewed commits, and omit the exact checkpoint path. The unavailable Qwen fixture run is explained in the PR body.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/bloomery_serve_qwen38.rs, crates/gpu-gates/src/bin/gate_glm5next_e2e.rs, crates/gpu-gates/src/bin/gate_qwen4exp_e2e.rs … and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.
🔨 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. |
Qwen3.8 체크포인트 폴더의 MTP 층 때문에 서버 시작이 거부되던 문제와, route trace를 켜면 모든 카드 상주 로드가 거부되던 문제를 고쳤습니다.
Part of #565. Tracked in #699.
What and why
Two defects refuse a load that has nothing wrong with it. This PR fixes both in the shared owners and changes no output.
folder::openincrates/model-hf/src/arch/qwen35moe/folder.rsmapped and planned themtp.tensors before it built the target header, and returned any error from that step as the folder's error. An MTP layer the draft cannot read (an F32mtp.fc_embedding.weight, a second MTP layer, an unquantized expert stack) therefore refused server start even withBLOOMERY_DRAFT=off. The MTP preparation now lives infolder::mtp, andOpened::draftis aResult<Option<Split>, Error>, so the target opens whatever the MTP layer holds. The seat applies the existingBLOOMERY_DRAFTrule through a newDraft38Off::FolderMtpreason: a setmtpis refused with the layer's own refusal, an unset draft turns off and records why, andoffis unchanged.docs/serving.mdsays so in one sentence. Introduced by 5b302b3 in qwen38: load the checkpoint folder MTP draft in its stored formats #682.gpu-glm5next/src/body.rsandgpu/src/arch/qwen3moe/body38.rs) then built a CPU host view of every layer. NVFP4 expert stacks have no CPU kernel, and a checkpoint folder's header-only split has no bytes behind a host view, soHostRun::buildrefused the load. The rule for which layers get a view now lives in one place,HostRun::viewedincrates/gpu/src/host/run.rs: a layer that has experts off the card, or any layer when the residency machine runs. The trace no longer counts. A host leg kept for a card-resident layer sends an empty expert list, andHostRun::zero_sumwrites its sum as zero without a view. Lists that carry experts, calls with the wrong column count and anoutof the wrong size are still refused by name. The sum of an empty list was already zero with a view, so the output bits, the handoff and the graph and launch counts do not change. Introduced by 4390628 in placement, model, gpu, gpu-glm5next, gpu-gates: glm5next's card leg runs its routed stacks by its arms, NVFP4 in its planes and the 32-value downs included; the leg's buffers hold the forms its layers' downs read #651, 0bd19ed in gpu: Qwen3.8's step and verify skip the host leg on a layer the host serves nothing, and the hc norm loads a chunk before it uses it #45 and bf49c4f in gpu, model, refset: Qwen3.8 served from the NVIDIA NVFP4 checkpoint on one card, every routed expert on the card, against its pinned oracle #561.The
HostCfg::route_trace,CardExperts::hostlessandBLOOMERY_ROUTE_TRACEregistry texts now describe this behavior.Code shape
attach_traceis the one owner.HostRun::viewedand gained no per-model branch.BLOOMERY_DRAFT=mtpasks for the draft. Malformedzero_sumcalls are named errors.traced_relband is unchanged.cargo fmtis clean on what I touched, and the lint run below is clean. The lint warning count did not go up.Duplication found or removed (
path:line): the two view-selection predicates inbody.rsandbody38.rs, and the three trace-header blocks ingate_glm5next_e2e.rs.What I ran
All runs are on head
5bf6f0a17, with baseb9dfc4a74for the FAIL-first runs.Unit tests, with each fix undone in turn
Three unit tests cover the changed code. The first block is their output at head. Each test then runs with its fix put back to the old behavior:
a_target_opens_whatever_its_mtp_layer_holdsopens a small Qwen3.8 folder with a BF16 MTP projection, an F32 one and none. Withfolder::openreturning the MTP refusal again, the F32 layer refuses the target and the test stops:a_sparse_set_serves_its_layers_and_refuses_the_gaps_by_namecalls the host run for a layer without a view. Withzero_sumremoved, the old refusal comes back and the test stops:a_folder_load_refuses_a_set_mtp_draft_and_turns_an_unset_one_offchecksmtp, unset andoff. With the layer's refusal dropped from themtperror, the test stops:GLM hostless gate, with the old body
gate_glm5next_e2e --only hostlessopens an NVFP4 and a Q4_K fixture as traced loads and checks host views 0, a complete trace, every slot on the card and the plain load's logits. At head:With the base
gpu-glm5next/src/body.rsover head:The NVFP4 line under the old body reads:
the route trace's load FAILED: HostRun::build: host union: the gate must map embd -> ff: every expert of blk.0.ffn_gate_exps.weight (nvfp4, k = 256): no fused qdot kernel for weight type NVFP4 in this build.Real checkpoints
The NVFP4 gate opens the real Qwen3.8 NVFP4 checkpoint as a traced load and runs the batch set's ids:
Serving both Qwen3.8 model folders (FP4-Local and NVFP4), I started
bloomery-serveonce per arm, sent one greedy request and stopped it. WithBLOOMERY_DRAFT=off,BLOOMERY_PREFILL=steps,BLOOMERY_ROUTE_TRACEandBLOOMERY_DRAFT=mtp, both folders load and answer. The traced runs write a trace of every slot on the card:For FP4-Local the four arms return the same text. For NVFP4 the
offandmtparms agree with each other, and so dostepsand the traced arm. The base binary gives the sameoffandstepstexts as head on this request, so the split between the prompt path and the step path does not come from this change.The base binary with the route trace set refuses both folders at load:
For the MTP case I moved the NVFP4 folder's
mtp.fc_embedding.weightinto an F32 shard. The base binary refuses it with the draft off. At head,offand unset serve the target and give the same text as the unmodified NVFP4 folder, and the unset arm records why the draft is off.BLOOMERY_DRAFT=mtpis refused with the layer's name:Lint
This is the workspace clippy run (
BLOOMERY_BOX_LOCAL=1 just lint) with every feature.Not run
gate_qwen4exp_e2eat the fixture tier did not run: its fixture oracle set for this model is not on the machine I used, and it stopped at start. I changed one assertion there (with every host leg kept, the host view count isn_layer - whole). The view count of the same traced load on the real checkpoint is covered by the(rt)line above. The GLM gate is a workstation-card gate, so I ran it on an RTX 5090 machine; a GB10 card refuses to start it.Hardware
DGX Spark (GB10) and an RTX 5090 machine.
The CUDA version on the GB10 line is the toolkit in the build container.
What I ran into
This does not block the PR. A GLM-5.3 model folder looks to have the same shape as the Qwen3.8 MTP case:
placed_mapincrates/model-hf/src/arch/glm5next.rsrefuses the whole folder when the quantization planner refuses any NextN tensor, though a folder load builds no NextN part. I read it but did not reproduce it, and this PR does not touch that file.Release notes: Fixed: a Qwen3.8 model folder whose MTP layer the draft cannot read serves its target again, and a route trace no longer refuses all-card loads.
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.