Repository navigation
GLM CUDA: skip native MTP prompt history with DFlash2 - #4695
Draft
MaverickKB wants to merge 1 commit into
Draft
MaverickKB wants to merge 1 commit into
MaverickKB wants to merge 1 commit into
Conversation
3 of 4 tasks
4 of 6 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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