Repository navigation
GLM CUDA: skip native MTP prompt history with DFlash2 - #4695
MaverickKB wants to merge 1 commit into
Conversation
|
Thanks @MaverickKB. The skip reads right: the native MTP attention history is prefilled even when an external DFlash2 drafter is active and builds its context from target-layer taps, so the chunked and batched prompt paths run an unused native-head forward; with the drafter selection applied at the engine level, a worker on the native drafter still absorbs the prompt rows. The host fixture is the failing-before test we want — against main it finds two native history rows for a three-token prompt where the DFlash2 pass expects zero, and the native-drafter positive control still accumulates its rows — and it compares each DFlash2 slot's context to independent ingestion on both emulated ranks. This lands with our review. Our device check repeats the prompt path on a two-rank CUDA box with the external drafter: the target's commit, token draw, DFlash2 ingest, prompt scoring and snapshot format unchanged, and a
|
47ad199 to
0609002
Compare
What this changes
GLM CUDA prefills the checkpoint's native MTP attention history even when an external DFlash2 drafter is active. DFlash2 builds its context from target-layer taps. This skips the unused native-head forward pass in the chunked and batched prompt paths. A worker using its native MTP drafter continues to absorb the prompt rows.
95ae4081770ff36fc83d16a5be7d166bdee005fa.atc overlap --json: 2026-11-23 01:14 UTC, against that base. ATC reported capped coverage and seven file overlaps (one clean, six unknown). A paginated check of all 399 open PRs found 43 with shared paths. Three-way file comparisons on their merge bases covered 57 paths. Fifty merged cleanly on both main and this head. The other seven already conflicted on main. Six inherited conflict bodies are byte-identical. The seventh is docs: the optimization ledger's cells for PRs that landed since, and lfm2_moe's CUDA column #4580's existing ledger-table conflict; its diff uses this DFlash2 row as unchanged context. Keep the updated GLM cell when resolving that older table conflict. No comparison introduced a new conflict hunk. glm cuda: warm turns under TF_GLM_REQUEST_STARTS=1, every message start a cut, DFlash2's ring kept alike on every rank (#3109) #3147 changes DFlash2 state retention at message boundaries and merges cleanly with this patch.Checks on this head
47ad19970d6d8ce86c6d0cd52723a014d7947194.tools/zig/lean_check.pyandtools/zig/lean_new.py).zig build test-glm-prompts-host --summary all, 8 passed, 0 failed, 0 skipped. Running the same assertions against main gave 7 passed and 1 failed. The DFlash2 pass expected zero native history rows for a three-token prompt and found two. The native-drafter positive control still accumulates 1,024 native history rows for a 1,025-token prompt. The fixture also compares each DFlash2 slot's context to independent ingestion on both emulated ranks.zig fmt --check zig/glm_prompt_host.zig zig/src/families/glm/cuda_engine.zig zig/src/families/glm/cuda_prompts.zigandgit diff --checkpassed.Receipt
draft: falseon a DFlash2 worker still uses target decoding.token_shaagainst"draft": false, fresh versus resumed prompts, and concurrent versus solo remain pending.Checklist