Skip to content

[TRTLLM-10407][perf] Add cute dsl single pass multi cta cluster topk - #12354

Merged
yuxianq merged 12 commits into
NVIDIA:mainfrom
limin2021:add_cute_dsl_single_pass_multi_cta_cluster_topk
Mar 23, 2026
Merged

[TRTLLM-10407][perf] Add cute dsl single pass multi cta cluster topk#12354
yuxianq merged 12 commits into
NVIDIA:mainfrom
limin2021:add_cute_dsl_single_pass_multi_cta_cluster_topk

Conversation

@limin2021

@limin2021 limin2021 commented Mar 19, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added cluster-accelerated single-pass multi-CTA top-k decoding with a new single_pass_multi_cta_cluster parameter to optimize performance on supported hardware.
  • Tests

    • Extended test coverage for cluster-accelerated top-k decoding across multiple batch sizes, token counts, and data types.

Description

Note: the original MR is closed becuase one of the commit lack sign-off info. The current MR has the same content with it.

Add a cluster-accelerated single-pass multi-CTA radix top-k kernel for Blackwell (SM100+).

Replaces global memory atomics + arrival counter polling with:

  • Cluster barriers (cluster_arrive_relaxed + cluster_wait) for inter-CTA synchronization
  • DSMEM (distributed shared memory) for histogram merging across CTAs in the same cluster

This eliminates the triple-buffered global histogram, the arrival counter, and all GPU-scope acquire/release PTX for barriers. Only the output counter (1 int32 in GMEM) is retained for atomicAdd during output collection.

Key changes

  • New kernel: single_pass_multi_cta_radix_topk_cluster.py
  • New runner: CuteDSLTopKDecodeSinglePassMultiCTAClusterRunner with SM-aware heuristics and hardware max cluster size clamping
  • Test coverage for the cluster kernel path
  • Minor fix to DeepEP post-quantization dispatch logic

Perf

Comparison of different multi-CTA kernels on fixed-length input (dtype=float32, top_k=2048, B200).

Kernels compared:

  • dist: distributed (global memory atomics)
  • cluster: cluster-accelerated (DSMEM + cluster barriers) — this PR
  • mc_dyn / mc_sta: multi-CTA dynamic/static scheduling
  • fi: FlashInfer reference

cl/dist < 1.0 means cluster is faster than distributed.

batch=1
num_tokens dist(us) cluster(us) mc_dyn(us) mc_sta(us) fi(us) cl/dist mcd/dist mcs/dist fi/dist
8192 7.96 8.10 12.67 12.24 11.99 1.02x 1.59x 1.54x 1.51x
16384 12.36 12.49 15.93 15.47 16.55 1.01x 1.29x 1.25x 1.34x
32768 19.26 12.58 21.07 20.71 25.23 0.65x 1.09x 1.07x 1.31x
65536 19.29 13.06 22.89 22.45 32.88 0.68x 1.19x 1.16x 1.70x
131072 19.08 14.44 27.14 26.59 37.01 0.76x 1.42x 1.39x 1.94x
262144 19.01 17.74 36.17 35.73 39.92 0.93x 1.90x 1.88x 2.10x
batch=4
num_tokens dist(us) cluster(us) mc_dyn(us) mc_sta(us) fi(us) cl/dist mcd/dist mcs/dist fi/dist
8192 8.06 8.14 12.78 12.32 12.02 1.01x 1.59x 1.53x 1.49x
16384 12.48 12.55 16.13 15.75 16.60 1.01x 1.29x 1.26x 1.33x
32768 20.00 12.60 21.81 21.48 25.33 0.63x 1.09x 1.07x 1.27x
65536 19.97 13.07 23.51 23.00 32.99 0.65x 1.18x 1.15x 1.65x
131072 19.46 15.01 28.09 27.52 37.01 0.77x 1.44x 1.41x 1.90x
262144 19.82 18.33 37.15 36.55 40.18 0.92x 1.87x 1.84x 2.03x
batch=8
num_tokens dist(us) cluster(us) mc_dyn(us) mc_sta(us) fi(us) cl/dist mcd/dist mcs/dist fi/dist
8192 8.07 8.18 12.85 12.45 12.06 1.01x 1.59x 1.54x 1.49x
16384 12.49 12.57 16.84 16.40 16.64 1.01x 1.35x 1.31x 1.33x
32768 20.36 12.63 21.77 21.46 25.34 0.62x 1.07x 1.05x 1.25x
65536 20.39 13.06 23.63 23.08 33.44 0.64x 1.16x 1.13x 1.64x
131072 20.18 17.29 28.38 27.80 37.08 0.86x 1.41x 1.38x 1.84x
262144 23.36 22.13 37.37 36.72 40.51 0.95x 1.60x 1.57x 1.73x
batch=16
num_tokens dist(us) cluster(us) mc_dyn(us) mc_sta(us) fi(us) cl/dist mcd/dist mcs/dist fi/dist
8192 8.09 8.16 12.89 12.47 12.07 1.01x 1.59x 1.54x 1.49x
16384 12.50 12.57 16.83 16.44 16.65 1.01x 1.35x 1.32x 1.33x
32768 20.55 12.69 22.43 21.97 25.38 0.62x 1.09x 1.07x 1.23x
65536 20.51 17.27 23.85 23.34 33.62 0.84x 1.16x 1.14x 1.64x
131072 23.81 21.78 28.47 27.97 37.46 0.91x 1.20x 1.18x 1.57x
262144 30.02 43.38 49.12 48.43 40.98 1.45x 1.64x 1.61x 1.37x
batch=32
num_tokens dist(us) cluster(us) mc_dyn(us) mc_sta(us) fi(us) cl/dist mcd/dist mcs/dist fi/dist
8192 8.12 8.19 12.94 12.53 12.10 1.01x 1.59x 1.54x 1.49x
16384 12.55 12.60 16.92 16.49 16.71 1.00x 1.35x 1.31x 1.33x
32768 20.78 12.92 22.81 22.44 25.45 0.62x 1.10x 1.08x 1.22x
65536 24.33 16.69 24.83 24.30 33.65 0.69x 1.02x 1.00x 1.38x
131072 30.61 23.38 40.18 39.48 37.49 0.76x 1.31x 1.29x 1.23x
262144 57.78 64.47 72.70 71.70 77.82 1.12x 1.26x 1.24x 1.35x
batch=64
num_tokens dist(us) cluster(us) mc_dyn(us) mc_sta(us) fi(us) cl/dist mcd/dist mcs/dist fi/dist
8192 8.16 8.24 13.07 12.65 12.18 1.01x 1.60x 1.55x 1.49x
16384 12.59 12.68 17.16 16.80 16.78 1.01x 1.36x 1.33x 1.33x
32768 20.08 20.21 23.08 22.57 25.55 1.01x 1.15x 1.12x 1.27x
65536 31.63 24.23 33.11 32.58 34.22 0.77x 1.05x 1.03x 1.08x
131072 58.55 44.90 63.65 62.64 72.43 0.77x 1.09x 1.07x 1.24x
262144 112.85 127.51 110.14 108.41 116.47 1.13x 0.98x 0.96x 1.03x
batch=128
num_tokens dist(us) cluster(us) mc_dyn(us) mc_sta(us) fi(us) cl/dist mcd/dist mcs/dist fi/dist
8192 8.25 8.38 13.91 13.49 12.29 1.02x 1.69x 1.63x 1.49x
16384 12.73 12.88 17.38 16.95 16.97 1.01x 1.37x 1.33x 1.33x
32768 20.22 20.52 31.44 30.97 25.78 1.01x 1.55x 1.53x 1.27x
65536 60.68 46.40 51.48 50.86 65.29 0.76x 0.85x 0.84x 1.08x
131072 103.06 107.67 100.83 99.05 108.45 1.04x 0.98x 0.96x 1.05x
262144 195.09 252.28 202.74 199.97 208.27 1.29x 1.04x 1.03x 1.07x
batch=256
num_tokens dist(us) cluster(us) mc_dyn(us) mc_sta(us) fi(us) cl/dist mcd/dist mcs/dist fi/dist
8192 14.96 15.21 18.30 17.83 22.71 1.02x 1.22x 1.19x 1.52x
16384 23.81 24.32 25.86 25.42 31.90 1.02x 1.09x 1.07x 1.34x
32768 38.65 39.58 50.89 50.44 49.36 1.02x 1.32x 1.31x 1.28x
65536 118.77 90.64 79.43 78.90 127.80 0.76x 0.67x 0.66x 1.08x
131072 208.70 274.94 148.59 148.32 225.11 1.32x 0.71x 0.71x 1.08x
262144 349.11 531.65 286.31 285.79 373.13 1.52x 0.82x 0.82x 1.07x

