NVIDIA / NVIDIA/cutlass

[BUG] [CuTeDSL] cute.right_inverse refuses layouts with dynamic sizes

Open
#3,471 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

? - Needs Triage bug CuTe DSL
Dominant language
C++
Stars
10.5k
Forks
2.1k
Avg merge
3d 11h
Merged PRs (30d)
7

Description

Which component has the problem?

CuTe DSL

Bug Report

Describe the bug
Invoking cute.right_inverse with a dynamic layout raises an exception that states that the function outright refuses to deal with dynamic layouts. I don't see a fundamental issue with that, and with the specific arguments I used there should be a well-defined result.

Steps/Code to reproduce bug

import torch
import cutlass.cute as cute
from cutlass.cute.runtime import from_dlpack


@cute.jit
def repro(tensor: cute.Tensor):
    layout = cute.make_layout(
        (16, tensor.shape[1]),
        stride=(1, 16),
    )
    expected = cute.make_layout(16 * tensor.shape[1], stride=1)

    print("layout:          ", layout)
    print("expected inverse:", expected)
    print("actual inverse:  ", cute.right_inverse(layout))

tensor = from_dlpack(torch.empty((4096, 8192), device="cuda"))
tensor = tensor.mark_compact_shape_dynamic(mode=1)
repro(tensor)

Environment details (please complete the following information):
CuTeDSL version 4.7.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided repro and tracing the cute.right_inverse entry point for how it handles dynamic layouts. Confirm the implementation supports the shown layout and returns the expected contiguous inverse instead of raising the refusal exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.