Compiling the Source Code
After the patch file is applied, install and build the TVM shared library.
- Go to the /path/to/TVM/apache-tvm-src-v0.9.0 directory.
1cd /path/to/TVM/apache-tvm-src-v0.9.0/
- Create a build directory build and copy cmake/config.cmake to the directory.
1 2
mkdir build cp cmake/config.cmake build
- Edit build/config.cmake to customize compilation options.
- To facilitate the profiling, enable the embedded graph executor and the profiler using the following options:
1 2
set(USE_GRAPH_EXECUTOR ON) set(USE_PROFILER ON)
- TVM requires LLVM for CPU code generation. Set USE_LLVM to ON.
1set(USE_LLVM ON)
- To facilitate the profiling, enable the embedded graph executor and the profiler using the following options:
- Compile the CMakeList.txt file and add the following content after line 605:
1target_link_libraries(tvm PRIVATE /path/to/BiShengCompiler/BiShengCompiler-3.2.0.1-aarch64-linux/lib/libtf_xla_runtime.a)
- Build TVM and the related libraries.
1 2 3
cd build cmake -DCMAKE_PREFIX_PATH=/path/to/BiShengCompiler/BiShengCompiler-3.2.0.1-aarch64-linux .. make