PR #17440: Inject desired pattern for handling Transpose for fp8 gemm rewrite #17798
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.
PR #17440: Inject desired pattern for handling Transpose for fp8 gemm rewrite
Imported from GitHub PR #17440
Related to #17276 and #16975.
This PR updates the GemmRewriter to handle the transpose of non-descending layouts directly, eliminating the need for the layout_normalization pass to correct this error-prone pattern post-rewrite. The desired transformation is now injected into GemmRewriter, ensuring the problematic layout is handled internally. This PR transforms the following error-prone pattern, where the transpose of a non-descending layout is the issue:
to
Copybara import of the project:
--
237c032 by shuw [email protected]:
Improve TransposeMatrix
--
508cd69 by Shu Wang [email protected]:
Fix bug of permutation.
c55e8a9 by shuw [email protected]:
clang format
--
ad0a4ba by Shu Wang [email protected]:
Add unittest.
1d45b4d by Shu Wang [email protected]:
Remove uncessary space.
7837845 by Shu Wang [email protected]:
Update unittest.
--
b479c21 by shuw [email protected]:
Improve TransposeMatrix
--
b633184 by Shu Wang [email protected]:
Update unittest shape and BUILD file.
Merging this change closes #17440
FUTURE_COPYBARA_INTEGRATE_REVIEW=#17440 from wenscarl:fp8_regulate_transpose b633184