Skip to content

Commit 0034b07

Browse files
committed
[DOCS] Refine optional install guidance
1 parent 68429af commit 0034b07

3 files changed

Lines changed: 18 additions & 21 deletions

File tree

docs/how_to/tutorials/bring_your_own_codegen.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ def main(
193193
# into the engine it builds, so bind the parameters before partitioning.
194194
# - **Real values.** TensorRT actually computes, so we build for CUDA, run on
195195
# the GPU, and cross-check against a plain CPU build -- not just the shape.
196+
#
197+
# The build-and-run cells below execute only when TensorRT and CUDA are
198+
# available. In CPU-only documentation builds, they produce no output.
196199

197200
trt_mod = relax.transform.BindParams("main", {"weight": weight_np})(ConvReLU)
198201
trt_mod = partition_for_tensorrt(trt_mod)
@@ -218,8 +221,6 @@ def main(
218221

219222
np.testing.assert_allclose(trt_out, cpu_out, rtol=1e-2, atol=1e-2)
220223
print("TensorRT output shape:", trt_out.shape, "- matches the CPU reference.")
221-
else:
222-
print("TensorRT/CUDA unavailable; skipping the GPU build and run.")
223224

224225
######################################################################
225226
# A real backend also exposes knobs the stub does not. Setting ``use_fp16``
@@ -244,8 +245,6 @@ def main(
244245

245246
np.testing.assert_allclose(fp16_out, cpu_out, rtol=5e-2, atol=5e-2)
246247
print("TensorRT FP16 output shape:", fp16_out.shape, "- matches within FP16 tolerance.")
247-
else:
248-
print("TensorRT/CUDA unavailable; skipping the FP16 build.")
249248

250249
######################################################################
251250
# Example NPU vs TensorRT at a glance
@@ -322,8 +321,6 @@ def forward(self, x):
322321

323322
np.testing.assert_allclose(deployed, torch_ref, rtol=1e-2, atol=1e-2)
324323
print("Deployed PyTorch model on TensorRT; output", deployed.shape, "matches PyTorch.")
325-
else:
326-
print("PyTorch / TensorRT / CUDA unavailable; skipping the deployment example.")
327324

328325
######################################################################
329326
# Real deployment builds once and reuses the artifact. Export the compiled
@@ -340,8 +337,6 @@ def forward(self, x):
340337
)[0].numpy()
341338
np.testing.assert_allclose(reran, torch_ref, rtol=1e-2, atol=1e-2)
342339
print("Reloaded the exported library and reran; output", reran.shape, "still matches.")
343-
else:
344-
print("PyTorch / TensorRT / CUDA unavailable; skipping the export/reload step.")
345340

346341
######################################################################
347342
# Notes for real deployments

docs/install/pypi.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@ TVM wheel from PyPI:
3030
This installs the Python package, including modules such as ``tvm.tirx``, and
3131
is suitable for trying tutorials that do not require a custom build.
3232

33+
CUDA environments
34+
-----------------
35+
36+
Some CUDA workflows use NVIDIA's Python CUDA bindings for runtime compilation.
37+
Install the CUDA extra in the same environment as TVM when you need this path:
38+
39+
.. code-block:: bash
40+
41+
pip install "apache-tvm[cuda]"
42+
43+
This extra installs Python-side CUDA bindings only. It does not make the PyPI
44+
wheel a CUDA-enabled TVM build, and it does not install NVIDIA drivers or a CUDA
45+
toolkit. If you need CUDA support in TVM itself, build TVM from source with
46+
``USE_CUDA=ON``.
47+
3348
For more details on installing the TIRx compiler and optional kernel library,
3449
visit the :doc:`TIRx installation </tirx/install>` page. If you need to
3550
customize TVM's build configuration, visit the

docs/tirx/install.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,3 @@ kernel):
8585
* - ``flashinfer``
8686
- ``nvfp4_gemm``
8787
- optional — quantization and the baseline
88-
89-
Build from source
90-
-----------------
91-
92-
To develop TIRx or build the docs, build TVM from source and make it importable.
93-
See :doc:`/install/from_source` for the full instructions; in short:
94-
95-
.. code-block:: bash
96-
97-
export TVM_HOME=/path/to/tvm
98-
export TVM_LIBRARY_PATH=$TVM_HOME/build
99-
export PYTHONPATH=$TVM_HOME/python:$PYTHONPATH
100-
python -c "import tvm, tvm.tirx; print(tvm.__file__)"

0 commit comments

Comments
 (0)