Repository navigation
[Refactor] sparse-mla: Expose arithmetic and DSA metadata hooks - #44503
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a6b5e95e5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
/rerun-test test/registered/unit/models/test_mla_extension_hooks.py test/registered/unit/layers/attention/test_dsa_kernel_metadata_hook.py test/registered/unit/models/test_deepseek_mla_dispatch.py test/registered/unit/layers/attention/test_dsa_backend_dp_padding.py |
|
/rerun-failed-ci |
|
🚀 |
This comment has been minimized.
This comment has been minimized.
|
/rerun-failed-ci |
main replaced the tc_piecewise context with is_in_prefill_graph_scope / is_in_full_prefill_graph and dropped the piecewise BMM branch. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This comment has been minimized.
This comment has been minimized.
One class flag gates both deferred BMM fusion and born-FP8 query packing. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
⏳ |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d46f70b47
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
PR Pundit review(Testing PR Pundit Code Review agent. Not all comments may be relevant. This is a one-time automated pass: please address what is useful, no need to request a re-review. A quick reply per point (useful or not, and why) helps us calibrate the agent. Reach out to @peymanr for suggestions and feedback.)
1. 🔴 Blocking: DSA MTP seed-handoff MHA subtest fails with TypeError: this PR removed layer_id but left kit caller passing it
How it is reached: pr-test.yml base-b-test-1-gpu-large (runs_on 1-gpu-h100, SM90) -> test/registered/attention/unittests/dsa/test_dsa.py::test_mtp_seed_handoff_cases (seed_path='mha') -> run_dsa_mtp_seed_handoff_case -> dsa_attention.py:1516 forward_dsa_indexer_for_mha(..., layer_id=0) -> TypeError against the new signature at forward_mha.py:96 Who is affected: Every PR CI run on the 1-gpu-large (H100, SM90) runner fails the registered DSA MTP seed-handoff test; production model forward is unaffected because the PR updated both runtime callers. Checked against the code by an independent pass. 2. 🟠 Should fix: New hook/glue unit tests use mock stand-ins, breaking on refactors and only indirectly covering the default capture route
The new tests in Who is affected: Maintainers refactoring DSA metadata internals; no runtime user impact. Checked against the code by an independent pass. 3. 🟠 Should fix: Multistep draft-decode replay adds ~3 µs host overhead by building inner_fb and looping hooks unconditionally
Who is affected: DSA models (DeepSeek-V3.2/GLM-5) running multi-step speculative draft decode with CUDA graphs. Checked against the code by an independent pass. Related past reviews: #8616 on Shared from a pilot of PR Pundit, an agentic code reviewer that builds and tests the change and reads the project's past reviews. Reviewed at |
|
Fixed the stale MHA seed-handoff kit caller in a764c80 by removing the obsolete layer_id keyword. The hook, metadata-glue, and seed-export CPU suites pass 112 tests and 10 subtests. The registered seed-handoff cases skip on local GB300 because they require SM90; H100 CI must validate them. Updated the description. The current B300 failure is test_cp_decode_attn_tp_server.py, VERIFY versus teacher-forced CP prefill logprob tolerance. I am checking it against upstream evidence before attributing it to these hooks. The two advisory test-structure/host-overhead suggestions remain open; this commit only fixes the confirmed caller mismatch. -Robot |
|
Addressed the default-replay overhead follow-up in 3d4611c: the multi-step backend now builds the DECODE view only during capture or when a child overrides the kernel-metadata hook, and skips default no-op dispatch during replay. A regression fails before the change and passes after it; the focused CPU suites pass 113 tests plus 10 subtests. Also ran the existing real DSA backend GPU tests on GB300: dense MHA fallback, sparse top-k attention, EAGLE draft CUDA-graph runner, and supported sparse decode graph variants pass (4 tests plus 18 subtests; 4 unsupported variants skipped). These use actual backend/kernel execution and reference comparisons, supplementing the mocked hook tests. Local environment: PyTorch 2.11/CUDA 13.2, FlashInfer 0.7.2, CuTeDSL 4.8, sgl-kernel 0.4.6.post1 with version-check override; this does not substitute for the pinned CI environment or the SM90-only seed-handoff test. The separate eight-GPU CP VERIFY/prefill accuracy failure is still unclassified; I have not relaxed its tolerance. |
PR Pundit review(Testing PR Pundit Code Review agent. Not all comments may be relevant. This is a one-time automated pass: please address what is useful, no need to request a re-review. A quick reply per point (useful or not, and why) helps us calibrate the agent. Reach out to @peymanr for suggestions and feedback.)
1. 🟠 Should fix: MLA hook overrides silently skipped on ROCm absorbed path: this PR wired hooks only into CUDA/MHA paths
The new MLA extension hooks are only wired into the CUDA absorbed path and the MHA paths. Who is affected: Only a future or out-of-tree DeepseekV2AttentionMLA subclass that overrides the new hooks and runs on ROCm/HIP with the absorbed MLA path. Checked against the code by an independent pass. Shared from a pilot of PR Pundit, an agentic code reviewer that builds and tests the change and reads the project's past reviews. Reviewed at |
|
/rerun-test registered/unit/layers/attention/test_dsa_kernel_metadata_hook.py registered/attention/unittests/dsa/test_dsa.py::TestDSAAttentionBackendCorrectness.test_mtp_seed_handoff_cases |
|
🚀 🚀 ⛔ |
|
@Fridge003 Investigated the failure and merged current main in 4f101d3. The CP test's 0.89451 maximum logprob gap matches the separate upstream diagnostic in #47980 (comment). Main already disables that test via #47894; #47970 proposes measured replacement bounds. The branch now includes that upstream disablement. All 41 focused CPU tests and 10 subtests passed after the merge, and fresh CI has started. Updated the PR description with the findings. |
|
/rerun-failed-ci |
Add four extension points for custom MLA arithmetic and DSA metadata while retaining the SRT forward lifecycle:
run_mla_indexer,prepare_mla_qkv,project_mla_values, andinit_kernel_metadata.Defaults preserve existing operations and fast paths. Query-transforming overrides set
needs_unfused_mla_qkv = Trueto receive materialized queries. Custom indexers run during CP prefill; custom metadata refreshes on replay and opts out of glue capture. LoRA correction, output gating/projection, shared-index reuse, and seed handoff remain in the existing lifecycle.Scope: ROCm dense MHA preparation dispatches the indexer hook. The separate
MLA_ROCMabsorbed path bypasses the arithmetic hooks and requires its own overrides.Validation
af98fcd545(merge commit8baffc66f3), across metadata replay/glue and shared-index coverage. Removed the mocked arithmetic-hook matrix; retained compact regressions for live custom metadata and allocation-free default replay.6cef97f7c3(one test executed, not skipped).CI States
Latest PR Test (Base): ✅ Run #41575243362
Latest PR Test (Extra): ⏳ Run #41575243331
Latest PR Test (AMD ROCm 10): ❌ Run #41575243299
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: