Skip to content

Commit

Permalink
add cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
yinying-lisa-li committed Jun 27, 2024
1 parent fec8553 commit 44a0d89
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/regression-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,40 @@ jobs:
run: export PYTHONPATH=build/tools/mpact/python_packages/mpact
shell: bash

- name: Build
run: cmake --build build --target build-benchmark-mpact
- name: Set up ccache
uses: hendrikmuhs/[email protected]

- name: Install requirements
run: |
export CCACHE_DIR=${{ env.CACHE_DIR }}
python -m pip install --upgrade pip
python -m pip install --upgrade pip
python -m pip install pytest pytest-benchmark
python -m pip install -r externals/torch-mlir/requirements.txt
python -m pip install -r externals/torch-mlir/torchvision-requirements.txt
- name: Create build directory
run: mkdir build

- name: Configure CMake
run: >
cmake -GNinja -Bbuild
-DCMAKE_BUILD_TYPE=Release
-DLLVM_ENABLE_PROJECTS=mlir
-DLLVM_ENABLE_ASSERTIONS=ON
-DLLVM_EXTERNAL_PROJECTS="torch-mlir;mpact"
-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR="${PWD}/externals/torch-mlir"
-DLLVM_EXTERNAL_MPACT_SOURCE_DIR="${PWD}"
-DLLVM_TARGETS_TO_BUILD=host
-DMLIR_ENABLE_BINDINGS_PYTHON=ON
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
"externals/torch-mlir/externals/llvm-project/llvm"
- name: Build
run: cmake --build build --target build-benchmark-mpact

- name: Run benchmark
run: pytest benchmark/python/benchmarks/regression_benchmark.py --benchmark-json output.json
Expand Down

0 comments on commit 44a0d89

Please sign in to comment.