Repository navigation
docs: GLM FP8 latent cache diagnostics on FP4-Local at TP=2 on two GB10 - #3432
Conversation
|
Why the FP8 cache is not faster here. A smaller cache would suggest faster prompts and decode, but on this model it cannot be, for three reasons.
What the FP8 cache gives is capacity: about 32% fewer bytes a token, so longer windows or more streams fit. That is all this receipt claims. A follow-up pull request will load the codes in wider units (and asynchronously) to shrink the 3 to 5%, with replies byte for byte unchanged. It cannot make FP8 faster than BF16 here. |
|
Thanks @laudney. The receipt is useful, and its hashes and summary tables check out. It also shows that the FP8 cache changes all three golden replies against the BF16 cache. We cannot mark a token-changing mode qualified, including an opt-in. Please keep these results as diagnostic evidence and remove the qualification claim from the recipe and ledger; equality within the FP8 mode does not establish equality with the BF16 baseline. The required CI is also still pending at
|
|
@ashhart Thanks. Head is now
|
|
Follow-up to the speed comment above: #3454 makes the FP8 chunk kernels prefetch their codes in 8-byte loads, byte-identical rows, cold prompts 4.4 to 4.6% faster from 8k up and 4-stream decode 2 to 4.5% faster. It is independent of this PR; whichever lands second updates the recipe's "cold prompts 3 to 5% slower". |
|
Thanks @laudney for the quick turnaround, and for keeping the push to one new commit so it's easy to follow. Our earlier asks, at
I checked the receipt's numbers against its data. Must fix:
Optional:
Once item 1 is in and CI is green at the new head, this has no device check left: it changes docs only, and the receipt's numbers check out against its own data.
|
|
@ashhart Thanks, you are right. Head is now
CI pending at this head. |
|
@laudney, the qualification claim is gone from the recipe and the ledger, the receipt's scope says the same, Nothing to change from us. Once this and the prefetch work have both landed, the recipe's "cold prompts 3 to No device run is needed for this one: it changes documentation and reaches no inference, and the measurements
|
Since 1.1.2 the recipe has said the opt-in --kv-cache fp8 cache's native quality and device qualification are pending. This receipt measures both on FP4-Local at main 3a56d4e on two GB10: over 360,418 teacher-forced positions the FP8 cache keeps the mean NLL within 0.06% of the BF16 cache with a top-20 KL of 0.016, a third of the 0.043 between NVIDIA's NVFP4 and FP4-Local, a BF16 rerun gives the same bytes, and drafted, concurrent and resumed replies stay token-equal. The recipe and ledger lines now cite it; the default stays BF16.
The FP8 latent cache changes all three golden replies against the BF16 cache, and a token-changing mode cannot be qualified, even as an opt-in, so the recipe, the optimization ledger and the receipt's scope now call the measurements diagnostic evidence of how far FP8 moves and say BF16 stays the only qualified cache; no number or file changes.
The "about a third smaller" figure divided a whole stream's 1.08 GiB, 231 MiB of fixed per-stream state included, by the window and set it against the BF16 page bytes alone; the recipe, the ledger and the receipt now give the cache's own 6,960 bytes a token on each rank against 13,056 (-47%), from cacheBytes and the 12 latent caches, with the fixed 231 MiB a stream stated beside it.
65f39f4 to
4940985
Compare
|
Thank you @laudney. 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. |
--kv-cache fp8A BF16-cache rerun gives the same bytes, so every difference in the first column is the cache's.
What this changes
Since 1.1.2 the GLM CUDA recipe (and the optimization ledger) have said the opt-in
--kv-cache fp8latent cache's native quality and device qualification are pending. This addsdocs/receipts/glm-kv-fp8-3a56d4eb/, diagnostic evidence of how far the FP8 cache moves onnvidia/GLM-5.3-Flash-FP4-Localat TP=2 on two GB10. FP8 changes tokens against the BF16 cache (all three golden replies differ), so it is not qualified: the recipe and ledger now say BF16 stays the only qualified cache and point to these measurements as diagnostics. The default stays BF16 and nothing in the engine changes.baed910096), three commits (7286659d47;ab075cb2a8, which turns the qualification claim into diagnostics as asked in review; and65f39f44e6, which counts the FP8 cache's bytes a token without the fixed per-stream state). It stands alone: the BF16-cache exactness and speed launches it compares against are in its own folder. It shares those launches and the launch scripts with docs: GLM-5.3-Flash FP4-Local receipt on main at TP=2 on two GB10 #3425 (the FP4-Local receipt on main), which merges cleanly with it in either order.atc overlap --json(ATC 0.9.4):complete: false(pullFilesUnavailableand limits), as on docs: GLM-5.3-Flash FP4-Local receipt on main at TP=2 on two GB10 #3425, so I merge-tested by hand every open pull request that changesdocs/optimization-ledger.mdordocs/recipes/glm-5.3-flash-cuda.md, against this head and againstmain. One conflict is new: glm cuda: support explicitly paged FP8 KV #3064 adds three lines right under the recipe's--kv-cache fp8bullet, which this rewrites. The texts do not disagree; whichever lands second keeps this bullet and then glm cuda: support explicitly paged FP8 KV #3064's three lines. Every other result equals that pull request's result againstmain.Checks on this head
65f39f44e6.python3 tools/zig/lean_check.py, on the base and on this head: 341 and 341, 0 new (tools/pr_check.py --base upstream/main).tools/pr_check.py: 0 errors, 1 advisory warning, the documentation address192.0.2.1in the receipt'stools/fl-env.sh(the recipe's own example address).git diff --check upstream/mainclean.sha256sum -c SHA256SUMSin the new receipt passes and covers every file there.tools/mktexts.pyrebuilds the corpus texts byte for byte (sha256 incorpus/sha256.txt);kv8_compare.py's control (a run against itself: 0 differences) and a planted single flip (counted once, with its margins) checked before the runs. Documentation only, so no host suite.7286659d47; pending on this head.zig/ortools/changes.Receipt
n/a for the change itself: documentation only, so it cannot reach inference. The receipt it adds is its content; its README has every table and the method.
3a56d4eb92, one binary for every launch (Zig 0.17.0, nvcc 13.5 for sm_121, NCCL 2.30.7, driver 580.178.04); two GB10 (128 GB) at TP=2 over a direct RoCE link.nvidia/GLM-5.3-Flash-FP4-Localat76348ddb2be2e35e39ecfc00e75dc07703f4f3d5; for scalenvidia/GLM-5.3-Flash-NVFP4at423acf37583782c51c142d145aef733d72943d93.cc8f2889e7(docs/**/*.mdoutside receipts, andzig/src/**/*.zig), through/v1/completionswithprompt_logprobs: 20(the 1.1.5-era receipt'ss5_prompt_lp.py). A prompt pass writes its chunk's latent rows before any row attends, so every key it reads comes through the FP8 cache, as in decode. All 16,250 top-1 differences are listed with both margins; the reference's margin is at most 0.125 at half of them and 1.0 at 95%. The one band that rises (+0.84%, positions 32,768 to 65,535) is one prose sequence's changelog-style link lists, and NVFP4 rises there too (+0.68%); the near-sure tokens there go both ways (21 lost, 18 gained). Code and every position below 8,192 have no near-sure token lost.bench_concurrent.py --levels 1,2,4 --temperatures 0,1 --reps 3 --alone --serial: 84 and 30 equal, 0 unequal; four resumed replies equal to the cold one. The golden replies differ from the BF16 cache's after 7, 171 and 38 characters."draft": false23.5 and 23.6 tok/s against 23.9 and 23.9; cold prompts 5.99, 23.59 and 47.27 s at 8,192, 32,768 and 65,536 tokens against 5.69, 22.88 and 45.84.Checklist