Skip to content

fix: mlir error when the split have 1 payload instead of 2#61

Open
yadej wants to merge 1 commit intoxtc-tools:mainfrom
yadej:dev/rcesista/fix-split-1-payload
Open

fix: mlir error when the split have 1 payload instead of 2#61
yadej wants to merge 1 commit intoxtc-tools:mainfrom
yadej:dev/rcesista/fix-split-1-payload

Conversation

@yadej
Copy link
Contributor

@yadej yadej commented Mar 5, 2026

Motivation

A valid schedule crash at the compiler step

import xtc.graphs.xtc.op as O
from xtc.backends.mlir import Backend
from xtc.schedules.descript import descript_scheduler

i, j, k, dtype = 50, 64, 64, "float32"
a = O.tensor((i, k), dtype, name="A")
b = O.tensor((k, j), dtype, name="B")

with O.graph(name="matmul") as gb:
    p = O.matmul(a, b, name="C")
graph = gb.graph

backend1 = Backend(graph)
sch = backend1.get_scheduler()
descript_scheduler(
    scheduler=sch,
    node_name="C",
    abstract_dims=["i", "j", "k"],
    spec={
        "k": {},
        "i": {},
        "i#10":{},
        "i[0:5]" :{
            "i#5": {},
            "j": {},
        },
        "i[5:]" :{
            "i#5": {},
            "j": {},
        }
    }
)
comp = backend1.get_compiler(
    shared_lib=True,
    dump_file="matmul_spec_error",
)
module = comp.compile(sch.schedule())
RuntimeError: MLIR Error: %7 = "transform.structured.split"(%6#0) <{dimension = 0 : i64, static_chunk_sizes = 5 : i64}> : (!transform.any_op) -> !transform.any_op expected to contain 2 payloads but it contains 1 payloads
error: %7 = "transform.structured.split"(%6#0) <{dimension = 0 : i64, static_chunk_sizes = 5 : i64}> : (!transform.any_op) -> !transform.any_op expected to contain 2 payloads but it contains 1 payloads

Solution: adding a fail_on_payload_too_small=False attribute to the split_handle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant