-
Notifications
You must be signed in to change notification settings - Fork 48
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
Fix build failure in issues #178 #187
base: main
Are you sure you want to change the base?
Conversation
@zhaoshiz Thank you so much! Would you mind also updating the submodule commit to match in this PR too? Otherwise, our build will fail. |
@nhat-nguyen, I've updated the submodule sha and fixed additional compilation errors. I'm working with legal dept. to get the CLA approved. |
@microsoft-github-policy-service agree company="Qualcomm Innovation Center, Inc." |
Thank you, this saved me some time! :) |
@@ -836,8 +836,7 @@ struct AssertConverter : public OpConversionPattern<triton::AssertOp> { | |||
} | |||
|
|||
auto assertMessage = | |||
llvm::formatv("{0}.py:{1}: {2} Assertion `{3}` failed", op.getFile(), | |||
op.getLine(), op.getFunc(), op.getMessage()); | |||
llvm::formatv("{0}.py:{1}: {2} Assertion `{3}` failed", op.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format string doesn't seem to match the argument. Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah good catch. @zhaoshiz were there any issues with the other arguments that required you to remove them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the error shown in the first comment. Triton AssertOp's no longer have these functions, only a message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, good catch, I should look more carefully. Yes, Triton has removed File, Line, Func arguments from its AssertOp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like we have a few failures. would you mind taking a look at those? you can xfail the ones in Conversion/TritonToLinalg because we're retiring the pass soon. thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like we have a few failures. would you mind taking a look at those? you can xfail the ones in Conversion/TritonToLinalg because we're retiring the pass soon. thank you!
yes, I'm looking through those test failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I managed to fix/xfail most of the failures except:
TRITON-SHARED :: Conversion/StructuredToMemref/wraparound_side_by_side.mlir
TRITON-SHARED :: Conversion/StructuredToMemref/wraparound_stacked.mlir
The assertion is caused by LLVM commit llvm/llvm-project@889b67c, which consideres <2x?>
and <?x?>
are mismatch while both are dynamic shapes. I asked if that's intended:
llvm/llvm-project@889b67c#r149804171
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the failure StructuredToMemref/get_num_programs.mlir: 2153c53 after syncing-up with Triton@acc25d91fba850c18c099e7e577962ba56bdd06c and
LLVM@86b69c31642e98f8357df62c09d118ad1da4e16a.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you! looks like we have some failure in the "Prepare CPU backend" step. Doesn't look immediately clear to me what could be the cause. Perhaps the path that triton uses to store llvm has changed in the newer commits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm... I did see a symlink to my llvm being created in ${HOME}/.triton/llvm/
, and the two commands below worked fine in my local env:
file $(pwd)/build/$(ls $(pwd)/build | grep -i cmake)/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt
ls ${HOME}/.triton/llvm/$(ls ${HOME}/.triton/llvm/ | grep -i llvm)/bin
is there a verbose log of gh workflow?
Fixing below compilation errors in include/triton-shared/Conversion/TritonArithToLinalg/ConversionPatterns.hpp: /home/runner/work/triton-shared/triton-shared/triton_shared/include/triton-shared/Conversion/TritonArithToLinalg/ConversionPatterns.hpp:839:68: error: no member named 'getFile' in 'mlir::triton::AssertOp' llvm::formatv("{0}.py:{1}: {2} Assertion `{3}` failed", op.getFile(), ~~ ^ /home/runner/work/triton-shared/triton-shared/triton_shared/include/triton-shared/Conversion/TritonArithToLinalg/ConversionPatterns.hpp:840:26: error: no member named 'getLine' in 'mlir::triton::AssertOp' op.getLine(), op.getFunc(), op.getMessage()); ~~ ^ /home/runner/work/triton-shared/triton-shared/triton_shared/include/triton-shared/Conversion/TritonArithToLinalg/ConversionPatterns.hpp:840:40: error: no member named 'getFunc' in 'mlir::triton::AssertOp' op.getLine(), op.getFunc(), op.getMessage()); ~~ ^ 3 errors generated. This fix builds with triton @ab07e5472bcb414a0c8dd7ecab80f84370c4894e, and llvm @cfd3289a1f9a87e220737a634904a886a82d424a.
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
Remove parts of llvm::formatv string correspond to File, Line and Func arguments of triton::AssertOp.
Add `sanitize_overflow: bool = True` to class CPUOptions in compiler.py and `get_benchmarker(self)` to class CPUDriver in driver.py to run the tests. XFAILing TritonToLinalg tests since this pass will be retire soon: test/Conversion/TritonToLinalg/wraparound_side_by_side.mlir test/Conversion/TritonToLinalg/wraparound_stacked.mlir XFAILing StructuredToMemref tests due to LLVM commit 889b67c9d30e3024a1317431d66c22599f6c2011 asserts that dynamic shapes like <2x?> and <?x?> are mismatch: test/Conversion/StructuredToMemref/wraparound_side_by_side.mlir test/Conversion/StructuredToMemref/wraparound_stacked.mlir
Update CMakeList.txt for python and pybind11 headers. Fixed test/Conversion/TritonArithToLinalg/split.mlir. Working on test/Conversion/StructuredToMemref/get_num_programs.mlir. Builds with Triton@acc25d91fba850c18c099e7e577962ba56bdd06c and LLVM@86b69c31642e98f8357df62c09d118ad1da4e16a.
Add rewriteSplatOp() in PtrAnalysis pass. This function creates a tts.makeptr for the case below: %6 = tt.splat %arg0 : !tt.ptr<i32> -> tensor<1x!tt.ptr<i32>> Previously we rely on rewriteAddPtrOp to create the tts.makeptr: %3 = arith.constant 0 : index %6 = tt.splat %arg0 : !tt.ptr<i32> -> tensor<1x!tt.ptr<i32>> %7 = tt.addptr %6, %3 : tensor<1x!tt.ptr<i32>>, tensor<1xi32> Creating a constant 0 and adding it to a pointer is optimized away by Triton.
Fixing below compilation errors in include/triton-shared/Conversion/TritonArithToLinalg/ConversionPatterns.hpp:
/home/runner/work/triton-shared/triton-shared/triton_shared/include/triton-shared/Conversion/TritonArithToLinalg/ConversionPatterns.hpp:839:68: error: no member named 'getFile' in 'mlir::triton::AssertOp'
llvm::formatv("{0}.py:{1}: {2} Assertion
{3}
failed", op.getFile(),~~ ^
/home/runner/work/triton-shared/triton-shared/triton_shared/include/triton-shared/Conversion/TritonArithToLinalg/ConversionPatterns.hpp:840:26: error: no member named 'getLine' in 'mlir::triton::AssertOp'
op.getLine(), op.getFunc(), op.getMessage());
~~ ^
/home/runner/work/triton-shared/triton-shared/triton_shared/include/triton-shared/Conversion/TritonArithToLinalg/ConversionPatterns.hpp:840:40: error: no member named 'getFunc' in 'mlir::triton::AssertOp'
op.getLine(), op.getFunc(), op.getMessage());
~~ ^
3 errors generated.
This fix builds with triton @ab07e5472bcb414a0c8dd7ecab80f84370c4894e, and llvm @cfd3289a1f9a87e220737a634904a886a82d424a.