Key observations

  • Small batch (1-32) + large vocab (32K-256K): cluster achieves 0.62x-0.76x vs distributed — up to 38% faster due to DSMEM communication advantage
  • Large batch (128-256) + large vocab: cluster is slower (1.29x-1.52x) due to co-scheduling constraints — cluster CTAs must reside on the same GPC, limiting SM utilization under high occupancy
  • Cluster is the fastest kernel for the typical decode scenario (small batch + large vocab)

Test Coverage

  • pytest tests/unittest/_torch/thop/parallel/test_indexer_topk.py -k "test_cute_dsl_topk_decode_single_pass_multi_cta_cluster" — 180 tests passed (3 dtypes x 3 vocab sizes x 4 batch/next_n combos x 5 ctas_per_group configs)

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)

  • 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.

- Integrate CuTE DSL top-k kernel for Blackwell with single-pass multi-CTA
  and cluster-accelerated variants
- Add single_pass_multi_cta_radix_topk_cluster implementation
- Update custom ops, model config, and DSA indexer integration
- Fix deep_ep communication module
- Add and update unit tests

Squashed from 41 commits on the original branch.

Signed-off-by: Mindy Li <11663212+limin2021@users.noreply.github.com>
@limin2021
limin2021 requested review from a team as code owners March 19, 2026 13:15
@limin2021 limin2021 changed the title [None][feat] Add CuTE DSL single-pass multi-CTA cluster top-k kernel [TRTLLM-10407][perf] Add cute dsl single pass multi cta cluster topk Mar 19, 2026
@limin2021
limin2021 requested review from joyang-nv and yuxianq March 19, 2026 13:17
Signed-off-by: Mindy Li <11663212+limin2021@users.noreply.github.com>
Trim batch_size, next_n, and num_tokens to reduce each test from 180
to 18 parametrized cases, cutting CI JIT compilation time significantly.

Signed-off-by: Mindy Li <11663212+limin2021@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Mar 19, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Added a cluster-accelerated single-pass multi-CTA top-k kernel with DSMEM-based histogram merging and cluster synchronization. Refactored existing runner to use class attributes, extended public APIs with single_pass_multi_cta_cluster flag, updated MoE dispatch logic, removed hf_revision remapping, and added comprehensive test coverage.

Changes

Cohort / File(s) Summary
Cluster Top-k Kernel Implementation
tensorrt_llm/_torch/cute_dsl_kernels/blackwell/top_k/single_pass_multi_cta_radix_topk_cluster.py
New kernel module implementing cluster-accelerated top-k with per-CTA histograms, DSMEM merging via cluster barriers, two-pass output collection, and optimized CUDA launch with cluster mode. Includes _query_max_cluster_size() helper to query hardware max cluster size.
Top-k Kernel Refactoring
tensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.py, tensorrt_llm/_torch/cute_dsl_kernels/blackwell/top_k/single_pass_multi_cta_radix_topk.py
Refactored CuteDSLTopKDecodeSinglePassMultiCTARunner to use _kernel_class and _state_size class attributes. Added new CuteDSLTopKDecodeSinglePassMultiCTAClusterRunner subclass with cluster-specific _get_chunk_config and fallback handling. Extended cute_dsl_indexer_topk_decode and warmup_cute_dsl_indexer_topk APIs with single_pass_multi_cta_cluster flag. Updated prefix_sum_and_find_threshold parameter from local_histogram to histogram_input.
MoE Dispatch Logic
tensorrt_llm/_torch/modules/fused_moe/communication/deep_ep.py
Updated DeepEP.dispatch to fallback to pre-quant path when hidden_states_sf is None, and removed conditional guard around hidden_states_sf dtype adapter in post-quant branch, ensuring adapter presence check aligns with fallback condition.
Configuration Updates
tensorrt_llm/llmapi/llm_args.py
Removed automatic remapping of hf_revision to revision in update_llm_args_with_extra_dict, allowing hf_revision to be handled independently.
Test Coverage
tests/unittest/_torch/thop/parallel/test_indexer_topk.py
Added new parameterized test test_cute_dsl_topk_decode_single_pass_multi_cta_cluster with batch sizes 1–256, multiple next_n and num_tokens values, dtype variants, and fallback handling for unsupported problem sizes.

Sequence Diagram

sequenceDiagram
    participant Host as Host Launcher
    participant Kernel as GPU Kernel
    participant SMEM as Per-CTA SMEM
    participant DSMEM as Cluster DSMEM
    participant Sync as Cluster Sync

    Host->>Kernel: Launch with cluster=(ctas_per_group,1,1)
    loop Per Row
        Kernel->>SMEM: build_local_histogram (per-CTA)
        Kernel->>Sync: cluster_arrive_relaxed()
        Sync->>Kernel: cluster_wait()
        Kernel->>DSMEM: Read peer CTAs' histograms via mapa.shared::cluster
        Kernel->>DSMEM: merge_histogram_dsmem → prefix_buf
        loop Per Radix Round (2-4)
            Kernel->>Kernel: prefix_sum_and_find_threshold()
            Kernel->>Kernel: Partitioning with updated pivot
            Kernel->>Sync: cluster_arrive_relaxed()
            Sync->>Kernel: cluster_wait()
        end
        Kernel->>SMEM: collect_output_cluster (two passes)
        Kernel->>Sync: cluster_arrive_relaxed()
        Sync->>Kernel: cluster_wait()
    end
    Kernel->>Host: Return indices and values
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding cluster-accelerated single-pass multi-CTA top-k functionality for CuTE DSL, which aligns with the substantial changes across multiple kernel and integration files.
Description check ✅ Passed The PR description is comprehensive, clearly explaining what was added, why, and includes performance benchmarks, test coverage, and completed checklist items.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
tensorrt_llm/_torch/cute_dsl_kernels/blackwell/top_k/single_pass_multi_cta_radix_topk_cluster.py (1)

28-30: Consider whether the fallback import pattern is necessary given the hard cuda-python dependency.

While tensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.py does include a try-except fallback for the CUDA driver import, tensorrt_llm/_torch/autotuner.py (also added in the same feature commit) uses the same unconditional from cuda.bindings import driver pattern as this new file. Since cuda-python>=13 is a hard requirement in requirements.txt, the unconditional import is acceptable. However, if consistency across the codebase is desired, a fallback pattern could be added here as well.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@tensorrt_llm/_torch/cute_dsl_kernels/blackwell/top_k/single_pass_multi_cta_radix_topk_cluster.py`
around lines 28 - 30, Replace the unconditional CUDA import by matching the
fallback pattern used in tensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.py:
wrap the line "from cuda.bindings import driver" in a try/except ImportError and
fallback to the alternative import used there, ensuring the symbol driver is
still provided to this module; this keeps import behavior consistent while
preserving the hard dependency semantics if the fallback is not reached.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.py`:
- Around line 3965-3981: The cluster branch currently ignores the return value
from CuteDSLTopKDecodeSinglePassMultiCTAClusterRunner.forward and doesn't force
the cluster path when use_single_pass_multi_cta is set; change the code to (1)
set use_cluster = True when use_single_pass_multi_cta (bypassing the heuristic)
and (2) call CuteDSLTopKDecodeSinglePassMultiCTAClusterRunner.forward into a
tuple result (e.g., cluster_out, cluster_idx), check if cluster_out is None (or
both None) and if so call CuteDSLTopKDecodeSinglePassMultiCTARunner.forward(...)
to fall back, otherwise propagate the cluster outputs into output_indices/other
variables so output_indices is updated when the cluster runner succeeds.

