Skip to content

Commit

Permalink
Fix build failures in microsoft#178 and update Triton
Browse files Browse the repository at this point in the history
Fix compilation errors caused by LLVM commits:
f18c3e4e7335df282c468b6dff3d29be1822a96d [mlir][Transforms] Dialect Conversion: Simplify materialization fn result type (#113031)
8c4bc1e75de27adfbaead34b895b0efbaf17bd02 [mlir][Transforms] Merge 1:1 and 1:N type converters (#113032)

Update Triton to 94684d326723b67b146f23f342623ea058a32098
  • Loading branch information
zhaoshiz committed Jan 17, 2025
1 parent 4fefbbd commit 596821e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class LoopTypeConverter : public TypeConverter {
// reinterpret_cast.
addTargetMaterialization([&](OpBuilder &builder, MemRefType memrefType,
ValueRange inputs,
Location loc) -> std::optional<Value> {
Location loc) -> Value {
auto reinterpretCast =
inputs[0].getDefiningOp<memref::ReinterpretCastOp>();
if (!reinterpretCast) {
Expand Down
14 changes: 7 additions & 7 deletions lib/Conversion/TritonToStructured/TritonToStructuredPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class TritonToStructuredPass
RewritePatternSet patterns(&getContext());

auto context = &getContext();
OneToNTypeConverter converter;
TypeConverter converter;
converter.addConversion([](Type type) { return type; });

// We are doing a 1->1 type conversion here, where a triton pointer type
Expand Down Expand Up @@ -145,10 +145,10 @@ class TritonToStructuredPass
// Compute the target materialization, given a value with the pointer type,
// convert that value to a tuple type.
converter.addTargetMaterialization(
[](OpBuilder &builder, TypeRange resultTypes, Value input,
Location loc) -> std::optional<SmallVector<Value>> {
[](OpBuilder &builder, TypeRange resultTypes, ValueRange inputs,
Location loc) -> SmallVector<Value> {
return builder
.create<UnrealizedConversionCastOp>(loc, resultTypes, input)
.create<UnrealizedConversionCastOp>(loc, resultTypes, inputs.front())
->getResults();
});

Expand All @@ -172,7 +172,7 @@ class TritonToStructuredPass
auto moduleOp = getOperation();

auto context = &getContext();
OneToNTypeConverter converter;
TypeConverter converter;
converter.addConversion([](Type type) { return type; });

// We are doing a 1->N type conversion here, where a pointer tuple type
Expand Down Expand Up @@ -208,10 +208,10 @@ class TritonToStructuredPass
// At the end of pointer analysis, we will use the PtrState to create the
// correct offsets, strides, and remove these ops.
converter.addTargetMaterialization([](OpBuilder &builder,
TypeRange resultTypes, Value input,
TypeRange resultTypes, ValueRange inputs,
Location loc) {
auto placeholder = builder.create<tts::GetStructuredStateOp>(
loc, input.getDefiningOp()->getOperand(0));
loc, inputs.front().getDefiningOp()->getOperand(0));
assert(llvm::equal(placeholder.getResultTypes(), resultTypes));
return placeholder.getResults();
});
Expand Down
2 changes: 1 addition & 1 deletion triton
Submodule triton updated 309 files

0 comments on commit 596821e

Please sign in to comment.