-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding conversion between LinearLayout and DPASLayout (#1684)
This PR fixes #1295. Upstream Triton tries to abstract all tensor layouts with the LinearLayout abstraction. Solving #1295 requires using LinearLayout, so I've added codes to convert DPASLayout to LinearLayout. Currently, the conversion is only correct for DPAS OperandC layout.
- Loading branch information
Showing
12 changed files
with
799 additions
and
456 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
19 changes: 19 additions & 0 deletions
19
third_party/intel/include/Dialect/TritonIntelGPU/IR/LinearLayoutConversions.h
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Conversions from TritonIntelGPU DpasEncodingAttr to LinearLayout. | ||
|
||
#ifndef TRITON_DIALECT_TRITONINTELGPU_IR_LINEARLAYOUTCONVERSIONS_H | ||
#define TRITON_DIALECT_TRITONINTELGPU_IR_LINEARLAYOUTCONVERSIONS_H | ||
|
||
#include <optional> | ||
|
||
#include "intel/include/Dialect/TritonIntelGPU/IR/Attributes.h" | ||
#include "intel/include/Dialect/TritonIntelGPU/IR/Dialect.h" | ||
#include "triton/Tools/LinearLayout.h" | ||
|
||
namespace mlir::triton::gpu { | ||
|
||
std::optional<LinearLayout> DPAStoLinearLayout(ArrayRef<int64_t> shape, | ||
Attribute layout); | ||
|
||
} // namespace mlir::triton::gpu | ||
|
||
#endif // TRITON_DIALECT_TRITONINTELGPU_IR_LINEARLAYOUTCONVERSIONS_H |
This file contains 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
Oops, something went wrong.