Repository navigation
Conversation
Ensure the ATOM plugin sizes and builds sparse MLA metadata with the configured KV cache dtype so AITER can select the correct folded fp8 decode metadata path.
Contributor
|
Closing in favor of a PR opened from the XiaobingSuper account with the same commit and branch. |
zejunchen-zejun
added a commit
that referenced
this pull request
Dec 2, 2026
…883); ATOM_REQUEST_LOG At c192 a request waits ~0.5 s on D before its first decode. D's own metrics put ~96% of it in pd_kv_transfer_seconds: the MoRIIO write-mode hand-off after P has finished. This change logs where that hand-off goes. - ATOM_SPEC_REQUEST_LOG becomes ATOM_REQUEST_LOG, one JSON line per finished request. Besides the speculative counters it records ttft_ms and e2e_ms; on a P/D consumer it also records park_ms (began waiting for the remote KV) and kv_ms (the scheduler found it arrived). It is written once per request and only when the env names a path prefix. - Under ATOM_MORIIO_TRANSFER_STATS: - On the producer, each push's stats line gains queue_ms (from the write request arriving to the write service taking it) and its PP stage. - On the consumer, each receive logs gate_ms (until the forwards queued before it finish and the write is asked for), report_ms (until the last producer stage reports) and pickup_ms (until an engine step takes it). Co-Authored-By: Claude Opus 5.5 <[email protected]>
zejunchen-zejun
added a commit
that referenced
this pull request
Dec 2, 2026
….py (#883) Two stdlib-only readers for the new diagnostics: - request_log_report.py: DSpark acceptance and tokens per forward by context-length bin, from ATOM_REQUEST_LOG. - pd_timeline_report.py: where a P/D request's wait for its KV goes, from the MoRIIO transfer stats and write timeline lines (ATOM_MORIIO_TRANSFER_STATS=1) and the request log. Co-Authored-By: Claude Opus 5.5 <[email protected]>
zejunchen-zejun
added a commit
that referenced
this pull request
Dec 2, 2026
…K DSpark draft window (#878) 12-02, E17 05-08, c192, 1x613 (R11c) against 12-01's R9c: interactivity 64.7 -> 68.2, 438 -> 480 tok/s/GPU, TTFT p50 1.14 -> 0.86 s. D's KV wait 0.43 -> 0.16 s: P staged each finished prefill's KDA state into its transfer slot at the next step of every PP stage. The draft's acceptance at 128-144K 0.185 -> 0.410. c512 / c1024 keep 128 transfer slots and no window. Co-Authored-By: Claude Opus 5.5 <[email protected]>
zejunchen-zejun
added a commit
that referenced
this pull request
Dec 2, 2026
…K DSpark draft window (#878) 12-02, E17 05-08, c192, 1x613 (R11c) against 12-01's R9c: interactivity 64.7 -> 68.2, 438 -> 480 tok/s/GPU, TTFT p50 1.14 -> 0.86 s. D's KV wait 0.43 -> 0.16 s: P staged each finished prefill's KDA state into its transfer slot at the next step of every PP stage. The draft's acceptance at 128-144K 0.185 -> 0.410. c512 / c1024 keep 128 transfer slots and no window. Co-Authored-By: Claude Opus 5.5 <[email protected]>
zejunchen-zejun
added a commit
that referenced
this pull request
Dec 2, 2026
…ark draft window, per-request log, MoRIIO hop timing, tools (#4106) * scheduler: ATOM_SPEC_REQUEST_LOG, one line per finished request with its speculative acceptance Diagnostics for LLM-Booster #878 (DSpark acceptance falls in long-context turns). Each `Sequence` counts the speculative steps it verified and the drafts offered and accepted across them, at the same point and under the same condition as `EngineStats.update_spec`. When the env names a path prefix, `_mark_finished` appends one JSON line per request to `<prefix>.dp<rank>.<pid>.jsonl`: prompt / cached / output tokens, k, steps, drafted, accepted and the finish reason. That relates acceptance to context length offline. Off by default; written once per request, never per token; a failed write warns and turns it off for that engine. Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — lossless sampling on D at every point (to validate at c512 / c1024), megakernel and spec-log knobs - D_LOSSLESS now defaults to 1 at every point. c192 was measured (R9c); c512 and c1024 are validated on this branch (LLM-Booster #874). - D_MEGAKERNEL=1 sets AITER_MEGAKERNEL=1 on D: aiter's decode megakernel (ROCm/aiter#7345, LLM-Booster #865). It is off by default, to be A/B'd at c192, also with the shared expert off its side stream (ATOM_DUAL_STREAM_MOE_TOKEN_THRESHOLD=0), since the megakernel needs no kernel running beside it. - D_SPEC_LOG sets ATOM_SPEC_REQUEST_LOG on D: per-request acceptance against context length (LLM-Booster #878). Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — keep lossless sampling's default at c192 only; c512 / c1024 are #874's LLM-Booster #874 (lossless sampling at c512 / c1024) and the c1024 point now belong to gbyu. This branch therefore no longer changes their default: D_LOSSLESS is on at c192 only, as on k3-455-dev. The knob stays. Co-Authored-By: Claude Opus 5.5 <[email protected]> * diagnostics: a P/D request's wait for its KV, hop by hop (LLM-Booster #883); ATOM_REQUEST_LOG At c192 a request waits ~0.5 s on D before its first decode. D's own metrics put ~96% of it in pd_kv_transfer_seconds: the MoRIIO write-mode hand-off after P has finished. This change logs where that hand-off goes. - ATOM_SPEC_REQUEST_LOG becomes ATOM_REQUEST_LOG, one JSON line per finished request. Besides the speculative counters it records ttft_ms and e2e_ms; on a P/D consumer it also records park_ms (began waiting for the remote KV) and kv_ms (the scheduler found it arrived). It is written once per request and only when the env names a path prefix. - Under ATOM_MORIIO_TRANSFER_STATS: - On the producer, each push's stats line gains queue_ms (from the write request arriving to the write service taking it) and its PP stage. - On the consumer, each receive logs gate_ms (until the forwards queued before it finish and the write is asked for), report_ms (until the last producer stage reports) and pickup_ms (until an engine step takes it). Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — request_log_report.py (#878) and pd_timeline_report.py (#883) Two stdlib-only readers for the new diagnostics: - request_log_report.py: DSpark acceptance and tokens per forward by context-length bin, from ATOM_REQUEST_LOG. - pd_timeline_report.py: where a P/D request's wait for its KV goes, from the MoRIIO transfer stats and write timeline lines (ATOM_MORIIO_TRANSFER_STATS=1) and the request log. Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — replay_turns.py, to tell length from content in DSpark's acceptance drop (#878) DSpark acceptance falls as c192's agentic trajectories deepen (0.34 to 0.27). The draft's own card reports only a small drop on ~95k-token documents (AA-LCR 3.23 against a 3.73 mean, at temperature 1.0), and it trained on single-turn and chat prompts. So the deep turns' content (tool output, ~150 turns deep) may matter more than their length. The tool replays three categories of recorded turns through the router: - early turns; - deep turns; - the deep turns cut to a short history: the system prompt, the first user message, then the newest whole exchanges, never starting with a tool result. It then joins D's ATOM_REQUEST_LOG to report the acceptance per category. It is stdlib-only. On R5b's events the selection takes 8 s and gives: - early: median 56 KB, turn index 21; - deep: median 435 KB, turn index 156; - deep_cut: median 117 KB, turn index 157. Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — replay_turns.py records what each turn generated (prose or a tool call) and splits acceptance by it Co-Authored-By: Claude Opus 5.5 <[email protected]> * DSpark: ATOM_DSPARK_DRAFT_WINDOW, the newest W context tokens a paged draft block attends (LLM-Booster #878) Kimi-K3's DSpark acceptance collapses past ~120K tokens of context (E17 c192, 12-02: 0.43 at 96-104K, 0.19 at 128-136K, 0.05 past 176K), while the draft's card verifies it only up to AA-LCR's 115K. With rope, q.k depends only on the distance, so attending the newest W tokens keeps every distance the draft sees in that range. Off by default. A windowed variant of the KV index generator (kv_indices_generate_window_triton) writes each row's tokens from its first one; the shared generator is unchanged. CSR MLA decode only, no DCP. Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — c192 defaults to P_TRANSFER_SLOTS=0 (#883) and a 96K DSpark draft window (#878) 12-02, E17 05-08, c192, 1x613 (R11c) against 12-01's R9c: interactivity 64.7 -> 68.2, 438 -> 480 tok/s/GPU, TTFT p50 1.14 -> 0.86 s. D's KV wait 0.43 -> 0.16 s: P staged each finished prefill's KDA state into its transfer slot at the next step of every PP stage. The draft's acceptance at 128-144K 0.185 -> 0.410. c512 / c1024 keep 128 transfer slots and no window. Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — c192 defaults to the MoRIIO write thread on P; record the 12-02 code (aiter heads-mla build) Every 12-02 c192 run (R11b / R11c / R11d) had ATOM_MORIIO_WRITE_THREAD=1 on P; with the transfer slots off it sends each push as soon as it is asked for, not at each PP stage's next step, so the recipe needs it to reproduce the measured hand-off. The note now says which aiter build the 12-02 numbers used and marks the 1x613 numbers as early-window only. Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — 12-02 c192 full-window result with both fixes (R11d: 58.5 interactivity, 530 tok/s/GPU) Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
gbyu-amd
pushed a commit
that referenced
this pull request
Dec 3, 2026
…ark draft window, per-request log, MoRIIO hop timing, tools (#4106) * scheduler: ATOM_SPEC_REQUEST_LOG, one line per finished request with its speculative acceptance Diagnostics for LLM-Booster #878 (DSpark acceptance falls in long-context turns). Each `Sequence` counts the speculative steps it verified and the drafts offered and accepted across them, at the same point and under the same condition as `EngineStats.update_spec`. When the env names a path prefix, `_mark_finished` appends one JSON line per request to `<prefix>.dp<rank>.<pid>.jsonl`: prompt / cached / output tokens, k, steps, drafted, accepted and the finish reason. That relates acceptance to context length offline. Off by default; written once per request, never per token; a failed write warns and turns it off for that engine. Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — lossless sampling on D at every point (to validate at c512 / c1024), megakernel and spec-log knobs - D_LOSSLESS now defaults to 1 at every point. c192 was measured (R9c); c512 and c1024 are validated on this branch (LLM-Booster #874). - D_MEGAKERNEL=1 sets AITER_MEGAKERNEL=1 on D: aiter's decode megakernel (ROCm/aiter#7345, LLM-Booster #865). It is off by default, to be A/B'd at c192, also with the shared expert off its side stream (ATOM_DUAL_STREAM_MOE_TOKEN_THRESHOLD=0), since the megakernel needs no kernel running beside it. - D_SPEC_LOG sets ATOM_SPEC_REQUEST_LOG on D: per-request acceptance against context length (LLM-Booster #878). Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — keep lossless sampling's default at c192 only; c512 / c1024 are #874's LLM-Booster #874 (lossless sampling at c512 / c1024) and the c1024 point now belong to gbyu. This branch therefore no longer changes their default: D_LOSSLESS is on at c192 only, as on k3-455-dev. The knob stays. Co-Authored-By: Claude Opus 5.5 <[email protected]> * diagnostics: a P/D request's wait for its KV, hop by hop (LLM-Booster #883); ATOM_REQUEST_LOG At c192 a request waits ~0.5 s on D before its first decode. D's own metrics put ~96% of it in pd_kv_transfer_seconds: the MoRIIO write-mode hand-off after P has finished. This change logs where that hand-off goes. - ATOM_SPEC_REQUEST_LOG becomes ATOM_REQUEST_LOG, one JSON line per finished request. Besides the speculative counters it records ttft_ms and e2e_ms; on a P/D consumer it also records park_ms (began waiting for the remote KV) and kv_ms (the scheduler found it arrived). It is written once per request and only when the env names a path prefix. - Under ATOM_MORIIO_TRANSFER_STATS: - On the producer, each push's stats line gains queue_ms (from the write request arriving to the write service taking it) and its PP stage. - On the consumer, each receive logs gate_ms (until the forwards queued before it finish and the write is asked for), report_ms (until the last producer stage reports) and pickup_ms (until an engine step takes it). Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — request_log_report.py (#878) and pd_timeline_report.py (#883) Two stdlib-only readers for the new diagnostics: - request_log_report.py: DSpark acceptance and tokens per forward by context-length bin, from ATOM_REQUEST_LOG. - pd_timeline_report.py: where a P/D request's wait for its KV goes, from the MoRIIO transfer stats and write timeline lines (ATOM_MORIIO_TRANSFER_STATS=1) and the request log. Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — replay_turns.py, to tell length from content in DSpark's acceptance drop (#878) DSpark acceptance falls as c192's agentic trajectories deepen (0.34 to 0.27). The draft's own card reports only a small drop on ~95k-token documents (AA-LCR 3.23 against a 3.73 mean, at temperature 1.0), and it trained on single-turn and chat prompts. So the deep turns' content (tool output, ~150 turns deep) may matter more than their length. The tool replays three categories of recorded turns through the router: - early turns; - deep turns; - the deep turns cut to a short history: the system prompt, the first user message, then the newest whole exchanges, never starting with a tool result. It then joins D's ATOM_REQUEST_LOG to report the acceptance per category. It is stdlib-only. On R5b's events the selection takes 8 s and gives: - early: median 56 KB, turn index 21; - deep: median 435 KB, turn index 156; - deep_cut: median 117 KB, turn index 157. Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — replay_turns.py records what each turn generated (prose or a tool call) and splits acceptance by it Co-Authored-By: Claude Opus 5.5 <[email protected]> * DSpark: ATOM_DSPARK_DRAFT_WINDOW, the newest W context tokens a paged draft block attends (LLM-Booster #878) Kimi-K3's DSpark acceptance collapses past ~120K tokens of context (E17 c192, 12-02: 0.43 at 96-104K, 0.19 at 128-136K, 0.05 past 176K), while the draft's card verifies it only up to AA-LCR's 115K. With rope, q.k depends only on the distance, so attending the newest W tokens keeps every distance the draft sees in that range. Off by default. A windowed variant of the KV index generator (kv_indices_generate_window_triton) writes each row's tokens from its first one; the shared generator is unchanged. CSR MLA decode only, no DCP. Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — c192 defaults to P_TRANSFER_SLOTS=0 (#883) and a 96K DSpark draft window (#878) 12-02, E17 05-08, c192, 1x613 (R11c) against 12-01's R9c: interactivity 64.7 -> 68.2, 438 -> 480 tok/s/GPU, TTFT p50 1.14 -> 0.86 s. D's KV wait 0.43 -> 0.16 s: P staged each finished prefill's KDA state into its transfer slot at the next step of every PP stage. The draft's acceptance at 128-144K 0.185 -> 0.410. c512 / c1024 keep 128 transfer slots and no window. Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — c192 defaults to the MoRIIO write thread on P; record the 12-02 code (aiter heads-mla build) Every 12-02 c192 run (R11b / R11c / R11d) had ATOM_MORIIO_WRITE_THREAD=1 on P; with the transfer slots off it sends each push as soon as it is asked for, not at each PP stage's next step, so the recipe needs it to reproduce the measured hand-off. The note now says which aiter build the 12-02 numbers used and marks the 1x613 numbers as early-window only. Co-Authored-By: Claude Opus 5.5 <[email protected]> * recipes: 455-k3 — 12-02 c192 full-window result with both fixes (R11d: 58.5 interactivity, 530 tok/s/GPU) Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]> (cherry picked from commit 04c31e3)
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.
Summary
Problem
DeepSeek V3.2 with TP4 and
--kv-cache-dtype fp8uses 32 local query heads. AITER's fast persistent sparse MLA decode path does not natively handlefp8/fp8, nhead=32, q_len=1; it folds the work into two 16-head query groups to keep a single kernel launch.Before this change, the ATOM plugin did not consistently pass the configured dtype into AITER metadata setup. That could make metadata sizing or dispatch disagree with the actual fp8 decode path, especially for dtype-sensitive folded metadata.
Why This Fix Is Reasonable
The actual attention kernel already sees the real tensor dtypes. This change makes the metadata builder use the same dtype information, so buffer allocation and AITER metadata generation follow the same fp8 path as decode. The companion AITER change fixes the folded sparse batch mapping itself; this ATOM change ensures the plugin selects and sizes that metadata path correctly.
Accuracy Validation
GSM8K was run with
my_test/test_accuracy.shusing 20-shot local completions on DeepSeek V3.2 with--kv-cache-dtype fp8.Before the root-cause fix, TP4 fp8 sparse MLA showed severe accuracy degradation. After this ATOM change plus the companion AITER metadata fix:
TP8 is included as a guardrail. It has 16 local heads and therefore uses the native sparse MLA fast path rather than the TP4 32-head folded path.
Test Plan
git diff --check--kv-cache-dtype fp8, GSM8K 20-shot accuracy--kv-cache-dtype fp8, GSM8K 20-shot accuracyMade with Cursor