feat: isolate cutlass._mlir imports behind compat gateway (#118) - #121
Open
bikrammajhi wants to merge 3 commits into
Open
feat: isolate cutlass._mlir imports behind compat gateway (#118)#121bikrammajhi wants to merge 3 commits into
bikrammajhi wants to merge 3 commits into
Conversation
…usionAI#118) All 10 kernel modules previously imported CuTeDSL's private generated bindings (cutlass._mlir.{ir,arith,llvm,vector,nvvm,cute}) directly, so a CutDSL patch release could break kernel emission silently (the 4.5.2->4.5.3 tcgen05_ld/st incident). Add a single-point gateway that lazily loads the private dialects, enforces the pyproject.toml version contract (including the !=4.5.0 exclusion), and probes canary entry points, failing fast with an actionable error. Migrate all consumers to bind their dialect aliases from the gateway. Extend test_cutedsl_compat.py with fault-injection and version-matrix tests that run headless.
CutDSL renamed vector.extractelement to vector.extract in the 4.6 line, which broke store_256b (used by KDA SM100 backward) against nvidia-cutlass-dsl 4.6.2 at JIT time. Route element extraction through the gateway's version-dispatching vector_extract_element helper.
bikrammajhi
force-pushed
the
mlir-compat-gateway
branch
2 times, most recently
from
August 9, 2026 17:53
8442bc2 to
2af0dc0
Compare
Author
|
Aligned with #119 (merged) — this PR builds on top of the tcgen05 signature-detection work; no overlap: #119 owns Scope recap
Healthy on the minimal local smoke suite; the automated H100 run is in flight — I'll post the summary when it's back. |
bikrammajhi
force-pushed
the
mlir-compat-gateway
branch
5 times, most recently
from
August 9, 2026 18:33
f6ac23d to
45b53d3
Compare
bikrammajhi
force-pushed
the
mlir-compat-gateway
branch
from
August 9, 2026 18:47
45b53d3 to
2c16cb9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #118 — isolates all direct
cutlass._mlirusage behind a single compatibility gateway.CuTeDSL's generated MLIR/NVVM bindings (
cutlass._mlir.{ir,arith,llvm,vector,nvvm,cute}) are private implementation detail with no cross-version stability contract — thetcgen05_ld/stbreakage between CutDSL 4.5.2 and 4.5.3 was the first confirmed incident. cuLA imported these directly from 10 kernel modules, so a patch release could break kernel emission silently, delayed until import/JIT time.Changes
cula/ops/_mlir_compat.py— the only module that may touchcutlass._mlir:import culanever touches private bindings)pyproject.toml(>=4.4.2,<4.7,!=4.5.0), enforced with a fail-fastRuntimeErrornaming the offending versionvector_extract_element()helper with cross-version dispatch (see below)vector.extractelementtovector.extractin the 4.6 line; againstnvidia-cutlass-dsl==4.6.2(resolved by our ownpyproject.tomlrange)store_256braisesAttributeErrorat JIT time.store_256bis used by the KDA SM100 backward path. The gateway'svector_extract_elementdispatches to whichever binding exists, restoring 4.6 compatibility.scripts/modal_validate.py— H100/CUDA 12.9 validation harness (runs the headless suite + SM90 prefill/decode tests in onemodal run).Validation status
tests/test_cutedsl_compat.pygreen againstnvidia-cutlass-dsl==4.6.2modal run scripts/modal_validate.py; will attach resultsNotes for reviewers
extractelementcall instore_256bpassed the position as a keyword (position=...); the newvector.extractbinding takes it positionally ((source, dynamic_position, static_position)). The dispatch helper deliberately keeps the exact call shapes per branch._CANARIES/_ANY_OF_CANARIESwhen new private-API usage lands.