-
Notifications
You must be signed in to change notification settings - Fork 40
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
[OpOptimization] Add BatchMatMul benchmark and [OpOptimization] Further optimize BatchMatMulBroadcast and add OpenMP tests #73
base: main
Are you sure you want to change the base?
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. |
@@ -227,13 +227,42 @@ $ mkdir build && cd build | |||
$ cmake -G Ninja .. \ | |||
-DCMAKE_BUILD_TYPE=RELEASE \ | |||
-DOP_OPTIMIZATION_BENCHMARKS=ON \ | |||
-DCMAKE_CXX_COMPILER=clang++ \ |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
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 explanation of the further optimize:
EllisLambda@d8888a4#r126890428