In
`@tensorrt_llm/_torch/cute_dsl_kernels/blackwell/top_k/single_pass_multi_cta_radix_topk_cluster.py`:
- Around line 42-74: The function _query_max_cluster_size() is cached globally
but its result depends on the current CUDA device; update the caching so results
are keyed per-device. Change _query_max_cluster_size to include the current
device identifier in its cache key (e.g., accept a device_id argument or call
driver.cuCtxGetDevice() inside a small cached wrapper) and use
functools.lru_cache keyed by that device id (or replace the single-entry
lru_cache with a dict keyed by device id), then compute the cluster size using
HardwareInfo() as before; ensure the unique symbol _query_max_cluster_size and
the hw/func usage remain unchanged except for the added device-keying.

---

Nitpick comments:
In
`@tensorrt_llm/_torch/cute_dsl_kernels/blackwell/top_k/single_pass_multi_cta_radix_topk_cluster.py`:
- Around line 28-30: Replace the unconditional CUDA import by matching the
fallback pattern used in tensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.py:
wrap the line "from cuda.bindings import driver" in a try/except ImportError and
fallback to the alternative import used there, ensuring the symbol driver is
still provided to this module; this keeps import behavior consistent while
preserving the hard dependency semantics if the fallback is not reached.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a50bdc79-7c0e-4881-9747-7c2181538539

📥 Commits

Reviewing files that changed from the base of the PR and between eb5b602 and 629fc6a.

📒 Files selected for processing (6)
  • tensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.py
  • tensorrt_llm/_torch/cute_dsl_kernels/blackwell/top_k/single_pass_multi_cta_radix_topk.py
  • tensorrt_llm/_torch/cute_dsl_kernels/blackwell/top_k/single_pass_multi_cta_radix_topk_cluster.py
  • tensorrt_llm/_torch/modules/fused_moe/communication/deep_ep.py
  • tensorrt_llm/llmapi/llm_args.py
  • tests/unittest/_torch/thop/parallel/test_indexer_topk.py
💤 Files with no reviewable changes (1)
  • tensorrt_llm/llmapi/llm_args.py

Comment thread tensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.py
Signed-off-by: Mindy Li <11663212+limin2021@users.noreply.github.com>
… constexpr loops for radix rounds

- Extract single-CTA radix select + collect into a shared @cute.jit
  method on the parent class, eliminating duplication in the cluster
  subclass kernel.
- Replace manually unrolled Round 0/1/2/3 with cutlass.range_constexpr
  loops in both the new shared method and the cluster multi-CTA path.

Signed-off-by: Mindy Li <11663212+limin2021@users.noreply.github.com>
Signed-off-by: Mindy Li <11663212+limin2021@users.noreply.github.com>
Signed-off-by: Mindy Li <11663212+limin2021@users.noreply.github.com>
@limin2021

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #39603 [ run ] triggered by Bot. Commit: b2de4bc Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #39603 [ run ] completed with state SUCCESS. Commit: b2de4bc
/LLM/main/L0_MergeRequest_PR pipeline #30812 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

Link to invocation

@limin2021

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #39648 [ run ] triggered by Bot. Commit: b2de4bc Link to invocation

Comment thread tensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.py Outdated
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #39648 [ run ] completed with state SUCCESS. Commit: b2de4bc
/LLM/main/L0_MergeRequest_PR pipeline #30852 completed with status: 'SUCCESS'

CI Report

Link to invocation

… radix top-k

Extract build_local_histogram to base class and reuse in
build_and_merge_histogram. Extract _collect_pass_gt and _collect_pass_eq
to share 3-region output collection logic between distributed and cluster
variants, keeping only the barrier mechanism different in each.

