界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

install-build

install-build

【开发与工程】Guides Apache TVM source/PyPI installation, CMake/LLVM builds, import validation, backend probes, and focused test selection.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: install-build description: "Guides Apache TVM source/PyPI installation, CMake/LLVM builds, import validation, backend probes, and focused test selection." disable-model-invocation: true metadata: disco-role: operating license: Apache 2.0

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

  1. 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.
  2. Read references/build-and-test.md for the build matrix and focused commands.
  3. Build with CMake/Ninja and a supported LLVM toolchain. Keep python/ on PYTHONPATH; do not use editable TVM/tvm-ffi installs for multi-checkout development.
  4. Run scripts/check_tvm_install.py before broader tests. It reports version, loaded libraries, libinfo(), and backend readiness without changing the checkout.
  5. Read references/troubleshooting.md for stale imports, missing tvm-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

我的收藏