Skip to content

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

Description

@lw

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions