Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
98803e1
Update 01-end-to-end-optimize-model.md
GraceXiii Sep 30, 2025
c0da464
Update 01-overview.md
LxinJ05 Sep 30, 2025
fb3898e
Update 01-overview.md
LxinJ05 Oct 15, 2025
0308333
Fix formatting of tensor program optimization bullet
LxinJ05 Oct 16, 2025
9c6c2fe
Update 01-TVM-Community-community.md
kqyang-77 Oct 16, 2025
9d7f195
Update 01-TVM-Community-community.md
kqyang-77 Oct 16, 2025
e6f301f
Update 010-error_handling-guide.md
kqyang-77 Oct 16, 2025
24a48e9
Update 02-Submit_a_pull_request.md
kqyang-77 Oct 16, 2025
4a029c9
Update 03-code_review.md
kqyang-77 Oct 16, 2025
c70e787
Update 03-code_review.md
kqyang-77 Oct 16, 2025
ef78ef7
Update 03-code_review.md
kqyang-77 Oct 16, 2025
fd24491
Update 04-committer_guide.md
kqyang-77 Oct 16, 2025
ad1ce4c
Update 05-documentation.md
kqyang-77 Oct 16, 2025
e1bd3eb
Update 06-code_guide_and_Tips.md
kqyang-77 Oct 16, 2025
d835eb0
Update 07-Git_Usage_Tips.md
kqyang-77 Oct 16, 2025
59bef42
Update 08-Using_TVM's_Ci.md
kqyang-77 Oct 16, 2025
e97c4d5
Update 09-Release_Process.md
kqyang-77 Oct 16, 2025
fd1bec7
Update index.md
kqyang-77 Oct 16, 2025
01f8213
Update index.md
kqyang-77 Oct 16, 2025
dc89b69
Update index.md
kqyang-77 Oct 16, 2025
7855883
Update contribute_idx.md
kqyang-77 Oct 16, 2025
57d667d
Update contribute_idx.md
kqyang-77 Oct 16, 2025
3fbfd88
Update 16-tvm-relax-transform.md
kqyang-77 Oct 20, 2025
670c62a
Update 01-tvm-error.md
kqyang-77 Oct 20, 2025
7a66519
Update 02-tvm-ir.md
kqyang-77 Oct 20, 2025
b9915cc
Update 03-tvm-instrument.md
kqyang-77 Oct 20, 2025
d671929
Update 04-tvm-transform.md
kqyang-77 Oct 20, 2025
c9f1c2b
Update 05-tvm-target.md
kqyang-77 Oct 20, 2025
691c99a
Update 06-tvm-driver.md
kqyang-77 Oct 20, 2025
a9039f3
Update 07-tvm-runtime.md
kqyang-77 Oct 20, 2025
f79b99f
Update 08-tvm-runtime-vm.md
kqyang-77 Oct 20, 2025
9f0182c
Update 08-tvm-runtime-vm.md
kqyang-77 Oct 20, 2025
a9e6507
Update 08-tvm-runtime-vm.md
kqyang-77 Oct 20, 2025
d035412
Update 09-tvm-runtime-disco.md
kqyang-77 Oct 20, 2025
0bd47fd
Update 10-tvm-runtime-profiling.md
kqyang-77 Oct 20, 2025
55ee5f5
Update index.md
LxinJ05 Oct 20, 2025
18e11cf
Update 11-tvm-relax.md
kqyang-77 Oct 20, 2025
f2beae4
Update 01-install-from-source.md
LxinJ05 Oct 20, 2025
72ca2b5
Update 11-tvm-relax.md
kqyang-77 Oct 21, 2025
cc24d0b
Update 11-tvm-relax.md
kqyang-77 Oct 21, 2025
210119c
Update 02-tvm-ir.md
kqyang-77 Oct 21, 2025
e96b603
Update 02-tvm-ir.md
kqyang-77 Oct 21, 2025
274dd7b
Update 03-tvm-instrument.md
kqyang-77 Oct 21, 2025
ed14add
Update 05-tvm-target.md
kqyang-77 Oct 21, 2025
fe44d95
Update 09-tvm-runtime-disco.md
kqyang-77 Oct 21, 2025
4a0877c
Update 12-tvm-relax-analysis.md
kqyang-77 Oct 21, 2025
a9abbb7
Update 13-tvm-relax_block_builder.md
kqyang-77 Oct 21, 2025
e747e97
Update 14-tvm-relax-frontend.md
kqyang-77 Oct 21, 2025
ae10294
Update 15-tvm-relax-op.md
kqyang-77 Oct 21, 2025
451fe10
Update 16-tvm-relax-transform.md
kqyang-77 Oct 21, 2025
0a758b9
Update 17-tvm-tir.md
kqyang-77 Oct 21, 2025
be9a8c7
Update 18-tvm-tir-analysis.md
kqyang-77 Oct 22, 2025
102a36c
Update 20-tvm-tir-stmt_functor.md
kqyang-77 Oct 22, 2025
bf48075
Update 19-tvm-tir-schedule.md
kqyang-77 Oct 22, 2025
70927a6
Update 21-tvm-tir-transform.md
kqyang-77 Oct 22, 2025
4c17704
Update 21-tvm-tir-transform.md
kqyang-77 Oct 22, 2025
60d076d
Update index.md
kqyang-77 Oct 22, 2025
fca2c8e
Update 22-tvm-te.md
kqyang-77 Oct 22, 2025
3e6b812
Update 25-tvm-dlight.md
kqyang-77 Oct 22, 2025
d7a9dc4
Update 26-tvm-rpc.md
kqyang-77 Oct 22, 2025
899c152
Update 27-tvm-contrib.md
kqyang-77 Oct 22, 2025
54ef306
Update 24-tvm-meta_schedule.md
kqyang-77 Oct 22, 2025
6b6f683
Update 23-tvm-topi.md
kqyang-77 Oct 22, 2025
909262a
Update 12-tvm-relax-analysis.md
kqyang-77 Oct 22, 2025
3b84af1
Update 13-tvm-relax_block_builder.md
kqyang-77 Oct 22, 2025
8c8b6ac
Update index.md
LxinJ05 Oct 23, 2025
9cd4a53
Update 02-tvm-ir.md
kqyang-77 Oct 23, 2025
c7b8ce4
Update 02-tvm-ir.md
kqyang-77 Oct 23, 2025
481260a
Update 02-tvm-ir.md
kqyang-77 Oct 23, 2025
451f2c8
Update index.md
LxinJ05 Oct 23, 2025
ecef953
Update index.md
LxinJ05 Oct 23, 2025
19c2307
Update 01-end-to-end-optimize-model.md
LxinJ05 Oct 23, 2025
04d87e5
Update 02-customize-optimization.md
LxinJ05 Oct 23, 2025
cb735ea
Update 02-customize-optimization.md
LxinJ05 Oct 23, 2025
9972da3
Update 03-optimize-large-language-model.md
LxinJ05 Oct 23, 2025
5f3920d
Update 04-cross-compilation-and-rpc.md
LxinJ05 Oct 23, 2025
fb91c3f
Update index.md
LxinJ05 Oct 23, 2025
70258df
Update 01-python-target-parametrization.md
LxinJ05 Oct 23, 2025
4ffe6a0
Update 02-setup_rpc_system.md
LxinJ05 Oct 23, 2025
ed64a1d
Update 01-design-and-architecture.md
LxinJ05 Oct 23, 2025
affbf64
Update index.md
LxinJ05 Oct 23, 2025
9b607fe
Update 03-tir_creation.md
LxinJ05 Oct 23, 2025
01a06aa
Update 04-tir_transformation.md
LxinJ05 Oct 23, 2025
fc1a3e2
Update index.md
LxinJ05 Oct 23, 2025
f7139ce
Update 02-understand-relax-abstraction.md
LxinJ05 Oct 24, 2025
137b122
Update 03-relax-creation.md
LxinJ05 Oct 24, 2025
ec8a096
Clean up formatting in transformation.md
LxinJ05 Oct 24, 2025
0bf6754
Update 04-transformation.md
LxinJ05 Oct 24, 2025
b6c60c5
Update 04-transformation.md
LxinJ05 Oct 24, 2025
e5d1da7
Merge pull request #2 from LxinJ05/LxinJ05-patch-2
LxinJ05 Oct 24, 2025
23735ef
Delete docs/contribute_idx.md
kqyang-77 Oct 27, 2025
6e20ef3
Merge pull request #1 from kqyang-77/master
LxinJ05 Oct 27, 2025
d9553e4
Add files via upload
kqyang-77 Oct 29, 2025
0dae98d
Merge pull request #4 from kqyang-77/master
kqyang-77 Oct 30, 2025
6ce0eac
Update vulkan.md
LxinJ05 Oct 31, 2025
a4fcccc
Update device target interactions document
LxinJ05 Oct 31, 2025
cd7a112
Update and rename 01-design-and-architecture.md to index.md
LxinJ05 Oct 31, 2025
388fb11
Add initial content to 01index.md
LxinJ05 Oct 31, 2025
e59384a
Update and rename docs/03-deep-dive/index.md to docs/03-deep-dive/01-…
LxinJ05 Oct 31, 2025
5e1b3db
Delete docs/03-deep-dive/01-design-and-architecture/01index.md
LxinJ05 Oct 31, 2025
092244b
Delete docs/arch/index.md
LxinJ05 Oct 31, 2025
9e246bf
Update runtime.md
LxinJ05 Oct 31, 2025
f54eef6
Rename docs/arch/runtime.md to docs/03-deep-dive/01-design-and-archit…
LxinJ05 Oct 31, 2025
3bd972a
Update runtime.md
LxinJ05 Oct 31, 2025
b37563b
Rename runtime.md to 01-runtime.md
LxinJ05 Oct 31, 2025
d8ed7d8
Rename docs/arch/runtimes/vulkan.md to docs/03-deep-dive/01-design-an…
LxinJ05 Oct 31, 2025
7e92bfa
Rename docs/03-deep-dive/01-design-and-architecture/01-runtime.md to …
LxinJ05 Oct 31, 2025
7e40576
Rename vulkan.md to 01-vulkan.md
LxinJ05 Oct 31, 2025
a8551d7
Update and rename docs/arch/introduction_to_module_serialization.md t…
LxinJ05 Oct 31, 2025
8c16770
Update and rename docs/arch/device_target_interactions.md to docs/03-…
LxinJ05 Oct 31, 2025
f13f14b
Update 02-introduction_to_module_serialization.md
LxinJ05 Oct 31, 2025
51317f9
Update and rename docs/arch/pass_infra.md to docs/03-deep-dive/01-des…
LxinJ05 Oct 31, 2025
5251f5b
Add device target interactions documentation
LxinJ05 Oct 31, 2025
2ab4c78
Add files via upload
LxinJ05 Oct 31, 2025
897ff51
Update index.md
LxinJ05 Oct 31, 2025
e1a7d78
Update index.md
LxinJ05 Oct 31, 2025
550a02a
Add files via upload
LxinJ05 Oct 31, 2025
1cfaa62
Update index.md
LxinJ05 Oct 31, 2025
864b1fd
Refactor notes in module serialization documentation
LxinJ05 Oct 31, 2025
70de197
Update 02-introduction_to_module_serialization.md
LxinJ05 Oct 31, 2025
659c912
Update 02-introduction_to_module_serialization.md
LxinJ05 Oct 31, 2025
c3123a3
Update docs/05-about/01-contribute/index.md
sparanoid Nov 2, 2025
ad67d62
Update docs/05-about/01-contribute/index.md
sparanoid Nov 2, 2025
18d1688
Update docs/05-about/01-contribute/index.md
sparanoid Nov 2, 2025
0161676
Update docs/05-about/01-contribute/index.md
sparanoid Nov 2, 2025
59fdad0
Update docs/04-api-reference/01-python-api/13-tvm-relax_block_builder.md
sparanoid Nov 2, 2025
51dcfb7
Update docs/04-api-reference/01-python-api/26-tvm-rpc.md
sparanoid Nov 2, 2025
2c16d42
Update docs/05-about/01-contribute/08-Using_TVM's_Ci.md
sparanoid Nov 2, 2025
a346163
Update docs/05-about/01-contribute/08-Using_TVM's_Ci.md
sparanoid Nov 2, 2025
1c5f9a1
Update docs/05-about/01-contribute/06-code_guide_and_Tips.md
sparanoid Nov 2, 2025
8aba5e0
Update docs/05-about/01-contribute/01-TVM-Community-community.md
sparanoid Nov 2, 2025
a6a8abd
Remove https://tvm.hyper.ai prefix from internal links
Nov 3, 2025
d2e3ba4
Update 02-tvm-ir.md
LxinJ05 Nov 3, 2025
07dba79
Update 05-tvm-target.md
LxinJ05 Nov 3, 2025
9a890ac
Update 08-tvm-runtime-vm.md
LxinJ05 Nov 3, 2025
2a101f7
Update 09-tvm-runtime-disco.md
LxinJ05 Nov 3, 2025
2f6e632
Update 11-tvm-relax.md
LxinJ05 Nov 3, 2025
733c88a
Update 12-tvm-relax-analysis.md
LxinJ05 Nov 3, 2025
7e18e14
Update 13-tvm-relax_block_builder.md
LxinJ05 Nov 3, 2025
6a994ae
Update 14-tvm-relax-frontend.md
LxinJ05 Nov 3, 2025
4e99e57
Update 15-tvm-relax-op.md
LxinJ05 Nov 3, 2025
ebd92fb
Update 16-tvm-relax-transform.md
LxinJ05 Nov 3, 2025
9626cd5
Update 17-tvm-tir.md
LxinJ05 Nov 3, 2025
46a3b2b
Update 18-tvm-tir-analysis.md
LxinJ05 Nov 3, 2025
1abd2d9
Update 19-tvm-tir-schedule.md
LxinJ05 Nov 3, 2025
411851c
Update 21-tvm-tir-transform.md
LxinJ05 Nov 3, 2025
bc886d4
Update 22-tvm-te.md
LxinJ05 Nov 3, 2025
22bfec4
Update 23-tvm-topi.md
LxinJ05 Nov 3, 2025
e4a18dd
Update 26-tvm-rpc.md
LxinJ05 Nov 3, 2025
c0c373b
Update 27-tvm-contrib.md
LxinJ05 Nov 3, 2025
e39ecc6
Update index.md
LxinJ05 Nov 4, 2025
550dc2e
Update docs/05-about/01-contribute/02-Submit_a_pull_request.md
LxinJ05 Nov 4, 2025
9c72bae
Update 02-Submit_a_pull_request.md
LxinJ05 Nov 4, 2025
1d0aff0
Update docs/05-about/01-contribute/07-Git_Usage_Tips.md
LxinJ05 Nov 4, 2025
e58d835
Update 08-Using_TVM's_Ci.md
LxinJ05 Nov 4, 2025
35e895f
Update 13-tvm-relax_block_builder.md
LxinJ05 Nov 4, 2025
81df692
Update 12-tvm-relax-analysis.md
LxinJ05 Nov 4, 2025
3b84ded
Update docs/05-about/01-contribute/index.md
LxinJ05 Nov 5, 2025
29cab5b
Update 02-Submit_a_pull_request.md
LxinJ05 Nov 5, 2025
3e16482
Update 08-Using_TVM's_Ci.md
LxinJ05 Nov 5, 2025
0717c84
Update docs/04-api-reference/01-python-api/13-tvm-relax_block_builder.md
LxinJ05 Nov 5, 2025
58b92f1
Update 13-tvm-relax_block_builder.md
LxinJ05 Nov 5, 2025
74497a0
Update 02-Submit_a_pull_request.md
LxinJ05 Nov 6, 2025
dd86b8b
Update 13-tvm-relax_block_builder.md
LxinJ05 Nov 6, 2025
d77c8d7
Update 13-tvm-relax_block_builder.md
LxinJ05 Nov 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/01-getting-started/01-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Apache TVM 是一个机器学习编译框架,**遵循Python 优先开发和通

## 核心目标
* 优化机器学习任务的性能,组合使用库与代码生成器。
* 部署机器学习任务至多种全新环境,包括新的运行时和新硬件。
* 部署机器学习任务至多种全新环境,包括新的运行时和新硬件。
* 持续改进与定制机器学习部署流程,可通过 Python 快速定制库调度,引入定制算子与代码生成方式。


## 关键流程

以下是使用 TVM 部署机器学习模型的典型流程。可运行示例请参见 [快速开始](https://tvm.apache.org/docs/get_started/tutorials/quick_start.html#quick-start)。
以下是使用 TVM 部署机器学习模型的典型流程。可运行示例请参见 [快速开始](/docs/getting-started/quick-start/)。


1. **导入 / 构建一个机器学习模型**
Expand All @@ -31,7 +31,7 @@ TVM 支持从多种框架导入模型用于通用机器学习模型,如 PyTorc

pipeline 封装了一系列转换,以实现两个目标:
* **图优化:** 如算子融合、布局重写等。
* **张量程序优化:** 将算子映射到底层实现(包括库或代码生成器)。
* **张量程序优化:** 将算子映射到底层实现(包括库或代码生成器)。


:::note
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ title: 从源码安装


**目录**
* [步骤 1:安装依赖项](https://tvm.apache.org/docs/install/from_source.html#step-1-install-dependencies)
* [步骤 2:从 GitHub 获取源码](https://tvm.apache.org/docs/install/from_source.html#step-2-get-source-from-github)
* [步骤 3:配置与构建](https://tvm.apache.org/docs/install/from_source.html#step-3-configure-and-build)
* [步骤 4:验证安装](https://tvm.apache.org/docs/install/from_source.html#step-4-validate-installation)
* [步骤 5:额外 Python 依赖项](https://tvm.apache.org/docs/install/from_source.html#step-5-extra-python-dependencies)
* [高级构建配置](https://tvm.apache.org/docs/install/from_source.html#advanced-build-configuration)
* [Ccache](https://tvm.apache.org/docs/install/from_source.html#ccache)
* [在 Windows 上构建](https://tvm.apache.org/docs/install/from_source.html#building-on-windows)
* [构建 ROCm 支持](https://tvm.apache.org/docs/install/from_source.html#building-rocm-support)
* [启用 C++ 测试](https://tvm.apache.org/docs/install/from_source.html#enable-c-tests)
* [步骤 1:安装依赖项](/docs/getting-started/installing-tvm/install-from-source#%E6%AD%A5%E9%AA%A4-1%E5%AE%89%E8%A3%85%E4%BE%9D%E8%B5%96%E9%A1%B9)
* [步骤 2:从 GitHub 获取源码](/docs/getting-started/installing-tvm/install-from-source#%E6%AD%A5%E9%AA%A4-2%E4%BB%8E-github-%E8%8E%B7%E5%8F%96%E6%BA%90%E7%A0%81)
* [步骤 3:配置与构建](/docs/getting-started/installing-tvm/install-from-source#%E6%AD%A5%E9%AA%A4-3%E9%85%8D%E7%BD%AE%E4%B8%8E%E6%9E%84%E5%BB%BA)
* [步骤 4:验证安装](/docs/getting-started/installing-tvm/install-from-source#%E6%AD%A5%E9%AA%A4-4%E9%AA%8C%E8%AF%81%E5%AE%89%E8%A3%85)
* [步骤 5:额外 Python 依赖项](/docs/getting-started/installing-tvm/install-from-source#%E6%AD%A5%E9%AA%A4-5-%E9%A2%9D%E5%A4%96-python-%E4%BE%9D%E8%B5%96%E9%A1%B9)
* [高级构建配置](/docs/getting-started/installing-tvm/install-from-source#%E9%AB%98%E7%BA%A7%E6%9E%84%E5%BB%BA%E9%85%8D%E7%BD%AE)
* [Ccache](/docs/getting-started/installing-tvm/install-from-source#ccache)
* [在 Windows 上构建](/docs/getting-started/installing-tvm/install-from-source#%E5%9C%A8-windows-%E4%B8%8A%E6%9E%84%E5%BB%BA)
* [构建 ROCm 支持](/docs/getting-started/installing-tvm/install-from-source#%E6%9E%84%E5%BB%BA-rocm-%E6%94%AF%E6%8C%81)
* [启用 C++ 测试](/docs/getting-started/installing-tvm/install-from-source#%E5%90%AF%E7%94%A8-c-%E6%B5%8B%E8%AF%95)


## [步骤 1:安装依赖项](https://tvm.apache.org/docs/install/from_source.html#id2)
## 步骤 1:安装依赖项

Apache TVM 需要以下依赖项:
* CMake (>= 3.24.0)
Expand Down Expand Up @@ -62,7 +62,7 @@ conda activate tvm-build-venv
```


## [步骤 2:从 GitHub 获取源码](https://tvm.apache.org/docs/install/from_source.html#id3)
## 步骤 2:从 GitHub 获取源码

你也可以选择从 GitHub 克隆源码仓库:

Expand All @@ -80,7 +80,7 @@ git clone --recursive https://github.com/apache/tvm tvm
:::


## [步骤 3:配置与构建](https://tvm.apache.org/docs/install/from_source.html#id4)
## 步骤 3:配置与构建

创建一个构建目录并运行 CMake 进行配置。以下示例展示了如何构建:

Expand Down Expand Up @@ -162,7 +162,7 @@ pip install -e /path-to-tvm/python
```


## [步骤 4:验证安装](https://tvm.apache.org/docs/install/from_source.html#id5)
## 步骤 4:验证安装


由于 TVM 是一个支持多语言绑定的编译器基础设施,安装过程中容易出错。因此,强烈建议在使用前验证安装。
Expand Down Expand Up @@ -225,7 +225,7 @@ False # or True
请注意,上述命令验证的是本地机器上实际设备的存在情况,供 TVM 运行时(而非编译器)正确执行。然而,TVM 编译器可以在不需要物理设备的情况下执行编译任务。只要具备必要的工具链(如 NVCC),TVM 就支持在没有实际设备的情况下进行交叉编译。


## [步骤 5. 额外 Python 依赖项](https://tvm.apache.org/docs/install/from_source.html#id6)
## 步骤 5. 额外 Python 依赖项

从源代码构建不会自动安装所有必要的 Python 依赖项。可以使用以下命令安装额外的 Python 依赖项:
* 必要依赖项:
Expand All @@ -243,9 +243,9 @@ pip3 install tornado
```plain
pip3 install tornado psutil 'xgboost>=1.1.0' cloudpickle
```
## [高级构建配置](https://tvm.apache.org/docs/install/from_source.html#id7)
## 高级构建配置

### [Ccache](https://tvm.apache.org/docs/install/from_source.html#id8)
### Ccache


在支持的平台上,[Ccache 编译器包装器](https://ccache.dev/) 可以显著减少 TVM 的构建时间(尤其是构建 [cutlass](https://github.com/NVIDIA/cutlass) 或 [flashinfer](https://github.com/flashinfer-ai/flashinfer) 时)。启用 Ccache 的方式如下:
Expand All @@ -255,12 +255,12 @@ pip3 install tornado psutil 'xgboost>=1.1.0' cloudpickle
* 将 Ccache 作为 CMake 的 C++ 编译器前缀。配置时设置 `CMAKE_CXX_COMPILER_LAUNCHER`,例如:`cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ...`。


### [在 Windows 上构建](https://tvm.apache.org/docs/install/from_source.html#id9)
### 在 Windows 上构建


TVM 支持通过 MSVC 和 CMake 在 Windows 上构建。你需要安装 Visual Studio 编译器(最低要求:**Visual Studio Enterprise 2019**)。我们测试了 [GitHub Actions 的 Windows 2019 Runner](https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md) 的配置,可访问该页面获取全部细节。

推荐按照 [步骤 1:安装依赖项](https://tvm.apache.org/docs/install/from_source.html#install-dependencies) 获取依赖项并激活 tvm-build 环境后,运行以下命令构建:
推荐按照 [步骤 1:安装依赖项](/docs/getting-started/installing-tvm/install-from-source#%E6%AD%A5%E9%AA%A4-1%E5%AE%89%E8%A3%85%E4%BE%9D%E8%B5%96%E9%A1%B9) 获取依赖项并激活 tvm-build 环境后,运行以下命令构建:

```plain
mkdir build
Expand All @@ -277,14 +277,14 @@ cmake --build build --config Release -- /m
```


### [构建 ROCm 支持](https://tvm.apache.org/docs/install/from_source.html#id10)
### 构建 ROCm 支持

目前,ROCm 仅支持 Linux 平台。以下是配置步骤:
* 设置 `set(USE_ROCM ON)`,并将 ROCM_PATH 设置为正确的路径。
* 安装 ROCm 的 HIP 运行时,确保系统已正确安装 ROCm。
* 安装最新稳定版的 LLVM(如 v6.0.1)和 LLD,确保 `ld.lld` 可通过命令行调用。

### [启用 C++ 测试](https://tvm.apache.org/docs/install/from_source.html#id11)
### 启用 C++ 测试

TVM 使用 [Google Test](https://github.com/google/googletest) 驱动 C++ 测试,最简单的安装方式是从源码构建:

Expand Down
8 changes: 4 additions & 4 deletions docs/01-getting-started/02-installing-tvm/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ title: 安装 TVM

---

* [从源码安装](https://tvm.apache.org/docs/install/from_source.html)
* [Docker 镜像](https://tvm.apache.org/docs/install/docker.html)
* [从源码安装](/docs/getting-started/installing-tvm/install-from-source)
* [Docker 镜像](/docs/getting-started/installing-tvm/docker-images)


访问 [从源码安装 TVM](https://tvm.apache.org/docs/install/from_source.html#install-from-source) 页面,以从源代码安装 TVM。从源码安装可以让你最大程度地灵活配置构建选项,并确保使用官方发布的源代码。如果你希望在移动设备或嵌入式设备上部署 TVM,你不需要在设备上安装完整的 TVM 框架,而只需安装运行时环境即可。
访问 [从源码安装](/docs/getting-started/installing-tvm/install-from-source) 页面,以从源代码安装 TVM。从源码安装可以让你最大程度地灵活配置构建选项,并确保使用官方发布的源代码。如果你希望在移动设备或嵌入式设备上部署 TVM,你不需要在设备上安装完整的 TVM 框架,而只需安装运行时环境即可。


如果你想快速体验 TVM 或运行一些示例和教程,可以 [通过 Docker 安装](https://tvm.apache.org/docs/install/docker.html#docker-images)。你也可以通过 `pip` 在本地安装 TVM。
如果你想快速体验 TVM 或运行一些示例和教程,可以 [通过 Docker 安装](/docs/getting-started/installing-tvm/docker-images)。你也可以通过 `pip` 在本地安装 TVM。


```plain
Expand Down
17 changes: 9 additions & 8 deletions docs/01-getting-started/03-quick-start/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: 快速入门

:::note

本教程可通过 Google Colab 交互运行!也可点击[此处](https://tvm.apache.org/docs/get_started/tutorials/quick_start.html#sphx-glr-download-get-started-tutorials-quick-start-py)在本地运行 Jupyter Notebook。
本教程可通过 Google Colab 交互运行!也可点击[此处](/docs/getting-started/quick-start/#%E5%90%8E%E7%BB%AD%E9%98%85%E8%AF%BB)在本地运行 Jupyter Notebook。

[在 Google Colab 中打开](https://colab.research.google.com/github/apache/tvm-site/blob/asf-site/docs/_downloads/eceb05a9badb601d2def02240aa869e9/quick_start.ipynb)

Expand All @@ -19,12 +19,12 @@ title: 快速入门


**目录**
* [概览](https://tvm.apache.org/docs/get_started/tutorials/quick_start.html#overview)
* [完整流程](https://tvm.apache.org/docs/get_started/tutorials/quick_start.html#overall-flow)
* [构建或导入模型](https://tvm.apache.org/docs/get_started/tutorials/quick_start.html#construct-or-import-a-model)
* [执行优化转换](https://tvm.apache.org/docs/get_started/tutorials/quick_start.html#perform-optimization-transformations)
* [构建和通用部署](https://tvm.apache.org/docs/get_started/tutorials/quick_start.html#build-and-universal-deployment)
* [阅读下文](https://tvm.apache.org/docs/get_started/tutorials/quick_start.html#read-next)
* [概览](/docs/getting-started/quick-start/#%E6%A6%82%E8%BF%B0)
* [完整流程](/docs/getting-started/quick-start/#%E5%AE%8C%E6%95%B4%E6%B5%81%E7%A8%8B)
* [构建或导入模型](/docs/getting-started/quick-start/#%E6%9E%84%E5%BB%BA%E6%88%96%E5%AF%BC%E5%85%A5%E6%A8%A1%E5%9E%8B)
* [执行优化转换](/docs/getting-started/quick-start/#%E6%89%A7%E8%A1%8C%E4%BC%98%E5%8C%96%E8%BD%AC%E6%8D%A2)
* [构建和通用部署](/docs/getting-started/quick-start/#%E6%9E%84%E5%BB%BA%E5%92%8C%E9%80%9A%E7%94%A8%E9%83%A8%E7%BD%B2)
* [阅读下文](/docs/getting-started/quick-start/#%E5%90%8E%E7%BB%AD%E9%98%85%E8%AF%BB)


## 概述
Expand Down Expand Up @@ -201,7 +201,8 @@ Tensor out = vm.getFunction("prefill").pushArg(data).pushArg(weight).pushArg(kv_
## 后续阅读


本教程演示了使用 Apache TVM 编译神经网络模型的整体流程。如需了解更高级或具体的主题,请参考以下教程:
本教程演示了使用 Apache TVM 编译神经网络模型的整体流程。如需了解更高级或具体的主题,请参考以下教程(可右键另存为下载)
* [下载 Jupyter notebook: quick_start.ipynb](https://tvm.apache.org/docs/_downloads/eceb05a9badb601d2def02240aa869e9/quick_start.ipynb)
* [下载 Python 源代码: quick_start.py](https://tvm.apache.org/docs/_downloads/baf675793174f2e9b3d5da483e35ef27/quick_start.py)
* [下载压缩包: quick_start.zip](https://tvm.apache.org/docs/_downloads/bb7db6678496193ed0c55d3b95fa6778/quick_start.zip)

31 changes: 17 additions & 14 deletions docs/01-getting-started/04-irmodule/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: IRModule

:::note

本教程可通过 Google Colab 交互式运行!也可点击[此处](https://tvm.apache.org/docs/get_started/tutorials/ir_module.html#sphx-glr-download-get-started-tutorials-ir-module-py)在本地运行 Jupyter Notebook。
本教程可通过 Google Colab 交互式运行!也可点击[此处](/docs/getting-started/irmodule/#%E9%83%A8%E7%BD%B2%E5%88%B0%E5%85%B6%E4%BB%96%E5%90%8E%E7%AB%AF)在本地运行 Jupyter Notebook。

[在 Google Colab 中打开](https://colab.research.google.com/github/apache/tvm-site/blob/asf-site/docs/_downloads/a6d7947451d373bc811080cffa18dc7c/ir_module.ipynb)

Expand All @@ -18,10 +18,10 @@ title: IRModule


**目录**
* [创建 IRModule](https://tvm.apache.org/docs/get_started/tutorials/ir_module.html#create-irmodule)
* [IRModule 的属性](https://tvm.apache.org/docs/get_started/tutorials/ir_module.html#attributes-of-an-irmodule)
* [对 IRModule 进行转换](https://tvm.apache.org/docs/get_started/tutorials/ir_module.html#transformations-on-irmodules)
* [通用部署 IRModule](https://tvm.apache.org/docs/get_started/tutorials/ir_module.html#deploy-the-irmodule-universally)
* [创建 IRModule](/docs/getting-started/irmodule/#%E5%88%9B%E5%BB%BA-irmodule)
* [IRModule 的属性](/docs/getting-started/irmodule/#irmodule-%E7%9A%84%E5%B1%9E%E6%80%A7)
* [对 IRModule 进行转换](/docs/getting-started/irmodule/#%E5%AF%B9-irmodule-%E8%BF%9B%E8%A1%8C%E8%BD%AC%E6%8D%A2)
* [通用部署 IRModule](/docs/getting-started/irmodule/#%E9%80%9A%E7%94%A8%E9%83%A8%E7%BD%B2-irmodule)


```plain
Expand Down Expand Up @@ -194,6 +194,7 @@ class TVMScriptModule:
mod_from_script = TVMScriptModule
mod_from_script.show()


```


Expand Down Expand Up @@ -412,10 +413,10 @@ print(mod.get_global_vars())


接着,Apache TVM Unity 提供了一套默认的转换流水线,以简化转换过程。我们可以将默认的转换流水线应用到模块上。其中默认的 zero 流水线包含以下基本转换步骤:
* **LegalizeOps:**将 Relax 操作转换为 call_tir 调用,配合相应的 TensorIR 函数。此转换会让 IRModule 同时包含 Relax 函数与 TensorIR 函数。
* **AnnotateTIROpPattern:**为 TensorIR 函数打上模式标签,为后续的算子融合做好准备。
* **FoldConstant:**进行常量折叠优化,简化涉及常量的运算。
* **FuseOps 和 FuseTIR:**根据上一阶段 AnnotateTIROpPattern 所打的标签对 Relax 和 TensorIR 函数进行融合优化。
* **LegalizeOps:** 将 Relax 操作转换为 call_tir 调用,配合相应的 TensorIR 函数。此转换会让 IRModule 同时包含 Relax 函数与 TensorIR 函数。
* **AnnotateTIROpPattern:** 为 TensorIR 函数打上模式标签,为后续的算子融合做好准备。
* **FoldConstant:** 进行常量折叠优化,简化涉及常量的运算。
* **FuseOps 和 FuseTIR:** 根据上一阶段 AnnotateTIROpPattern 所打的标签对 Relax 和 TensorIR 函数进行融合优化。


:::note
Expand Down Expand Up @@ -550,8 +551,9 @@ print(cpu_out)
输出:

```plain
[[ 0.13505758 -0.29273182 0.04422678 -0.06554039 0.02372958 0.00591143
-0.11505812 -0.11465105 -0.08466949 0.1232063 ]]
[[ 6.4867303e-02 1.6763064e-01 9.3035400e-05 1.8091209e-01
8.0412276e-02 -1.4292052e-01 -3.2873321e-02 -7.4184828e-02
-6.7507513e-02 1.5245053e-01]]
```


Expand Down Expand Up @@ -593,14 +595,15 @@ assert np.allclose(cpu_out, gpu_out, atol=1e-3)
输出:

```plain
[[ 0.13505754 -0.29273173 0.04422677 -0.06554036 0.02372959 0.00591139
-0.115058 -0.11465096 -0.08466944 0.12320635]]
[[ 6.4867347e-02 1.6763058e-01 9.3113631e-05 1.8091221e-01
8.0412284e-02 -1.4292067e-01 -3.2873336e-02 -7.4184842e-02
-6.7507453e-02 1.5245046e-01]]
```


### 部署到其他后端

Apache TVM Unity 也支持部署到其他后端,包括不同类型的 GPU(如 Metal、ROCm、Vulkan 和 OpenCL)、不同类型的 CPU(如 x86 和 ARM),以及其他新兴平台(例如 WebAssembly)。部署流程与 GPU 后端类似。
Apache TVM Unity 也支持部署到其他后端,包括不同类型的 GPU(如 Metal、ROCm、Vulkan 和 OpenCL)、不同类型的 CPU(如 x86 和 ARM),以及其他新兴平台(例如 WebAssembly)。部署流程与 GPU 后端类似(可右键另存为下载)
* [下载 Jupyter Notebook: ir_module.ipynb](https://tvm.apache.org/docs/_downloads/a6d7947451d373bc811080cffa18dc7c/ir_module.ipynb)
* [下载 Python 源代码: ir_module.py](https://tvm.apache.org/docs/_downloads/0b64717d4cc6027368b96fad40119738/ir_module.py)
* [下载压缩包: ir_module.zip](https://tvm.apache.org/docs/_downloads/11c11e53c7dace51a8be968ee169ed0d/ir_module.zip)
Expand Down
6 changes: 4 additions & 2 deletions docs/02-how-to/01-end-to-end-optimize-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: 端到端优化模型

:::note

本教程可通过 Google Colab 交互式运行!也可点击[此处](https://tvm.apache.org/docs/get_started/tutorials/quick_start.html#sphx-glr-download-get-started-tutorials-quick-start-py)在本地运行 Jupyter Notebook。
本教程可通过 Google Colab 交互式运行!也可点击[此处](/docs/how-to/end-to-end-optimize-model#%E6%9E%84%E5%BB%BA%E4%B8%8E%E9%83%A8%E7%BD%B2)在本地运行 Jupyter Notebook。

[在 Google Colab 中打开](https://colab.research.google.com/github/apache/tvm-site/blob/asf-site/docs/_downloads/317a8cc53139718b9a36a16ba052e44b/e2e_opt_model.ipynb)

Expand Down Expand Up @@ -106,7 +106,7 @@ if not IS_IN_CI:

## 构建与部署

最后,我们构建优化后的模型,并将其部署到目标设备。在 CI 环境中会跳过此步骤。
最后,我们构建优化后的模型,并将其部署到目标设备。在 CI 环境中会跳过此步骤。可右键另存为下载。


```plain
Expand All @@ -126,3 +126,5 @@ if not IS_IN_CI:
* [下载压缩包:e2e_opt_model.zip](https://tvm.apache.org/docs/_downloads/a7dd7652b2ad50f82d7b739ce3645799/e2e_opt_model.zip)




Loading