Skip to content

[None][feat] Rubin merge back: MLA, DSpark, DWDP, Helix - #21067

Open
mingyangHao wants to merge 21 commits into
NVIDIA:mainfrom
mingyangHao:port/rubin-advance-main-20261023
Open

mingyangHao wants to merge 21 commits into
NVIDIA:mainfrom
mingyangHao:port/rubin-advance-main-20261023

Conversation

@mingyangHao

@mingyangHao mingyangHao commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Dev Engineer Review

  • Standalone draft-cache support spans cache managers, speculative workers, executor state, and disaggregated transfer. Verify draft-history lifecycle, slot reuse, position limits, cache sizing, and compatibility between draft-enabled and draft-disabled peers.
  • DSpark replaces worker-owned rolling windows with manager-owned pages and adds paged attention and FP8 projection paths. Verify page-table mapping, capacity checks, scale layouts, supported geometry, and legacy fallback behavior.
  • FP4 MLA adds packed-query execution, chunked prefill, and wave-based task planning. Verify split bounds, task ordering, synchronization, and output and statistics merging.
  • Helix changes V-projection placement and communication behavior. Verify rank agreement, collective selection, shared-memory synchronization, and CUDA-graph behavior.
  • FP8 block-scale all-reduce adds fusion operations and quantization paths. Verify enum consistency, scale packing, padding, and launch constraints.
  • The cache-domain API changes C++ declarations, bindings, Python exports, and type stubs. Verify that defaults and enum values agree across those interfaces.
  • MoE event ordering and autotuner tactic distribution also change. Verify that waits precede dependent work and that ranks receive the intended tactic set.
  • No test execution results or current review-finding counts were supplied.

QA Engineer Review

  • Tests changed in the C++ cache-manager configuration test and Python tests for Helix MLA, FP4 MLA planning, cache estimation, autotuning, DFlash, DSpark, Kimi K3 DSpark semantics, and disaggregated auxiliary history. The DSpark CUDA-graph test change is comments-only.
  • Coverage includes cache-domain grouping, wave-planner behavior, managed-page writes, draft-history round trips, FP8/BF16 behavior, and Helix collectives. Test results were not supplied.
  • The test-list search found unittest/disaggregated/test_extractor.py in both l0_a10.yml and l0_h100.yml. It found no exact matching entries for the other searched changed tests. l0_dgx_b200.yml lists a different autotuner test, test_autotuner_distributed_strategy. No matching manual-QA entries were found.
  • Coverage verdict: needs follow-up. Confirm scheduling for changed tests in the appropriate CI or manual-QA lists, then run the relevant suites.

Per-File QA Perspective

Source files

  • cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/common.h — Verify CacheDomain values and the documented storage order.
  • cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/config.h — Verify that AttentionLayerConfig defaults to the target cache domain.
  • cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/lifeCycleRegistry.cpp — Verify lifecycle construction forwards the configured cache domain.
  • cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/lifeCycleRegistry.h — Verify domain-aware comparison and scratch-range behavior.
  • cpp/tensorrt_llm/batch_manager/kv_cache_manager_v2/storage/config.cpp — Verify pool grouping separates cache domains while preserving intended reuse.
  • cpp/tensorrt_llm/kernels/communicationKernels/allReduceFusionKernels.h — Verify the new fusion and quantization enum values match dispatch consumers.
  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlAllreduceKernels.cu — Verify FP8 block quantization, scale packing, padding, and launch validation.
  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlAllreduceKernels.h — Verify callers set sfLeadingDim correctly.
  • cpp/tensorrt_llm/kernels/customAllReduceKernels.h — Verify the fusion operation name and value match kernel and Python dispatch.
  • cpp/tensorrt_llm/kernels/helixAllToAll.cu — Verify the asynchronous shared-memory fence protects FIFO data before reuse.
  • cpp/tensorrt_llm/nanobind/batch_manager/kvCacheManagerV2.cpp — Verify binding defaults and properties match the C++ API.
  • cpp/tensorrt_llm/thop/allreduceOp.cpp — Verify output padding and the returned scale-view shape.
  • tensorrt_llm/_torch/attention/backends/dspark.py — Verify captured-context writes respect masks, capacities, and page-table bounds.
  • tensorrt_llm/_torch/attention/backends/fp4_mla/cache_manager.py — Verify draft-layer dtype and cache-size accounting across Helix and non-Helix configurations.
  • tensorrt_llm/_torch/attention/backends/fp4_mla/config.py — Verify the wave-plan environment setting and default.
  • tensorrt_llm/_torch/attention/backends/fp4_mla/fp4_mla_cutedsl_mufu16.py — Verify packed-task bounds, split-output merging, and pipeline synchronization.
  • tensorrt_llm/_torch/attention/backends/fp4_mla/fp4_mla_packed_reduce.py — Verify candidate limits, makespan selection, tie-breaking, and disabled-planner behavior.
  • tensorrt_llm/_torch/attention/backends/fp4_mla/packed_plan.py — Verify environment settings reach the planner launch.
  • tensorrt_llm/_torch/attention/backends/sparse/deepseek_v4/cache_manager.py — Verify draft-cache quota and fixed-reservation calculations.
  • tensorrt_llm/_torch/attention/backends/sparse/dsa/cache_manager.py — Verify local-layer pool sizing and draft-cache accounting.
  • tensorrt_llm/_torch/attention/kernels/blackwell/dspark/attention.py — Verify paged-attention arguments and supported geometry match callers.
  • tensorrt_llm/_torch/attention/kernels/blackwell/dspark/attention_kernel.py — Verify history-page masking, capacity handling, and FP8 output scales.
  • tensorrt_llm/_torch/attention/kernels/blackwell/dspark_rmsnorm_rope.py — Verify quantization scales and bounds checks on managed page writes.
  • tensorrt_llm/_torch/attention/mla.py — Verify chunked-prefill dispatch and Helix V-projection behavior against fallback paths.
  • tensorrt_llm/_torch/autotuner.py — Verify the full tactic list is used when it is shorter than the tuning group.
  • tensorrt_llm/_torch/custom_ops/dspark_attention_custom_op.py — Verify custom-op validation, kernel caching, and the removed cache/slot interface.
  • tensorrt_llm/_torch/custom_ops/dspark_rmsnorm_rope_custom_op.py — Verify device-specific compilation, page-write validation, and FP8 precompile gating.
  • tensorrt_llm/_torch/disaggregation/native/auxiliary.py — Verify draft-history serialization and recycled-slot clearing.
  • tensorrt_llm/_torch/disaggregation/native/bounce/impl.py — Verify byte accounting for cp_as_tp paged groups.
  • tensorrt_llm/_torch/disaggregation/native/mixers/attention/peer.py — Verify peer checks reject incompatible overlapping attention groups.
  • tensorrt_llm/_torch/disaggregation/native/peer.py — Verify draft-layer compatibility and rank mapping for cp_as_tp.
  • tensorrt_llm/_torch/disaggregation/native/rank_info.py — Verify the draft-layer count reflects the active cache manager.
  • tensorrt_llm/_torch/disaggregation/native/transfer.py — Verify auxiliary-slot requirements and draft-history transfer behavior.
  • tensorrt_llm/_torch/disaggregation/resource/cache_reuse.py — Verify block-ordinal conversion for shared cp_as_tp pages.
  • tensorrt_llm/_torch/disaggregation/resource/kv_extractor.py — Verify draft-page expansion and pool separation in extracted page tables.
  • tensorrt_llm/_torch/disaggregation/resource/page.py — Verify deserialization remains compatible when the new group fields are absent.
  • tensorrt_llm/_torch/disaggregation/transceiver.py — Verify draft-history validation and restoration.
  • tensorrt_llm/_torch/distributed/ops.py — Verify the new fusion operation reaches supported MNNVL dispatch.
  • tensorrt_llm/_torch/models/modeling_dflash.py — Verify FP8 page writes and block-query layout conversion.
  • tensorrt_llm/_torch/models/modeling_dspark.py — Verify managed-page and legacy paths, projection fallback, and required paged metadata.
  • tensorrt_llm/_torch/models/modeling_kimi_linear.py — Verify the Helix V-projection weight path when enabled.
  • tensorrt_llm/_torch/moe/fused_moe/cutedsl/fused_fc12.py — Verify the input-ready event is joined before fused execution.
  • tensorrt_llm/_torch/moe/fused_moe/fused_moe_cute_dsl_b12x.py — Verify event ordering before either execution path.
  • tensorrt_llm/_torch/pyexecutor/_util.py — Verify unified draft-cache selection and rejection of unsupported manager combinations.
  • tensorrt_llm/_torch/pyexecutor/engine/runners/decoder/runner.py — Verify draft-cache preparation and history snapshots occur only in applicable decode steps.
  • tensorrt_llm/_torch/pyexecutor/kv_cache/kv_cache_manager_v2.py — Verify draft allocation, sizing, history lifecycle, and target/draft pool ratios.
  • tensorrt_llm/_torch/pyexecutor/kv_cache/mamba_cache_manager/common.py — Verify draft storage is included in hybrid-cache cost estimates.
  • tensorrt_llm/_torch/pyexecutor/kv_cache/mamba_cache_manager/mamba_cache_manager_v2.py — Verify draft pools use base-manager roles and free-block counts.
  • tensorrt_llm/_torch/pyexecutor/py_executor.py — Verify pending history updates publish after sampler updates and handle absent state.
  • tensorrt_llm/_torch/pyexecutor/sampler/sampler.py — Verify the optional update field remains compatible with sample-state consumers.
  • tensorrt_llm/_torch/pyexecutor/standalone_draft_cache.py — Verify history validation and stale-cache protection during publication.
  • tensorrt_llm/_torch/speculative/dflash.py — Verify unified-cache preparation, page-table fallback, and overflow handling.
  • tensorrt_llm/_torch/speculative/dspark.py — Verify managed-page allocation, context seeding, and progress-slot handling.
  • tensorrt_llm/_torch/speculative/interface.py — Verify managed-cache hooks and padding-slot validation across worker implementations.
  • tensorrt_llm/functional.py — Verify residual-input validation permits only the intended new fusion.
  • tensorrt_llm/runtime/kv_cache_manager_v2/__init__.py — Verify the public CacheDomain export.
  • tensorrt_llm/runtime/kv_cache_manager_v2/__init__.pyi — Verify stub signatures and defaults match the bound API.

Test files

  • cpp/tests/unit_tests/batch_manager/kvCacheManagerV2ConfigTest.cpp — Covers cache-domain defaults, lifecycle comparison, and pool grouping. No test-list entry was established.
  • tests/unittest/_torch/attention/multi_gpu/test_mla_helix.py — Covers V-up projection placement and Helix all-to-all behavior in CUDA graphs. No matching test-list entry was found.
  • tests/unittest/_torch/attention/test_fp4_mla_packed.py — Covers planner wave simulation, ordering, and disabled-planning behavior. No matching test-list entry was found.
  • tests/unittest/_torch/executor/kv_cache/test_kv_cache_estimation.py — Covers standalone draft-cache sizing and dtype selection. No matching test-list entry was found.
  • tests/unittest/_torch/misc/test_autotuner.py — Covers short tactic lists across Helix CP ranks. The list search found a different autotuner test, not this test by name.
  • tests/unittest/_torch/speculative/hw_agnostic/test_dflash_worker.py — Covers managed-cache block-table decoding and FP8 context-page writes. No matching test-list entry was found.
  • tests/unittest/_torch/speculative/hw_agnostic/test_dspark_attention.py — Covers projection paths, backend selection, and page writes. No matching test-list entry was found.
  • tests/unittest/_torch/speculative/hw_agnostic/test_dspark_cuda_graph.py — The reported change removes comments only; test behavior is unchanged. No matching test-list entry was found.
  • tests/unittest/_torch/speculative/hw_agnostic/test_dspark_worker.py — Covers managed draft pages, request slots, context seeding, and generation progress. No matching test-list entry was found.
  • tests/unittest/_torch/speculative/hw_agnostic/test_kimi_k3_dspark_semantics.py — Covers paged decode parity for BF16 and FP8 histories. No matching test-list entry was found.
  • tests/unittest/disaggregated/region/test_aux.py — Covers draft-history serialization round trips. No matching test-list entry was found.
  • tests/unittest/disaggregated/test_extractor.py — Updates the fake-manager fixture. Listed in l0_a10.yml and l0_h100.yml.

Description

Test Coverage

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

The mocked target-only manager must expose an empty draft-layer list so layer-id mapping does not iterate an unconstrained Mock. Keep pool-layout and role assertions unchanged.

Signed-off-by: Mingyang Hao <mingyangh@nvidia.com>
Avoid duplicate dummy-cache allocation when target and draft share a manager.
Restore the SM107 allocator mapping present in the GitLab source and retain
the independent RMSNorm/RoPE support gate.

Mark the inherited Mamba quota override and complete partial Helix/Mamba
manager fixtures for the unified draft cache interface.

Signed-off-by: Mingyang Hao <mingyangh@nvidia.com>
Comment on lines +1856 to +1865
draft_num_layers: int = 0,
draft_num_kv_heads: int = 0,
draft_head_dim: int = 0,
draft_dtype: DataType = DataType.BF16,
draft_kv_factor: int = 2,
draft_total_num_kv_heads: int | None = None,
draft_scratch_tokens: int = 0,
draft_window_size: int | None = None,
draft_attention_backend: str | None = None,
draft_max_position_embeddings: int | None = None,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Please drop 272f7bf274 (my port of the GitLab standalone-DSpark draft-KV transfer, !10774 + !10802) from this merge-back. Main is redesigning the same feature on KVCacheLayerSpec(owner=DRAFT) in #20486 / #20664, while this commit adds the older draft_* kwargs path to KVCacheManagerV2.__init__ (kv_cache_manager_v2.py:1856) next to layer_specs, so main would carry two unified-draft-cache implementations; git merge-tree against #20486 and #20664 already conflicts in _util.py, kv_cache_manager_v2.py, dflash.py and dspark.py.
That also covers the follow-up pieces of f189f03403 / b386e7472a / f4587daabc that only adapt it (managed draft history, _uses_unified_standalone_draft_cache, the num_draft_layers peer check whose error points at a TRTLLM_DISAGG_SHARED_DRAFT_KV nothing in this PR reads).
The DSpark kernel/perf parts in the same commit (FP8 projection fusions, Rubin CuteDSL GEMMs, paged attention / RMSNorm+RoPE page write) can stay if they split cleanly; the standalone draft-KV transfer will be redone on top of #20664.

Remove the superseded standalone draft KV ownership, lifecycle and CTX-to-GEN
transfer path, including its later integration adaptations. Restore the main
worker/cache-manager contracts in preparation for the layer_specs based design.

Keep the independent FP8 projections, Rubin GEMMs, paged attention and page-write
kernels. Let the restored rolling-window path reuse the loaded projection
modules, with CPU regressions for attention and context-window writes.

Preserve the original GitLab replay commits, including 272f7bf, unchanged.

Signed-off-by: Mingyang Hao <mingyangh@nvidia.com>
Keep main's _admit_run_context call, which validates the context and already
waits on x_ready_event before dispatch. This supersedes the duplicate direct
wait from the earlier mergeback adaptation without dropping synchronization.

Preserve the source replay history and the legacy draft-KV removal.

