Repository navigation
XPU: validate Qwen4-35B-A3B FP8 checkpoint geometry - #6372
Conversation
|
Downstream prefill measurements are available for reviewers following #6317. This PR covers the FP8 checkpoint headers, Engram/PLE geometry and TP allocation plans. The measurements below came from the subsequent native serving and sparse-index changes. On four Arc Pro B70s with the official FP8 W8A16 target, PLE, BF16 DFlash2, prefix caching disabled and 4,096-row solo chunks, the sharded indexer reduced median client time to first token from 10.586 to 9.972 s at 32,768 tokens and 22.295 to 20.246 s at 65,152 tokens. The latter is 3,218 input tok/s. All 256 generated IDs per scored request matched the plain reference. At the default 2,048-row chunk size the 65,152-token result was 23.09 to 21.11 s in one paired run. The earlier GDN/chunk comparison is tracked in #6395. The follow-up qualification and maintainer's additional boundary and exchange gates are tracked in #6413. Raw samples and reproduction |
|
Thanks @supernovae. The change stays inside the XPU family, and the existing affine shape values and PLE arithmetic are unchanged. Three things are left before landing, and we'll do all of them ourselves on this branch:
This validates checkpoint geometry; FP8 serving and its token checks come with the follow-up PRs. Nothing more is needed from you here.
|
7c26d03 to
1ab9104
Compare
|
Thanks, @supernovae, for the geometry check and the FP8 PLE path. The published checkpoint's config and layout pass it. The published checkpoint passes on its layout. For
What we added on your head (rebased onto current main with no conflicts; your commit is unchanged):
Nothing is left that we need from you. We have no Intel GPU, so if you can run
|
|
Ran the reviewed head Reproduce with |
|
READY to land on this head. Author run on this head against the real, unmodified Qwen/Qwen4-35B-A3B-FP8 at 4d35041fcd: the checkpoint check exits 0 (30720 FP8 expert matrices, TP=2 and TP=4 layouts, PLE lookup equal across all 32 chunkings) and the host target passes 24 of 24. XPU-only; we have no XPU hardware, and no other backend's code changes.
|
|
With the FP8 reader now in main, I prepared a tested merge of the reviewed Rebased headThe minimal integration combines the current checkpoint head |
1ab9104 to
dae7400
Compare
dae7400 to
369b528
Compare
|
READY to land on this head. Same tree as the head the train passed; the only change adds author credit trailers to our two commits.
|
…e refusal per geometry check zig/tests/fixtures/qwen4_fp8 holds the unedited config.json of Qwen/Qwen4-35B-A3B-FP8@4d35041fcd017a5608bd83bb65388757919d029c and facts.json, an extract of the index and all 33 shard headers that the checker reads (expert and PLE tensor names, dtypes, shapes, counts and the PLE tensors' offsets) with the sha256 of each full file. test-flashnext-xpu-host now parses the published config to the FP8 shape, binds it to its digest, and refuses one case per check, each varying only that field: no head_dim, vocab_size one past, layer_types missing or one short, a field that is not an integer, and a PLE layer list other than [2]. Removing each check fails its case. Co-authored-by: Byron Miller <1461719+supernovae@users.noreply.github.com>
…he host tests, every PLE chunking checked xpu-flashnext --check-checkpoint printed from code in xpu_main.zig that no host test reached. The check now lives in xpu_checkpoint.zig and returns what it read; --check-checkpoint prints it as before. test-flashnext-xpu-host builds a sparse checkpoint at the published names, dtypes and shapes (facts.json), with the hash vectors the config derives and non-zero codes in the rows the check gathers. It passes (30720 expert matrices, 128 PLE shards of 1250028 x 128) and runs each reachable refusal: an expert missing or of another dtype or shape (by name), the PLE scale or a hash vector missing or misshapen, an empty head, a gap between heads, a table one row short, a NaN, zero or negative scale, a misshapen n-gram shard, all-zero gathered rows and a refused geometry. Expert refusals pass a Why instead of logging, and the n-gram shape refusal's error log is skipped under test, so the host tests can reach them. The chunk check keeps the EOS seam and adds every split of the same tokens into non-empty chunks (32, ordinary seams 1 and 5 among them), each required to equal one whole call in rows and history. A planted history reset at an ordinary seam fails it. Co-authored-by: Byron Miller <1461719+supernovae@users.noreply.github.com>
369b528 to
530eee5
Compare
|
Thank you @supernovae. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
What this changes
Add the offline
xpu-flashnext --check-checkpointcommand for the official Qwen4-35B-A3B FP8 checkpoint. It validates the expert and Engram/PLE headers, checks exact PLE gather across a chunk seam, and reports the Xe2 TP=2 and TP=4 geometry and resident weight floor. This is the first host-validation slice from the maintainer's scope.mainatbf1a2eb229fca83bda61125122b22c4edd5a5033.Checks on this head
7c26d0343cc30eb9d0331a328b413533928ffd11.zig build test-flashnext-xpu-hostpassed six tests with zero failures or skips. The host-onlyxpu-flashnextbuild passed.2a6d799b4b8e9e86. Changing the hidden size or the FP8 scale block size made the diagnostic reject the fixture.Reproduction
Use Zig 0.17.0. Set
OCLOCandNGEN_HEADERSto the compiler and the oneDNN nGEN headers. SetQWEN4_DIRto the local snapshot of Qwen/Qwen4-35B-A3B-FP8 at 4d35041fcd017a5608bd83bb65388757919d029c.Receipt
--check-checkpointruns the explicit offline diagnostic and exits after reporting validation.TensorFold/Qwen3.8-Flash-Next-MLX-4bit-MTP@2b170fa6309d5d1ee380b35636075fac7945f286fixture used a 2,048-token prompt and 48 greedy output tokens. Main and this head returned identical token IDs. Perfect and incorrect speculative windows both matched plain decoding. Embedded MTP matched plain and accepted 30 of 41 proposals on both builds. The single-run main/head samples were 626.7/669.0 tok/s in prefill and 53.4/54.3 tok/s in plain decode.Checklist