[Issue]: zipped divide crashes on some cases

Open
#739 3 comments 0 reactions 1 assignee View on GitHub

@tingqli is already working on this.

Since Jun 25, 2026.

Assessment

This issue has not been assessed yet.

Description

Problem Description

During learning CuTe's layout divide, I found that there are some differences (& even unexpected crash) between Fly & CuTe in some special cases:

  • Tiler's rank is smaller than input layout
  • When there is None element in Tiler

Run following script under cutlass/python folder to see the differences and reproduce the crash

import pycute

a = pycute.layout.Layout((64,50,80),(16000,160,1))
print(a)

all_tiles = [(32, ),(32, None, None),(32, None, 40)]

for tile in all_tiles:
    print("pycute:", tile)
    print("\t", pycute.logical_divide(a, tile))
    print("\t", pycute.zipped_divide(a, tile))

print("==================================")

import flydsl.compiler as flyc
import flydsl.expr as fx
def fx_test_div():
    a = fx.make_layout((64,50,80),(16000,160,1))
    for tile in all_tiles:
        print("flydsl:", tile)
        print("\t", fx.logical_divide(a, tile))     # 
        print("\t", fx.zipped_divide(a, tile))     # <======= crash on 2nd case

@flyc.jit
def test():
    fx_test_div()

test()

when tiler is (32,):

  • Cute logical-div: ((32, 2), 50, 80):((16000, 512000), 160, 1)
  • Cute zipped-div: ((32,), (2, 50, 80)):((16000,), (512000, 160, 1))
  • Fly logical-div: Layout<(32,(2,50,80)):(16000,(512000,160,1))>
  • Fly zipped-div: Layout<(32,(2,50,80)):(16000,(512000,160,1))>

when tiler is (32, None, None)

  • Cute logical-div: ((32, 2), 50, 80):((16000, 512000), 160, 1)
  • Cute zipped-div: ((32, 1, 1), (2, 50, 80)):((16000, 0, 0), (512000, 160, 1))
  • Fly logical-div: Layout<((32,2),50,80):((16000,512000),160,1)>
  • Fly zipped-div: crash
python3: /root/tingqli/FlyDSL/include/flydsl/Dialect/Fly/Utils/IntTupleUtils.h:852: std::pair<_FIter, _FIter> mlir::fly::detail::intTupleZip2ByImpl(const mlir::fly::IntTupleBuilder<IntTuple>&, IntTuple, mlir::fly::IntTupleAttr) [with IntTuple = mlir::fly::IntTupleAttr]: Assertion `t.rank() == 2 && "intTupleZip2By expects rank-2 tuple at terminal"' failed.
Aborted (core dumped)
Operating System

22.04.5 LTS (Jammy Jellyfish)

CPU

Intel(R) Xeon(R) Platinum 8480C

GPU

MI308X

ROCm Version

rocm-7.2.0

ROCm Component

No response

Steps to Reproduce

No response

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
rocminfo --support output
Paste output here
Additional Information

No response

Dominant language
Python
Stars
282
Forks
120
Avg merge
1d 21h
Merged PRs (30d)
67

Contributor guide

Open the contributing guide

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.

More from ROCm/FlyDSL

All issues in ROCm/FlyDSL

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.