[BUG] [CuTeDSL] cute.right_inverse refuses layouts with dynamic sizes
Nobody has claimed this yet.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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