Signed-off-by: Mingyang Hao <mingyangh@nvidia.com>
@mingyangHao

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81417 [ run ] triggered by Bot. Commit: b60aa1f Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81417 [ run ] completed with state SUCCESS. Commit: b60aa1f
/LLM/main/L0_MergeRequest_PR pipeline #67098 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

Retain MiniMax DSpark support from main together with the existing projection
and Rubin imports. The conflict is limited to the typing and attention imports.

Signed-off-by: Mingyang Hao <mingyangh@nvidia.com>
Initialize the selected linear backend in the confidence-loader fixture,
exercise the rolling-window stage entry point in V4.1 tests, and expect the
retained SM107 allocator support. Preserve the existing behavioral assertions.

Signed-off-by: Mingyang Hao <mingyangh@nvidia.com>
Keep the converted query when dispatching through the new windowed helper,
and round the future-block K/V to the cache precision before merging attention.
This preserves the retained FP8 cache path after main refactored windowed decode.

Cover BF16 and FP8 causal/noncausal calls at the CPU kernel boundary and compare
against a dense oracle over the rounded cache values.

Signed-off-by: Mingyang Hao <mingyangh@nvidia.com>
@mingyangHao

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@mingyangHao mingyangHao changed the title [None][feat] Rubin merge back: MLA, DSpark, DWDP, Helix [None][feat] Rubin merge back: MLA, DSpark, DWDP, Helix Oct 30, 2026
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81595 [ run ] triggered by Bot. Commit: 0671031 Link to invocation

Backport cc6b46096defce52488a27f06c9be25a43ad55f4. Define the join on
the fused FC12 implementation, which does not inherit the grouped-GEMM
implementation, and consume the input-ready event on empty batches too.

Cover repeated dispatch within a forward, fresh events on the next forward,
empty inputs, absent events, and output allocation/reuse with CPU tests.

Signed-off-by: Jonas Li <jonasl@nvidia.com>
Signed-off-by: Mingyang Hao <mingyangh@nvidia.com>
@mingyangHao

Copy link
Copy Markdown
Collaborator Author

/bot kill

@mingyangHao

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81642 [ kill ] triggered by Bot. Commit: 72e6cc7 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81643 [ run ] triggered by Bot. Commit: 72e6cc7 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81642 [ kill ] completed with state ABORTED. Commit: 72e6cc7

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81595 [ run ] completed with state ABORTED. Commit: 0671031

Link to invocation

@mingyangHao

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81676 [ run ] triggered by Bot. Commit: 72e6cc7 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81643 [ run ] completed with state ABORTED. Commit: 72e6cc7

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81676 [ run ] completed with state FAILURE. Commit: 72e6cc7
/LLM/main/L0_MergeRequest_PR pipeline #67341 completed with status: 'UNSTABLE'

CI Report

⚠️ Multi-GPU Label Required:
Multi-GPU tests require the ci: full pre-merge approved label on this PR. Either:

  • Wait for the PR to be fully approved — the label is added automatically once approval is complete. Having unresolved open comments is fine, or
  • If needed, ask a member of NVIDIA/trt-llm-ci-approvers to add the label manually.
    Then re-trigger CI with the same bot command (no rebase needed).

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@mingyangHao

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81701 [ run ] triggered by Bot. Commit: 72e6cc7 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81701 [ run ] completed with state FAILURE. Commit: 72e6cc7
/LLM/main/L0_MergeRequest_PR pipeline #67362 completed with status: 'UNSTABLE'

CI Report

⚠️ Multi-GPU Label Required:
Multi-GPU tests require the ci: full pre-merge approved label on this PR. Either:

  • Wait for the PR to be fully approved — the label is added automatically once approval is complete. Having unresolved open comments is fine, or
  • If needed, ask a member of NVIDIA/trt-llm-ci-approvers to add the label manually.
    Then re-trigger CI with the same bot command (no rebase needed).

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@coderabbitai coderabbitai Bot mentioned this pull request Oct 30, 2026
1 task done

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants