Repository navigation
qwen38: load the checkpoint folder MTP draft in its stored formats - #682
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: No must-fix defect was found in the changed code.
Non-blocking
⚠ Pin native draft numerics: crates/gpu-gates/src/bin/gate_qwen4exp_nvfp4.rs:515.
Eager, graph and replay compare the same loaded draft. The mapper test at crates/model-hf/src/arch/qwen35moe.rs:1435 asserts PlusOne for enorm and hnorm, but omitting only the head norm's transform while retaining F32 is not covered by its assertions. The greedy oracle checks target-verified output. Compare one native draft hidden or logit row against an independent checkpoint forward.
⚠ Complete the measurement evidence: docs/cards/q38-fp4local-mtp.card:12.
The PR body supplies hardware lines and gate output, but omits the measured commit hashes and the A/B commands with their output. Attach those witnesses under CONTRIBUTING's evidence rule; identify both arms by SHA even when they use the same binary. This remains a non-blocking request for reproducible measurement evidence.
Checked
Duplicates: supplied dryer diagnostics report zero pairs; GPU crates were excluded from that scan.
Complexity: diagnostics report new gate::mtp (24), extracted planned_tensors (16), and branch growth in mapping, planning, loading and gate functions. Complexity alone establishes no defect.
Silent failure: draft mapping rejects an incomplete projection join and an extra draft layer with named errors.
Tests: inspected mapping assertions, join-order coverage, MTP execution-mode comparisons and the verified-token oracle.
Gates: the cited gate compares token, probability and hidden-state bits across eager, graph and replay. Neither retained concern matches escape catalog C1–C4. The ledger has no lessons in force.
Notes
Validation was static; runtime gates and compiled tests were not run.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/bloomery_serve_qwen38.rs, crates/gpu-gates/src/bin/gate_nvfp4.rs, crates/gpu-gates/src/bin/gate_qwen4exp_mtp.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 FP4-Local 체크포인트 폴더에 들어 있는 MTP draft를 저장된 형식 그대로 읽어 켜는 작업이고, 코드 입력에서 decode가 최대 71.84% 빨라집니다.
What and why
Part of #565. This closes the line in its section 4: "MTP draft from the FP4-Local checkpoint: W4A16_NVFP4 experts and BF16 dense parts".
nvidia/Qwen3.8-Flash-Next-FP4-Localships its MTP layer inside the checkpoint folder: BF16 dense matrices, W4A16_NVFP4 routed experts with their tensor-scale companions, and F32 injects. The folder path refused a draft, so MTP on this checkpoint needed a separate GGUF draft. Now both serving entry points find the folder's draft and run it without a prepare step.What the PR changes:
fc_embeddingbeforefc_hiddenalong the input columns, and applies the existing zero-centered norm transform.model::part::Filtered, so the target plan never sees MTP tensors and the draft plan never sees trunk tensors. Strict OnCard placement checks are unchanged.RowValues, the E2M1 table, the E4M3 decoder, the lane accumulation and the existing fault owner. The new kernel entry has its PTX shape pins.Existing paths: a GGUF draft and a folder served with draft off load through the same code as on main. There are no TP protocol changes, and draft limits for several ranks are unchanged.
Release notes: Added: MTP draft served directly from the Qwen3.8 FP4-Local checkpoint folder, with decode up to 71.84% faster on code at one request.
Code shape
The review reads these first. A box left unticked needs one line of why.
RowValues, the E2M1 table, the E4M3 decoder andf32_lane_partial_1col.model::part.PIN(2026-10-23):line with the measured values.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none":crates/gpu/src/q8f32.rs:2274againstq8f32.rs:1815(Q8_0 rows): different. The new entry reads NVFP4 code and scale planes and one tensor scale per selected expert; Q8_0 reads packed blocks. Both callf32_lane_partial_1col.crates/gpu/src/q8f32.rs:2274againstq8f32.rs:1923(MXFP8): different. MXFP8 reads E4M3 values with E8M0 block scales; NVFP4 reads E2M1 values with E4M3 scales. The traversal and decode helpers are shared.crates/model-hf/src/arch/qwen35moe/folder.rs:244againstcrates/model/src/fixture/plan.rs:208: different.draft_headerbuilds a header from a copy of the target's metadata array; the fixture only borrows its array.What I ran
Decode, draft off against native MTP
One DGX Spark, one slot,
nvidia/Qwen3.8-Flash-Next-FP4-Localatb9ce18a6, C@1. Each request processes 4096 prompt ids with no cache hit and generates 128 ids, on four corpora. There are two alternating rounds with one request per corpus per round, so eight matched windows per mode. The table gives the median decode tok/s of the two rounds, and the draft ids accepted over drafted, summed over both rounds.Decode delta per corpus: code-fn +51.24%; code-js +71.84%; prose-en +5.28%; prose-ko +27.63%.
All 1024 generated token ids per mode (8 windows of 128) equal the draft-off ids, with 0 mismatches and 0 errors. Two rounds make this a short comparison: the numbers are decode-rate gains at one request, not a long-run confidence claim.
The decode gain does not carry over to the whole request on every corpus. Median full-request time, draft off against native MTP, is 12328 against 11105 ms on code-fn, 12333 against 10777 ms on code-js, 12206 against 12285 ms on prose-en and 12250 against 11646 ms on prose-ko. Median time to first token rises from about 7.9 to 8.0 s with draft off to about 8.2 to 8.3 s with MTP.
The plain-read ceiling on the node was 239.3 GB/s before the sitting and 240.3 GB/s after.
Oracle and gates
The MTP gate on a GB10, with the FP4-Local folder as the reference model: the folder draft loads, eager, graph and replay agree on a poisoned scratch at rows 1 to 4, and the greedy oracle matches.
The NVFP4 gate on a GB10: the three routed F32 clauses pass against their bands, the id and non-finite refusals name their cause, and an F32 product overflow is detected.
just contrib-check --tier t0on this head:DONE tier=t0 total=107 red=0 wall=484s.The numeric runtime code on this head is the code the gates and the comparison ran on. Since then only a test fixture and the new entry's PTX pin rows changed.
What I ran into
None of this blocks the PR.
regs=40,spill=0, no depot, no local loads or stores,reqntid=256). The cc 8.6 driver JIT was not measured, and the pin says so.Hardware (if the change is for a machine)
The change is for DGX Spark. The gates ran on a GB10 with these lines from
nvidia-smi:The C@1 comparison ran on a second DGX Spark with the default clock policy, with the server built by
cargo oxide build --arch sm_121 -- -p bloomery-gpu-gates --features glm5next,clef,mimo2,solar2,minimaxm3,gemma-embedding2,checkpoint --release --bin bloomery-serve.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.