Signed-off-by: Mindy Li <11663212+limin2021@users.noreply.github.com>
…und methods

Share prefix_mask computation across _radix_round_single_cta, _radix_round,
and _radix_round_cluster via a single base class method.

Signed-off-by: Mindy Li <11663212+limin2021@users.noreply.github.com>
…cts shape

Cluster runner returns (None, None) for unsupported problem sizes. Capture
the return value and fall back to the distributed variant instead of silently
producing no output.

Signed-off-by: Mindy Li <11663212+limin2021@users.noreply.github.com>
@limin2021

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #39698 [ run ] triggered by Bot. Commit: dd5d84f Link to invocation

Signed-off-by: Mindy Li <11663212+limin2021@users.noreply.github.com>
@limin2021

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #39698 [ run ] completed with state FAILURE. Commit: dd5d84f
/LLM/main/L0_MergeRequest_PR pipeline #30896 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

Link to invocation

@limin2021

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #39703 [ run ] triggered by Bot. Commit: f6f7c6c Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #39702 [ run ] triggered by Bot. Commit: f6f7c6c Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #39702 [ run ] completed with state SUCCESS. Commit: f6f7c6c
/LLM/main/L0_MergeRequest_PR pipeline #30901 completed with status: 'SUCCESS'

CI Report

Link to invocation

Replace custom _get_or_alloc_buffer with get_memory_buffers() from
memory_buffer_utils.py, aligning with the established pattern used by
DeepGemmFusedMoE. Set reserve_buffer based on CUDA Graph capture state.
Also add missing single_pass_multi_cta params to warmup docstring.

Signed-off-by: Mindy Li <11663212+limin2021@users.noreply.github.com>
@limin2021
limin2021 force-pushed the add_cute_dsl_single_pass_multi_cta_cluster_topk branch from 62f99b6 to 5c73f6c Compare March 23, 2026 03:28
@limin2021
limin2021 requested a review from longlee0622 March 23, 2026 03:30
@limin2021

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #39871 [ run ] triggered by Bot. Commit: 5c73f6c Link to invocation

@Superjomn
Superjomn removed the request for review from a team March 23, 2026 04:58
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #39871 [ run ] completed with state SUCCESS. Commit: 5c73f6c
/LLM/main/L0_MergeRequest_PR pipeline #31042 completed with status: 'SUCCESS'
Pipeline passed with automatic retried tests. Check the rerun report for details.

CI Report

Link to invocation

@hyukn hyukn left a comment

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.

LGTM.

@yuxianq
yuxianq merged commit 4f929fe into NVIDIA:main Mar 23, 2026
5 checks passed
longcheng-nv pushed a commit to longcheng-nv/TensorRT-LLM that referenced this pull request Mar 31, 2026
…VIDIA#12354)

Signed-off-by: Mindy Li <11663212+limin2021@users.noreply.github.com>
@yiakwy-xpu-ml-framework-team

Copy link
Copy Markdown

@limin2021 Great work in TRT-llm topk!

Recently we have added an explaination of trt-llm topk, please kick me if any description is incorrect.

https://github.com/yiakwy-xpu-ml-framework-team/flash-float-jit-kernels

for r in cutlass.range_constexpr(self.num_rounds):
shift = cutlass.const_expr(self.ordered_bits - (r + 1) * self.radix_bits)
prefix, remaining_k = self._radix_round_cluster(
r,

@yiakwy-xpu-ml-framework-team yiakwy-xpu-ml-framework-team Apr 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Happy to know that "mapa.shared::cluster.u3" was used to implement on-chip Rx/Tx semantics, which is not mentioned in the paper.

However this function does not allow early return from the program. This may expose some issues when data distribution is good (possibly, m1 round to return)

# Step 3: Collect output indices and values (cluster variant)
# ------------------------------------------------------------------
@cute.jit
def collect_output_cluster(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Very interesting, it seems no global write of first round radix select to be performed.

Wil it be possible to hold huge elements in later stage ?

@longcheng-nv longcheng-nv mentioned this pull request May 7, 2026
1 task
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.

5 participants