You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "tlopex (via GitHub)" <gi...@apache.org> on 2026/04/13 00:17:52 UTC
[PR] [Docs] Clean up architecture docs: remove duplicates, fix stale content [tvm]
tlopex opened a new pull request, #19399:
URL: https://github.com/apache/tvm/pull/19399
- Remove duplicate `tvm/s_tir/meta_schedule` and `tvm/s_tir/dlight` sections from `arch/index.rst` (already covered in the `tvm/s_tir` section with cross-reference to TensorIR Deep Dive)
- Remove duplicate `device_target_interactions` toctree entry (was listed under both `tvm/runtime` and `tvm/target`; keep only under `tvm/target`)
- Remove duplicate CUDA pipeline listing in `arch/fusion.rst` "How Backends Use Fusion" section (already shown in Overview); add cross-reference to BYOC doc
- Remove duplicated intro sentences in `arch/relax_vm.rst` that were identical to `arch/index.rst`
- Fix `R.call_dps` → `R.call_dps_packed` (the former does not exist)
- Replace outdated GraphExecutor example (`set_input`/`run`/`get_output`) with Relax VM example (GraphExecutor has been removed from the codebase)
- Replace broken external `mlc.ai` image link (returns 404) with local image in `deep_dive/relax/learning.rst`
- Fix stale `use pass instrument` link in `arch/pass_infra.rst` that pointed to an unrelated page
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] [Docs] Clean up architecture docs: remove duplicates, fix stale content [tvm]
Posted by "MasterJH5574 (via GitHub)" <gi...@apache.org>.
MasterJH5574 merged PR #19399:
URL: https://github.com/apache/tvm/pull/19399
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] [Docs] Clean up architecture docs: remove duplicates, fix stale content [tvm]
Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on code in PR #19399:
URL: https://github.com/apache/tvm/pull/19399#discussion_r3070391328
##########
docs/arch/pass_infra.rst:
##########
@@ -668,4 +668,3 @@ new ``PassInstrument`` are called.
.. _use pass infra: https://github.com/apache/tvm/blob/main/docs/how_to/tutorials/customize_opt.py
-.. _use pass instrument: https://github.com/apache/tvm/blob/main/docs/how_to/dev/index.rst
Review Comment:

The link target for `python/tvm/ir/instrument.py`_ (used on line 620) is missing. Since the previous link definition `use pass instrument` was removed, a new definition for the updated link text should be added at the bottom of the file to avoid broken documentation links.
```suggestion
.. _python/tvm/ir/instrument.py: https://github.com/apache/tvm/blob/main/python/tvm/ir/instrument.py
```
##########
docs/arch/index.rst:
##########
@@ -160,22 +160,19 @@ following types: POD types(int, float), string, runtime.PackedFunc, runtime.Modu
:py:class:`tvm.runtime.Module` and :py:class:`tvm.runtime.PackedFunc` are powerful mechanisms to modularize the runtime. For example, to get the above `addone` function on CUDA, we can use LLVM to generate the host-side code to compute the launching parameters(e.g. size of the thread groups) and then call into another PackedFunc from a CUDAModule that is backed by the CUDA driver API. The same mechanism can be used for OpenCL kernels.
-The above example only deals with a simple `addone` function. The code snippet below gives an example of an end-to-end model execution using the same interface:
+The above example only deals with a simple `addone` function. The code snippet below gives an example of an end-to-end model execution using the Relax Virtual Machine, which is built on the same runtime.Module and runtime.PackedFunc interface:
.. code-block:: python
import tvm
- # Example runtime execution program in python, with types annotated
- factory: tvm.runtime.Module = tvm.runtime.load_module("resnet18.so")
- # Create a stateful graph execution module for resnet18 on cuda(0)
- gmod: tvm.runtime.Module = factory["resnet18"](tvm.cuda(0))
+ from tvm import relax
+ # Load the compiled artifact
+ mod: tvm.runtime.Module = tvm.runtime.load_module("resnet18.so")
+ # Create a VM instance on cuda(0)
+ vm = relax.VirtualMachine(mod, tvm.cuda(0))
data: tvm.runtime.Tensor = get_input_data()
- # set input
- gmod["set_input"](0, data)
- # execute the model
- gmod["run"]()
- # get the output
- result = gmod["get_output"](0).numpy()
+ # Run the model — vm["main"] returns a PackedFunc
+ result = vm["main"](data)
Review Comment:

For consistency with the previous example in this file (line 153) and to provide a more complete end-to-end example, consider adding `.numpy()` to the result. This ensures the output is converted to a standard format that users can easily inspect or use with other Python libraries.
```suggestion
result = vm["main"](data).numpy()
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org