Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VnniTransformation] Stop propagation on ops implementing CastOpInterface #917

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/Transforms/VnniTransformation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ class LayoutAnalysisImpl
return mlir::success();
}

if (mlir::OpTrait::hasElementwiseMappableTraits(op)) {
// for non-cast elementwise ops only. Propagation is stopped
// when meet an cast op, e.g., truncf, in which source and result
// needs different vnni factors.
if (mlir::OpTrait::hasElementwiseMappableTraits(op) &&
!mlir::isa<mlir::CastOpInterface>(op)) {
Layout layout;

// if the op has results, initial the layout to be vnni
Expand Down
2 changes: 1 addition & 1 deletion test/Transforms/VnniTransform/unit-tests.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -355,4 +355,4 @@ func.func @test(%arg1 : !xegpu.tensor_desc<8x16xf16>, %arg2 : !xegpu.tensor_desc
}
%2 = xegpu.dpas %0, %1 : vector<8x16xf16>, vector<16x16xf16> -> vector<8x16xf32>
return %2 : vector<8x16xf32>
}
}
Loading