[CuTeDSL] Support dynamic shapes in right_inverse - #3582
Open
kzos wants to merge 2 commits into
Open
Conversation
Sync the dialect reference with the dynamic-shape contract and cover the runtime prefix-product and scalar-order lowering paths. Also fix a dangling comment in the neighboring left-inverse test. Test Plan: ```bash build-cutlass-compiler/llvm-project/bin/llvm-lit -v build-cutlass-compiler/cute_ir/test/Conversion/CuteToBase/pipeline_full.mlir build-cutlass-compiler/cute_ir/test/Conversion/CuteExpandOps/LayoutAlgebra/left_inverse.mlir build-cutlass-compiler/cute_ir/test/Conversion/CuteExpandOps/LayoutAlgebra/right_inverse.mlir build-cutlass-compiler/cute_ir/test/Dialect/Cute/LayoutAlgebra/right_inverse.mlir build-cutlass-compiler/cute_ir/test/Dialect/Cute/LayoutAlgebra/right_inverse_errors.mlir ctest --test-dir build-cutlass-compiler -R 'cg_right_inverse_test' --output-on-failure git diff --check ```
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
right_inverseto accept dynamic shapes when every stride is a fully static integerFor
(16, N):(1, 16), this returns the functionally equivalent uncoalesced(16, N):(1, 16)layout demonstrated by PyCuTe in the issue discussion. Producing the canonical16*N:1representation depends on dynamic coalescing, which is tracked separately in #3469. Consequently, callers that require a coalesced rank-1 inverse, including theblackwell_helpers.pyTMA-shape path, still depend on #3469.Testing
cmake --build build-cutlass-compiler --target check-cute -j 8(236/236 passed)cmake --build build-cutlass-compiler --target check-cutegen-unittests -j 8(220/220 passed across 25 test binaries)ctest --test-dir build-cutlass-compiler -R 'cg_right_inverse_test' --output-on-failure(1/1 passed)git diff --checkThe compiler and tests were built CPU-only against the LLVM revision pinned by
cutlass_compiler/LLVM_COMMIT.Contribution disclosure
AI assistance was used for repository research, implementation, independent review, and running the checks above.
Fixes #3471