English | 中文版
Apache TVM is one of the earliest and most successful AI compiler,it can take models from popular deep learning frameworks like pytorch and optimize them for diverse hardware. The TVM community is also highly active and well-documented.
This project(mcTVM) is based on TVM v0.18.0 release, and supports MetaX GPU.
Dependencies:
- MetaX MACA(MetaX Advanced Compute Architecture) programming environment,follow the 《曦云系列_通用计算GPU_快速上手指南》 from MetaX developer community
- Other requirements refer to TVM Documents
git clone https://github.com/MetaX-MACA/mcTVM.git mcTVM
cd mcTVM
git submodule update --init --recursive
rm -rf build && mkdir build && cd build
cp ../cmake/config.cmake ./
# USE_MACA is ON by default
cmake ../ && make -j $(nproc)
export TVM_HOME=/path-to-mcTVM
export PYTHONPATH=$TVM_HOME/python:$PYTHONPATH
import tvm
# define maca target by kind name
target = tvm.target.Target("maca")
# or specific target by tag name
target = tvm.target.Target("metax/mxc-c500")
# define maca device
dev = tvm.maca()
# or
dev = tvm.device("maca")
check out the CONTRIBUTING.md