buddy-compiler / buddy-benchmark

Benchmark Framework for Buddy Projects
Apache License 2.0
44 stars 34 forks source link

Add Halide Conv Layer Benchmark. #58

Open taiqzheng opened 1 year ago

taiqzheng commented 1 year ago

Update: Three versions of the Halide Conv Layer benchmark:

Build Halide: Please build Halide 14.0.0 with cmake , here is the link -> Halide-cmake.

Though Halide 14.0.0 is the latest version, it doesn't support LLVM 15.0.0, so I built LLVM 14.0.0 from source.

Note:

  1. _xxxgenerator.cpp file generate the header file and the library which was needed for the AOT Compilation Mode.
  2. See <path/to/buddy-benchmark/benchmarks/DeepLearning/Layers>/CMakeLists.txt for porting other Halide Benchmarks.
zhanghb97 commented 1 year ago

Encountered the following error:

CMake Error at CMakeLists.txt:97 (find_package):
  Found package configuration file:

    /root/Halide/build/packaging/HalideConfig.cmake

  but it set Halide_FOUND to FALSE so package "Halide" is considered to be
  NOT FOUND.  Reason given by package:

  Halide `static` libraries were requested but not found.

Any ideas?

taiqzheng commented 1 year ago

Halide supports limited versions of LLVM, the above error appears when encountering unsupported versions of LLVM.

Update: Build & Install Halide (main branch): cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_DIR=<path/to/buddy-mlir>/llvm/build/lib/cmake/llvm -S . -B build cmake --build build cmake --install ./build --prefix ./Halide-install

Build DeepLearning Benchmark: cmake -G Ninja .. \ -DDEEP_LEARNING_BENCHMARKS=ON \ -DOpenCV_DIR=<path/to/OpenCV>/build/ \ -DCMAKE_PREFIX_PATH=$PWD/../thirdparty/Halide/Halide-install/ \ -DBUDDY_MLIR_BUILD_DIR=<path/to/buddy-mlir>/build/ \ -DCMAKE_BUILD_TYPE=RELEASE ninja

Run Halide Benchmark: cd build/bin/ ./halide-convlayer-benchmark