ITADN

[BUG] [CuTeDSL] cute.coalesce doesn't do anything on dynamic shapes

#3469Openlw 创建于 11 天前
bug? - Needs TriageCuTe DSL
L
lwcommented
### Which component has the problem? CuTe DSL ### Bug Report **Describe the bug** A mode with a dynamic shape doesn't get coalesced into previous modes, even though the stride is static and the previous modes are fully static too (and that's all that's needed to check whether the modes can be coalesced). **Steps/Code to reproduce bug** ```py 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] // 128), stride=(8, 128), ) expected = cute.make_layout( (16 * (tensor.shape[1] // 128),), stride=(8,), ) print("input: ", layout) print("coalesced:", cute.coalesce(layout)) print("expected: ", expected) tensor = from_dlpack(torch.empty((4096, 8192), device="cuda")) tensor = tensor.mark_compact_shape_dynamic(mode=1) repro(tensor) ``` Output: ```text input: (16,?):(8,128) coalesced: (16,?):(8,128) expected: (?{div=16}):(8) ``` **Environment details (please complete the following information):** Version 4.7.0 of CuTeDSL
10 条评论