[OpOptimization] Add BatchMatMul benchmark and [OpOptimization] Further optimize BatchMatMulBroadcast and add OpenMP tests#73
Conversation
|
Note: The file "BatchMatMulBroadcast.mlir" can be generated from "BatchMatMul.mlir" using |
|
This PR can be merged once these issues mentioned above are fixed. @EllisLambda |
|
@EllisLambda Please also make changes based on the suggestions mentioned above. |
@xlinsist Problems have been fixed. |
|
@xlinsist New commit have been pushed. |
100bb85 to
fc5e694
Compare
aa4bf23 to
feb6685
Compare
|
It seems that we have to carefully support lld and openmp. I will test this PR tomorrow. |
| $ cmake -G Ninja .. \ | ||
| -DCMAKE_BUILD_TYPE=RELEASE \ | ||
| -DOP_OPTIMIZATION_BENCHMARKS=ON \ | ||
| -DCMAKE_CXX_COMPILER=clang++ \ |
There was a problem hiding this comment.
Currently we only need to use clang++ in matmul-benchmark, so the modification here should be withdrawn.
| -DLLVM_ENABLE_RUNTIMES=all \ | ||
| -DOPENMP_ENABLE_LIBOMPTARGET=OFF \ | ||
| -DCMAKE_BUILD_TYPE=RELEASE | ||
| ``` |
There was a problem hiding this comment.
If a specific construction process is required(in matmul-benchmark), please ensure that the construction process you provide is complete. For example, add the step $ ninja, since in the default construction process we only use $ ninja check-clang check-mlir.
| $ cmake -G Ninja .. \ | ||
| -DCMAKE_BUILD_TYPE=RELEASE \ | ||
| -DOP_OPTIMIZATION_BENCHMARKS=ON \ | ||
| -DCMAKE_CXX_COMPILER=/PATH/TO/BUDDY-MLIR/BUILD/bin/clang++ \ |
There was a problem hiding this comment.
/PATH/TO/BUDDY-MLIR/BUILD/bin/clang++ ->
/PATH/TO/BUDDY-MLIR/llvm/build/bin/clang++
| -DBUDDY_MLIR_BUILD_DIR=/PATH/TO/BUDDY-MLIR/BUILD/ | ||
| $ ninja matmul-benchmark | ||
| ``` | ||
| - `matmul-benchmark` need to load the `libomp.so` in `buddy-mlir/llvm/build/lib` to execute, here's a temporary way without root. |
There was a problem hiding this comment.
Recommand to rephrase the description here like this:
To execute matmul-benchmark in buddy-benchmark/build/bin, The libomp.so file from buddy-mlir/llvm/build/lib need to be loaded. Here is a temporary workaround without root access:

The explanation of the further optimize:
EllisLambda@d8888a4#r126890428