Skip to content

Validate preferred and fallback cluster shapes for Rubin BF16 preferred-cluster GEMM #18333

Open

Description

@coderabbitai

Summary

PersistentDenseGemmKernelPreferredCluster validates feasibility through the inherited can_implement path. That path evaluates cluster_shape_mn, which is set to fallback_cluster_shape_mn.

The preferred-cluster execution path also launches with preferred_cluster_shape_mn. The preferred shape currently has no equivalent feasibility validation before launch.

Required changes

In tensorrt_llm/_torch/cute_dsl_kernels/rubin/dense_bf16_gemm_persistent.py:

  • Add or override feasibility validation for PersistentDenseGemmKernelPreferredCluster.
  • Validate both fallback_cluster_shape_mn and preferred_cluster_shape_mn.
  • Ensure __call__ rejects configurations that are invalid for either cluster shape before it launches a preferred or fallback grid.

Rationale

If the fallback cluster shape passes but the preferred cluster shape has more M CTAs than the problem supports, the preferred path can launch phantom CTAs. On SM107, this can cause out-of-bounds TMA accesses or a hang.

Acceptance criteria

  • The preferred-cluster feasibility check evaluates both cluster shapes.
  • The launch path uses the combined result.
  • Tests cover a configuration where the fallback shape is feasible and the preferred shape is not.

Backlinks

Activity

  1. added
    Customized kernels
    on Aug 28, 2026
  2. farazkh80 commented on Sep 17, 2026

    @farazkh80
    Collaborator

    Related observation on SM107 against main: CuteDSLMXFP8RubinLinear lists tactics the kernel rejects at launch with cudaErrorInvalidValue (e.g. ('base', (128,64,128), (128,64,64), (1,1), False, True, 'clc_dynamic', 'n', 8) at M=2048/4096, N=32768, K=1024); the autotuner drops them with a warning, so no functional impact, but it is the same missing preferred/fallback cluster-shape validation as here, on the MXFP8 runner. Worth fixing both in the same pass. Reassigning to @peaceh-nv.

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

Metadata

Metadata

Assignees

Labels

Customized kernels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions