[TritonToLinalg](fix) fix zero-stride load boundary - #1509
Draft
zhanwei33 wants to merge 1 commit into
Draft
Conversation
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
tt.make_tensor_ptrlogical shape and offsets when any static stride is zero.
strided<[0, ...]>andmemref.copy) for those loads; this PR does not add a fallback or changelater TTAdapter/BishengIR stages.
offsets, and the unchanged regular non-zero-stride path.
Root cause
The generic boundary-size helper reconstructs logical coordinates from the
remapped physical pointer. A zero stride removes that physical-coordinate
information, so the reconstruction can reach a
0 / 0expression and leave arequired
OpFoldResultabsent. Using the original tensor-pointer shape andoffsets retains the logical coordinates needed for the boundary calculation.
Scope
This is the boundary-only alternative to #1508. It fixes the
triton-to-linalgconversion crash only; it intentionally leaves downstreamacceptance of the resulting zero-stride memref to the existing pipeline. Do
not merge both PRs.
Validation
pre-commit run --files third_party/ascend/lib/TritonToLinalg/LoadStoreConverter.cpp third_party/ascend/unittest/Conversion/General/TritonToLinalg/zero_stride_block_ptr_load.mlircmake --build <isolated-build> --target TritonToLinalg -- -j 16Built a
triton-optdriver from this source with the existing TA command-linepass registration enabled solely for this check, then ran the new regression: