install-build
Guides Apache TVM source/PyPI installation, CMake/LLVM builds, import validation, backend probes, and focused test selection.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- install-build
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Guides Apache TVM source/PyPI installation, CMake/LLVM builds, import validation, backend probes, and focused test selection.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/build-and-test.md3.8 KB
- 参考文档references/troubleshooting.md3.1 KB
- 脚本scripts/check_tvm_install.py3.3 KB
- 脚本scripts/README.md279 B
03 SKILL.md 正文
Install and Build TVM
Use this route when the task is to install Apache TVM, configure/build a checkout, validate which libraries Python loads, or choose the smallest native test after a change.
Route
- Decide whether the task needs the PyPI wheel or a source checkout. Use the source path when changing C++/Python code or enabling custom backends.
- Read
references/build-and-test.mdfor the build matrix and focused commands. - Build with CMake/Ninja and a supported LLVM toolchain. Keep
python/onPYTHONPATH; do not use editable TVM/tvm-ffi installs for multi-checkout development. - Run
scripts/check_tvm_install.pybefore broader tests. It reports version, loaded libraries,libinfo(), and backend readiness without changing the checkout. - Read
references/troubleshooting.mdfor stale imports, missingtvm-ffi, LLVM/linker failures, or optional extras.
Minimal source workflow
# From a TVM checkout with submodules initialized.
git submodule update --init --recursive
mkdir -p build
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DTVM_BUILD_PYTHON_MODULE=ON \
-DUSE_LLVM="llvm-config --ignore-libllvm --link-static" \
-DUSE_RPC=ON -DUSE_CUDA=OFF
cmake --build build --parallel
export PYTHONPATH="$PWD/python${PYTHONPATH:+:$PYTHONPATH}"
export TVM_LIBRARY_PATH="$PWD/build/lib"
python -c 'import tvm; print(tvm.__version__); print(tvm.support.libinfo())'
Adjust USE_CUDA, USE_ROCM, USE_VULKAN, USE_METAL, or optional library
flags only after the matching toolkit, headers, driver, and runtime have been
verified. A successful CMake build does not prove a device backend works.
Boundaries
- Relax module compilation:
../relax-compile/SKILL.md. - TIRx authoring and GPU-specific tests:
../tirx-kernels/SKILL.md. - S-TIR/meta-schedule:
../s-tir-tuning/SKILL.md. - RPC service lifecycle and remote execution:
../rpc-deployment/SKILL.md.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).