Repository navigation
qwen38: read NVFP4 PLE planes from a checkpoint folder - #660
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: No reachable behavior defect or proven quality defect was found.
Non-blocking
⚠ Verify the final planner revision: crates/model/src/arch/qwen35moe/place.rs:394.
The PR reports that its GPU runs precede the final reserve and placement changes. Run just gate-gpu-qwen4exp-nvfp4 against the checkpoint folder at the final head and attach its output. This exercises the changed planner through a GPU load.
Checked
Duplicates: 10 new items checked; no duplicate owner found. Dryer reported 0 pairs. GPU owners were checked by Grep.
Complexity: nvfp4_rows_scale (new, 19) extracts metadata validation. ple_rows (13→21) and PleHost::new (28→33) add layout validation; fill_spanned (12→16) adds plane dispatch. Each retains one job.
Silent failure: 3 refusal paths followed: plane shape/count, invalid scales, and helper I/O. Each returns a named error to its caller.
Tests, static mutation check: crates/gguf/src/quant.rs:1131 swap nibbles; crates/gguf/src/quant.rs:1079 remove the short-scale check; crates/model-hf/src/arch/qwen35moe/folder.rs:244 omit a run; crates/gpu/src/arch/qwen3moe/body38.rs:582 submit only one plane; crates/model/src/arch/qwen35moe/place.rs:394 force Split; crates/placement/src/placement.rs:2886 count one plane; crates/placement/src/placement/nodes.rs:1528 omit serial fill latency. Each mutant fails a changed test's assertion or success requirement. Other test edits update signatures or fixtures.
Gates: no band, threshold, or lint level moved. The reader's FAIL-first result is in the PR body.
Adversarial checks: truncated planes, invalid scales, empty fills, and interrupted prefetches are blocked by validation, error propagation, or draining the pending job.
Escape catalog: no C1–C4 pattern matched.
Notes
No builds or tests were run during this review.
Card check: gpu-evidence. This pull request changes crates/gpu/src/arch/qwen3moe/body38.rs and carries a gate run on the author's card, which counts as verified.
🔨 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 체크포인트 폴더를 분할 파일로 바꾸지 않고 그대로 불러올 수 있게, 값과 스케일이 따로 저장된 NVFP4 PLE 행을 폴더에서 직접 읽습니다.
Part of #565.
What and why
A Qwen3.8 FP4-Local checkpoint folder now loads with
-m <folder>, without first being prepared into a split. The folder stores its per-layer embedding (PLE) table,per_layer_token_embd.weight, as NVFP4 rows in two planes: the 4-bit codes (80 B for a 160-value row) and the block scales (10 B). A folder load used to read only F8 PLE rows, so it refused this table with(nvfp4_rows) is stored in another layout: prepare the folder into a split.This PR reads both planes where the checkpoint stores them. The existing row table and prefetcher gather the two planes. One decoder and one rounding rule serve the packed rows of a split and the separate planes of a folder, so a row decodes to the same bits from either layout. The folder normalizer and the folder reader share one ModelOpt metadata check for these rows, and the refusals for a wrong width, row count or scale are kept.
The planner keeps a PLE table read from a checkpoint folder on NVMe, even when the unified memory pool could hold it, the same way it treats a split's NVMe table. A host-resident copy would keep that memory for the whole run. Its page-cache reserve counts both planes, since one row read touches a page of the code plane and a page of the scale plane. Ordinary, node-assigned and multi-slot plans all go through one row placement owner. A mapped split keeps its room-dependent placement, and a hand-written Host plan for a folder table still gets its named
OnCard/PleHosterror.Release notes: Added: A Qwen3.8 FP4-Local checkpoint folder loads directly, with its NVFP4 PLE table read from the folder's value and scale planes.
Code shape
RunTable, the prefetcher and the NVFP4 group decoder are the existing ones. The packed and the separate layout share one decoder and one metadata check.group_countanddecode_groupsand still fire.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line): none. Ten new items (the plane descriptor, the row-table list, the shared scale check, the plane decoder, the backing getter and the source placement entry among them) were checked against the existing owners.What I ran
Head
4aaaff7d1, base mainc80347607. Its four commits rebasee8f660b1fwithout changing their diffs (git range-diffshows all four as equal). One8f660b1f,cargo check --workspace --all-targetsbuilds every crate (Finisheddevprofile [unoptimized + debuginfo] target(s) in 26.92s), and the placement, model and folder tests pass:test result: ok. 175 passed,test result: ok. 24 passedand the folder testa_table_s_rows_are_read_where_the_folder_stores_them ... ok.cargo test -p bloomery-model --test qwen4exp_mtp_reservegivestest result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05son an earlier head of the same commits. That result and the GPU results below ran before two later changes, both in the planner only: the page-cache reserve that now counts both PLE planes, and one placement entry point that takes the row source. Neither touches the reader, the decoder or the device path.On an NVIDIA GB10 (a DGX Spark), CUDA toolkit 13.3.1:
Unit tests:
cargo test -p bloomery-model-hf --lib a_table_s_rows_are_read_where_the_folder_stores_themgivestest result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 28 filtered out; finished in 0.00son main's reader.cargo test -p bloomery-hf --lib modelopt::testsgivestest result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 73 filtered out; finished in 0.11s, andcargo test -p bloomery-model-hf --lib arch::qwen35moe::folder::testsgivestest result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 28 filtered out; finished in 0.00s.cargo test -p bloomery-gguf --lib nvfp4_rowsgivestest result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 48 filtered out; finished in 0.00s. They cover the separate-plane decode and its refusals.cargo test -p bloomery-placement --libgivestest result: ok. 174 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 11.48s. Its row-room test pins the reserve of a PLE table at 4,096 positions, 16 rows per position and 4,096-byte pages:(RowTableSource::Split, 536_870_912)for a split's packed rows and(RowTableSource::Parts, 1_073_741_824)for a folder's two planes. A case whose code row crosses a page boundary failed on the packed count before the change.cargo test -p bloomery-model --lib arch::qwen35moe::place::tests::givestest result: ok. 24 passed; 0 failed; 0 ignored; 0 measured; 440 filtered out; finished in 0.02s. The planner-entry testan_f8_ple_table_and_its_scale_describeis one of them. It checks the exact NVMe reserve for ordinary, node-assigned and multi-slot plans and the room-dependent mapped split.The owning GPU gates, run on the Spark itself (
BLOOMERY_BOX_LOCAL=1); for the second oneBLOOMERY_REF_MODELnames the FP4-Local checkpoint folder, so the gate loads the folder:The second gate compares the folder load with the pinned transformers reference of the checkpoint (
hf-qwen4exp-nvfp4): the last argmax of the one-pass batch and the token at position 3000 equal the reference's.Difference from the reference: none in the checked argmaxes.
GPU crate tests, with the build of
bloomery-servefor sm_121 in the same run:One of the five,
a_folder_s_stored_rows_decode_as_the_split_s, checks that the stored planes and the packed rows give equal bits.Real checkpoint
nvidia/Qwen3.8-Flash-Next-FP4-Local(revisionb9ce18a6), loaded from the original folder withbloomery-serve -m <folder>and no intermediate GGUF. Four 4096-token windows, two code and two English prose, give 48 greedy tokens each, and the text equals what the same checkpoint prepared into a split gives:Folder against split, 4K prompt, one request at a time (C@1), on the same card. Each arm loads once and serves two identical requests. All four outputs equal the saved reference output. The folder arm runs this branch, and the split arm runs #649 on the same checkpoint prepared into a split as stored.
There is no measurable difference in this short run. The PR adds a way to load the original folder, and it makes no speed claim. Conditions: the
code-fncorpus at offset 0, 4096 input IDs, 48 greedy output tokens, context 4224, draft off,--cache-ram 0,cache_prompt=false. Every response reports 4096 prompt tokens, 48 output tokens and zero cached tokens. Both arms setBLOOMERY_HOST_ROOM=96G, because a mapped split's automatic placement would otherwise hold the PLE table on the host. At that setting both arms read PLE from NVMe and keep every routed expert on the card, and the folder arm's plan has no resident host table.What I ran into
This does not block the PR. A separate-plane row has the same logical payload as a packed 90 B row, but its two reads may cost a different amount of page I/O on NVMe. The short run above shows no difference in speed, and I did not measure per-read cost. I measured nothing on two DGX Sparks. The loader this PR extends is the one the GLM FP4-Local folder load already uses, and no rank count, kernel or GLM behavior changes here.
Hardware (if the change is for a machine)
An NVIDIA DGX Spark (GB10), with the
nvidia-smilines above.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.