Obtaining the Source Code and Its Patch
Obtain the TVM source code file from the TVM official website and the TVM operator optimization patch file from the Gitee repository.
Obtaining the TVM Source Code
- Obtain the TVM source code by following instructions in OS and Software Requirements.
- Copy the source code to the /path/to/TVM directory on the server.
If the server is connected to the Internet, you can run the wget command on the server to download the source package.
1 2
cd /path/to/TVM wget https://github.com/apache/tvm/releases/download/v0.9.0/apache-tvm-src-v0.9.0.tar.gz --no-check-certificate
- Go to the /path/to/TVM directory.
1cd /path/to/TVM
- Decompress the TVM installation package.
1tar -xzvf apache-tvm-src-v0.9.0.tar.gz
Obtaining and Applying the Source Code Patch
- Obtain the patch file of TVM 0.9.0.
- Download the TVM patch file softmax.patch by following instructions in OS and Software Requirements.
- Copy softmax.patch to the /path/to/TVM directory on the server.
- Go to the /path/to/TVM/apache-tvm-src-v0.9.0 directory.
1cd /path/to/TVM/apache-tvm-src-v0.9.0
- Initialize the repository.
1 2 3
git init git add . git commit -m "code init"
- Apply the softmax.patch patch file to the repository.
1git apply ../softmax.patch
- Check whether the two files are modified as shown in the following figure. If yes, the patch is successfully installed.
1git status