-
Notifications
You must be signed in to change notification settings - Fork 609
Add github precommit tests with cached LLVM #8
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
Conversation
.github/workflows/buildAndTest.yml
Outdated
| cd llvm/build | ||
| cmake ../llvm -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_TARGETS_TO_BUILD="host" -DCMAKE_INSTALL_PREFIX=../install -DLLVM_ENABLE_PROJECTS='mlir' -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_ENABLE_OCAMLDOC=OFF -DLLVM_ENABLE_BINDINGS=OFF -DLLVM_INSTALL_UTILS=ON -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_TEST=OFF -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_ENABLE_LLD=ON -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_RTTI=ON | ||
| cmake --build . --target install -- -j$(nproc) | ||
| - name: Build and Test CIRCT (Assert) |
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.
s/CIRCT/npcomp/
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.
Yeah I just noticed that.
.github/workflows/buildAndTest.yml
Outdated
| cd build_assert | ||
| cmake .. -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=ON -DMLIR_DIR=../llvm/install/lib/cmake/mlir/ -DLLVM_DIR=../llvm/install/lib/cmake/llvm/ -DCMAKE_LINKER=lld -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_EXTERNAL_LIT=`pwd`/../llvm/build/bin/llvm-lit | ||
| make check-npcomp -j$(nproc) | ||
| - name: Build and Test CIRCT (Release) |
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.
Ditto.
06cb780 to
c331038
Compare
c331038 to
d382404
Compare
Committing this as a snapshot of progress, but this code organization
approach is not scalable.
Output:
Got a dialect for op %0 = rd.range %c1_i64 to %c3_i64 : (i64, i64) -> !rd.Dataset: rd
walkOp name stringref: 'rd.range'
Made a create fn:
llvm.func internal @__rd_create_foo_fix_me(%arg0: !llvm.ptr<struct<(i64, i64)>>) {
%0 = llvm.mlir.constant(0 : index) : !llvm.i64
%1 = llvm.mlir.constant(1 : index) : !llvm.i64
%2 = llvm.getelementptr %arg0[%0, %0] : (!llvm.ptr<struct<(i64, i64)>>, !llvm.i64, !llvm.i64) -> !llvm.ptr<struct<(i64, i64)>>
%3 = llvm.getelementptr %arg0[%0, %1] : (!llvm.ptr<struct<(i64, i64)>>, !llvm.i64, !llvm.i64) -> !llvm.ptr<struct<(i64, i64)>>
%c1_i64 = constant 1 : i64
%c3_i64 = constant 3 : i64
llvm.store %2, %c1_i64 : i64
llvm.store %3, %c3_i64 : i64
return
}
Made a next function:
llvm.func internal @__rd_next_foo_fix_me(%arg0: !llvm.ptr<struct<(i64, i64)>>) -> !llvm.struct<(i1, i64)> {
%0 = llvm.mlir.constant(0 : index) : !llvm.i64
%1 = llvm.mlir.constant(1 : index) : !llvm.i64
%2 = llvm.getelementptr %arg0[%0, %0] : (!llvm.ptr<struct<(i64, i64)>>, !llvm.i64, !llvm.i64) -> !llvm.ptr<struct<(i64, i64)>>
%3 = llvm.getelementptr %arg0[%0, %1] : (!llvm.ptr<struct<(i64, i64)>>, !llvm.i64, !llvm.i64) -> !llvm.ptr<struct<(i64, i64)>>
%4 = llvm.load %2 : !llvm.ptr<struct<(i64, i64)>>
%5 = llvm.load %3 : !llvm.ptr<struct<(i64, i64)>>
%6 = "llvm.add"(%4, %1) : (!llvm.struct<(i64, i64)>, !llvm.i64) -> !llvm.struct<(i64, i64)>
%7 = llvm.icmp "ne" %4, %5 : !llvm.struct<(i64, i64)>
llvm.store %2, %6 : !llvm.struct<(i64, i64)>
return %7, %6 : !llvm.i1, !llvm.struct<(i64, i64)>
}
Did some sugary! Things now look like:
module {
func @main() {
%c1_i64 = constant 1 : i64
%c3_i64 = constant 3 : i64
%0 = llvm.mlir.constant(1 : index) : !llvm.i64
%1 = llvm.alloca %0 x !llvm.struct<(i64, i64)> : (!llvm.i64) -> !llvm.ptr<struct<(i64, i64)>>
llvm.call @__rd_create_foo_fix_me(%1) : (!llvm.ptr<struct<(i64, i64)>>) -> ()
%valid, %value = rd.iterator_next %1 : (!llvm.ptr<struct<(i64, i64)>>) -> (i1, i64)
"rd.print"(%value) : (i64) -> ()
return
}
}
Walking users.... found: rd.iterator_next... MATCHING!
Walking users.... found: llvm.call... didn't match.
Did some more sugary! Things now look like:
module {
func @main() {
%c1_i64 = constant 1 : i64
%c3_i64 = constant 3 : i64
%0 = llvm.mlir.constant(1 : index) : !llvm.i64
%1 = llvm.alloca %0 x !llvm.struct<(i64, i64)> : (!llvm.i64) -> !llvm.ptr<struct<(i64, i64)>>
llvm.call @__rd_create_foo_fix_me(%1) : (!llvm.ptr<struct<(i64, i64)>>) -> ()
%2 = llvm.call @__rd_next_foo_fix_me(%1) : (!llvm.ptr<struct<(i64, i64)>>) -> !llvm.struct<(i1, i64)>
%3 = llvm.extractvalue %2[0 : i32] : !llvm.struct<(i1, i64)>
%4 = llvm.extractvalue %2[1 : i32] : !llvm.struct<(i1, i64)>
"rd.print"(%4) : (!llvm.struct<(i1, i64)>) -> ()
return
}
}
Stack dump:
0. Program arguments: /usr/local/google/home/saeta/src/mlir-npcomp/build/bin/npcomp-opt basic.mlir -rd-lower-to-llvm
#0 0x00007f607c4110b3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /usr/local/google/home/saeta/src/mlir-npcomp/external/llvm-project/llvm/lib/Support/Unix/Signals.inc:563:13
#1 0x00007f607c40f330 llvm::sys::RunSignalHandlers() /usr/local/google/home/saeta/src/mlir-npcomp/external/llvm-project/llvm/lib/Support/Signals.cpp:72:18
llvm#2 0x00007f607c411575 SignalHandler(int) /usr/local/google/home/saeta/src/mlir-npcomp/external/llvm-project/llvm/lib/Support/Unix/Signals.inc:0:3
llvm#3 0x00007f608108e140 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14140)
llvm#4 0x00007f60804fe420 llvm::ilist_node_base<true>::isSentinel() const /usr/local/google/home/saeta/src/mlir-npcomp/external/llvm-project/llvm/include/llvm/ADT/ilist_node_base.h:45:36
llvm#5 0x00007f60804fe420 llvm::ilist_node_base<true>::isKnownSentinel() const /usr/local/google/home/saeta/src/mlir-npcomp/external/llvm-project/llvm/include/llvm/ADT/ilist_node_base.h:46:41
llvm#6 0x00007f60804fe420 llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, true, false, void>, false, false>::operator*() const /usr/local/google/home/saeta/src/mlir-npcom
p/external/llvm-project/llvm/include/llvm/ADT/ilist_iterator.h:138:5
llvm#7 0x00007f60804fe420 llvm::early_inc_iterator_impl<llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, true, false, void>, false, false> >::operator*() /usr/local/google
/home/saeta/src/mlir-npcomp/external/llvm-project/llvm/include/llvm/ADT/STLExtras.h:546:12
llvm#8 0x00007f60804fe420 mlir::detail::walk(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>) /usr/local/google/home/saeta/src/mlir-npcomp/external/llvm-project/mlir/lib/IR/Visito
rs.cpp:41:27
llvm#9 0x00007f60804fe43c mlir::detail::walk(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>) /usr/local/google/home/saeta/src/mlir-npcomp/external/llvm-project/mlir/lib/IR/Visito
rs.cpp:0:9
llvm#10 0x00007f6080e7fbf8 std::enable_if<(!(llvm::is_one_of<mlir::NPCOMP::rd::MakeIteratorOp, mlir::Operation*, mlir::Region*, mlir::Block*>::value)) && (std::is_same<void, void>::value), void>
::type mlir::detail::walk<(anonymous namespace)::LowerToRuntimePass::runOnOperation()::'lambda'(mlir::NPCOMP::rd::MakeIteratorOp), mlir::NPCOMP::rd::MakeIteratorOp, void>(mlir::Operation*, (
anonymous namespace)::LowerToRuntimePass::runOnOperation()::'lambda'(mlir::NPCOMP::rd::MakeIteratorOp)&&) /usr/local/google/home/saeta/src/mlir-npcomp/build/install-mlir/include/mlir/IR/Visi
tors.h:119:3
llvm#11 0x00007f6080e7fb90 void mlir::Operation::walk<(anonymous namespace)::LowerToRuntimePass::runOnOperation()::'lambda'(mlir::NPCOMP::rd::MakeIteratorOp), void>((anonymous namespace)::LowerT
oRuntimePass::runOnOperation()::'lambda'(mlir::NPCOMP::rd::MakeIteratorOp)&&) /usr/local/google/home/saeta/src/mlir-npcomp/build/install-mlir/include/mlir/IR/Operation.h:527:5
llvm#12 0x00007f6080e7fb03 void mlir::OpState::walk<(anonymous namespace)::LowerToRuntimePass::runOnOperation()::'lambda'(mlir::NPCOMP::rd::MakeIteratorOp), void>((anonymous namespace)::LowerToR
untimePass::runOnOperation()::'lambda'(mlir::NPCOMP::rd::MakeIteratorOp)&&) /usr/local/google/home/saeta/src/mlir-npcomp/build/install-mlir/include/mlir/IR/OpDefinition.h:178:5
llvm#13 0x00007f6080e7f876 (anonymous namespace)::LowerToRuntimePass::runOnOperation() /usr/local/google/home/saeta/src/mlir-npcomp/build/../lib/Dialect/RD/Transforms/LowerToLLVM.cpp:189:33
llvm#14 0x00007f6080522617 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool) /usr/local/google/home/saeta/src/mlir-npcomp/external/llvm-project/mli
r/lib/Pass/Pass.cpp:0:11
llvm#15 0x00007f6080525917 mlir::failed(mlir::LogicalResult) /usr/local/google/home/saeta/src/mlir-npcomp/external/llvm-project/mlir/include/mlir/Support/LogicalResult.h:47:23
llvm#16 0x00007f6080525917 mlir::detail::OpToOpPassAdaptor::runPipeline(llvm::iterator_range<llvm::pointee_iterator<std::unique_ptr<mlir::Pass, std::default_delete<mlir::Pass> >*, mlir::Pass> >,
mlir::Operation*, mlir::AnalysisManager, bool) /usr/local/google/home/saeta/src/mlir-npcomp/external/llvm-project/mlir/lib/Pass/Pass.cpp:402:9
llvm#17 0x00007f6080525917 mlir::PassManager::run(mlir::Operation*) /usr/local/google/home/saeta/src/mlir-npcomp/external/llvm-project/mlir/lib/Pass/Pass.cpp:817:13
llvm#18 0x00007f608055b69f mlir::failed(mlir::LogicalResult) /usr/local/google/home/saeta/src/mlir-npcomp/external/llvm-project/mlir/include/mlir/Support/LogicalResult.h:47:23
llvm#19 0x00007f608055b69f performActions(llvm::raw_ostream&, bool, bool, llvm::SourceMgr&, mlir::MLIRContext*, mlir::PassPipelineCLParser const&) /usr/local/google/home/saeta/src/mlir-npcomp/ex
ternal/llvm-project/mlir/lib/Support/MlirOptMain.cpp:75:7
llvm#20 0x00007f608055a26d processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, bool, bool, bool, bool, mlir::PassPipelineCLParser con
st&, mlir::DialectRegistry&) /usr/local/google/home/saeta/src/mlir-npcomp/external/llvm-project/mlir/lib/Support/MlirOptMain.cpp:109:12
llvm#21 0x00007f6080559ff5 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, mlir::PassPipelineCLParser const&, mlir::DialectRe
gistry&, bool, bool, bool, bool, bool) /usr/local/google/home/saeta/src/mlir-npcomp/external/llvm-project/mlir/lib/Support/MlirOptMain.cpp:146:10
llvm#22 0x000000000040d2ef main /usr/local/google/home/saeta/src/mlir-npcomp/build/../tools/npcomp-opt/npcomp-opt.cpp:91:14
llvm#23 0x00007f607b688d0a __libc_start_main ./csu/../csu/libc-start.c:308:16
llvm#24 0x000000000040ceca _start (/usr/local/google/home/saeta/src/mlir-npcomp/build/bin/npcomp-opt+0x40ceca)
Segmentation fault
* Save current state. * Include constant arguments in source. * Emit constants for Reshape second argument. * Clean-up code. * Add changes to gen_doc.py file. * Propagate constant tensor to Reshape second arg to infer shape. * Update documentation. * Eliminate constant tensor operations when lowering to KRNL dialect. * Replace ConstantTensorOp with ConstantOp. * Add comment to remove temporary Constant lowering code. * Remove unused shape inference for Constant. * Remove comment. * Remove explicit constant elimination. * Refactor code.
# This is the 1st commit message: [Stablehlo] Add converter to stablehlo for aten.(Int,Float,Bool).Tensor op (llvm#2340) [Stablehlo] Add converter to stablehlo for aten.(Int,Float,Bool).Tensor op and configure crashing e2e sets for stablehlo backend. # This is the commit message llvm#2: update PyTorch version to 2.1.0.dev20230729 (llvm#2354) - torch version: 2.1.0.dev20230729 - torch commit hash: b638df0afb83572724032c824c64e481bb4499a0 - torchvision version: 0.16.0.dev20230729 Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com> # This is the commit message llvm#3: update PyTorch version to 2.1.0.dev20230730 (llvm#2356) - torch version: 2.1.0.dev20230730 - torch commit hash: 0ff243ff350268cc98fe03fa6364375ee2824742 - torchvision version: 0.16.0.dev20230730 Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com> # This is the commit message llvm#4: update PyTorch version to 2.1.0.dev20230731 (llvm#2359) - torch version: 2.1.0.dev20230731 - torch commit hash: 6298ac688f8caafe30d71ff2ea2e20fbb32065c7 - torchvision version: 0.16.0.dev20230731 Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com> # This is the commit message llvm#5: LTC->MLIR Debug Info support (llvm#1922) * LTC->MLIR Debug Info support * SW-95317 Propagate Lazy->Jit->MLIR scope name. * Enhance location information based on op names Currently, the location information attached to the ops just considers the filename, line number and column number. Attaching operation name would help identify the type of computation by just looking at the profile of execution. * Update locations logic; updated debug-info.py test * Use {scope}/{op_name} format to track names by default --------- Co-authored-by: Gleb Kazantaev <gleb.kazantaev@cerebras.net> Co-authored-by: Mark Browning <mark@cerebras.net> Co-authored-by: Vimal Patel <vimal@polymagelabs.com> # This is the commit message llvm#6: build: update llvm tag to 4189584 Summary of changes: - Update tags llvm: 4189584 mhlo: 4726d31f7025da66de0dea709bd56c462edb83c2 Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com> # This is the commit message llvm#7: update PyTorch version to 2.1.0.dev20230802 (llvm#2366) - torch version: 2.1.0.dev20230802 - torch commit hash: c89b16917755c2abbef7b6420e340baf9ae8089e - torchvision version: 0.16.0.dev20230802 Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com> # This is the commit message llvm#8: Change Python version from 3.10 to 3.11 in installation instructions (llvm#2370) # This is the commit message llvm#9: Add CITATION file (llvm#2371) # This is the commit message llvm#10: Add packaging as an install dependency (llvm#2369) Needed by `torch_mlir._version`. Resolves llvm#2368. # This is the commit message llvm#11: [Torch Dialect] emit aten.masked_scatter and aten.masked_scatter_ op (llvm#2358) * [Torch Dialect] emit aten.masked_scatter and aten.masked_scatter_ op # This is the commit message llvm#12: update PyTorch version to 2.1.0.dev20230803 (llvm#2372) - torch version: 2.1.0.dev20230803 - torch commit hash: f89c73be3a3e8274d025ac46a33a780853841c9e - torchvision version: 0.16.0.dev20230803 Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com> # This is the commit message llvm#13: Prevent failed stable CI job from cancelling nightly jobs (llvm#2373) The CI jobs that use stable PyTorch are currently not required to pass in order for a patch to get merged in `main`. This commit makes sure that if a CI job for stable PyTorch fails, it does not cancel the other required jobs. # This is the commit message llvm#14: [Torch Dialect] emit aten.tile op and decompose it into aten.repeat (llvm#2355) # This is the commit message llvm#15: update # This is the commit message llvm#16: update xfail sets # This is the commit message llvm#17: update xfail_sets # This is the commit message llvm#18: update # This is the commit message llvm#19: fix xfail_sets # This is the commit message llvm#20: update: # This is the commit message llvm#21: update # This is the commit message llvm#22: update:
…eration during folding (#4274) This fixes a SEGFAULT in the GreedyPatternRewriteDriver and adds a missing size check to the `torch.aten._assert_tensor_metadata` operation. Erasing an operation during folding is not allowed. Folding the operation may eithermodify it in place or return a set of replacements, but may not erase the operation. (see https://github.com/llvm/llvm-project/blob/e56384ff540e68f9d0500fa27a95354c0730e37b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp#L492-L508) Doing this causes a SEGFAULT (witnessed on macOS Sequoia 15.5, Apple M4): ``` Stack dump: 0. Program arguments: build/bin/torch-mlir-opt -canonicalize --split-input-file -verify-diagnostics test/Dialect/Torch/invalid_canonicalize.mlir #0 0x0000000104091524 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build/bin/torch-mlir-opt+0x10140d524) #1 0x000000010408fa5c llvm::sys::RunSignalHandlers() (build/bin/torch-mlir-opt+0x10140ba5c) #2 0x0000000104091bc8 SignalHandler(int, __siginfo*, void*) (build/bin/torch-mlir-opt+0x10140dbc8) #3 0x0000000181e10624 (/usr/lib/system/libsystem_platform.dylib+0x1804ac624) #4 0x0000000103c1f7a8 (anonymous namespace)::GreedyPatternRewriteDriver::processWorklist() (build/bin/torch-mlir-opt+0x100f9b7a8) #5 0x0000000103c1cf4c mlir::applyPatternsGreedily(mlir::Region&, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig, bool*) (build/bin/torch-mlir-opt+0x100f98f4c) #6 0x0000000102c8f62c (anonymous namespace)::Canonicalizer::runOnOperation() (build/bin/torch-mlir-opt+0x10000b62c) #7 0x0000000103c72fa4 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (build/bin/torch-mlir-opt+0x100feefa4) #8 0x0000000103c750d4 mlir::PassManager::run(mlir::Operation*) (build/bin/torch-mlir-opt+0x100ff10d4) #9 0x0000000102c8d774 performActions(llvm::raw_ostream&, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) (build/bin/torch-mlir-opt+0x100009774) #10 0x0000000102c8d35c llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) (build/bin/torch-mlir-opt+0x10000935c) #11 0x000000010403194c mlir::splitAndProcessBuffer(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef)::$_0::operator()(llvm::StringRef) const (build/bin/torch-mlir-opt+0x1013ad94c) #12 0x00000001040316a4 mlir::splitAndProcessBuffer(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (build/bin/torch-mlir-opt+0x1013ad6a4) #13 0x0000000102c87078 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (build/bin/torch-mlir-opt+0x100003078) #14 0x0000000102c8731c mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (build/bin/torch-mlir-opt+0x10000331c) #15 0x0000000102c87538 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (build/bin/torch-mlir-opt+0x100003538) #16 0x0000000102c85cd0 main (build/bin/torch-mlir-opt+0x100001cd0) #17 0x0000000181a36b98 build/tools/torch-mlir/test/Dialect/Torch/Output/invalid_canonicalize.mlir.script: line 1: 72586 Segmentation fault: 11 build/bin/torch-mlir-opt -canonicalize --split-input-file -verify-diagnostics test/Dialect/Torch/invalid_canonicalize.mlir ``` Since the `torch.aten._assert_tensor_metadata` operation is only used for static assertion during compile time the folding can be replaced by a canonicalization that checks the assert and then uses a rewriter to erase the operation. The second commit deals with a missing size check in the assert operation before using a zip operation. Without the explicit checkout of the size, the would assert not fail in case the size of the dimensions were the same, but there are either less or more dimensions in the input than specified in the assert. --------- Signed-off-by: Florian Walbroel <walbroel@roofline.ai> Co-authored-by: Florian Walbroel <walbroel@roofline.ai>
No description provided.