MLAutoScheduler is a tool designed specifically for optimizing machine learning workloads. It leverages MLIR transformations to achieve the best schedule for a given ML program. It uses the coreAutoScheduler repo to implement the core functionalities of the autoscheduler.
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
-
Building MLIR :
git clone https://github.com/llvm/llvm-project.git git checkout release/18.x mkdir llvm-project/build cd llvm-project/build cmake -G Ninja ../llvm \ -DLLVM_ENABLE_PROJECTS="clang;llvm;mlir;openmp" \ -DLLVM_BUILD_EXAMPLES=ON \ -DLLVM_TARGETS_TO_BUILD="Native;NVPTX;AMDGPU" \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_ENABLE_ASSERTIONS=ON \ cmake --build . --target check-mlir
For more detalis follow instructions at https://mlir.llvm.org/getting_started/
-
Clone the repo
git clone https://github.com/Modern-Compilers-Lab/MLAutoScheduler
-
Clone the submodules
git submodule update --init --recursive
-
Build
mkdir build cd build/ cmake .. -DMLIR_DIR={Path to llvm folder}/build/lib/cmake/mlir cmake --build . -j
-
Add env variables :
export LLVM_PATH={Path to llvm folder} export SHARED_LIBS=export SHARED_LIBS="${LLVM_PATH}/build/lib/libmlir_runner_utils.so,${LLVM_PATH}/build/lib/libmlir_c_runner_utils.so,${LLVM_PATH}/build/lib/libomp.so" export AS_VERBOSE=1
-
Run
bin/AutoSchedulerML ../benchmarks/{name of the benchmark}.mlir