前言
在看一个开源的项目,之前必须要先了解其代码库的组织结构以及每部分的功能作用。
tvm根目录
首先在TVM的的根目录下,有以下几个子目录,它们一起构成了大量的代码库。
-
Src:C++ code for operator compilation and deployment runtimes.
用于运算符编译和部署运行时的C++代码。 -
src/relay:Implementation of Relay, a new IR for deep learning framework superseding nnvm below.
Relay的实现,一种用于深度学习框架的新的IR(中间表示),它取代了下面的nnvm。我之后对tvm的讲解以及修改都是基于relay。 -
python:Python frontend that wraps C++ functions and objects implemented in src.
Python前端,它封装了在src中实现的c++函数和对象。 -
topi:Compute definitions and backend schedules for standard neural network operators.
标准神经网络operators的计算定义和后端调度。 -
nnvm:C++ code and Python frontend for graph optimization and compilation. After the introduction of Relay, it remains in the codebase for backward compatibility.
用于图形优化和编译的C++代码和Python前端。在引入Relay之后,为了向后兼容,它仍然保留在代码库中。 -
include:Header files in include are public APIs that share across modules.
include中的头文件是是跨模块共享的公共API。