48 Commits

Author SHA1 Message Date
Tianqi Chen c717c5b217 [IR][Relax][TIRx] Unify Var identity (#20004) 2026-07-15 17:12:40 +08:00
Tianqi Chen 275114b327 [REFACTOR][IR] Unify PrimExpr with Expr typed view (#19910)
## Summary
- Make `PrimExpr` a typed C++ view over `Expr` values whose
`ExprNode::ty` is `PrimType`, instead of using a separate runtime node
class as the proof of primitive-ness.
- Use the shared `ir::Call` node for Relax, TIRX, and primitive-valued
calls, while keeping primitive-only APIs explicit at their semantic
boundaries.
- Keep Python on the general `Expr` surface for primitive-typed values
so `isinstance` behavior does not imply a nominal primitive-expression
subclass.

## Design Rationale
The main advantage of this change is that common expression nodes such
as `Call` can be unified without specializing each one to `PrimType`. A
single `ir::Call` can represent a Relax tensor call, a Relax scalar
call, or a primitive-valued intrinsic call; the result type stored in
`ExprNode::ty` determines whether that particular value can be viewed as
`PrimExpr`.

This keeps the IR node hierarchy focused on expression structure rather
than result-type categories. Nodes that are intrinsically primitive,
such as integer and floating-point literals or TIRX primitive operators,
still have strongly typed C++ APIs and data structures. General nodes
whose result type may vary, such as `Call`, remain general `Expr` nodes
and are narrowed to `PrimExpr` only where primitive-only semantics are
required.

The PR also keeps the compatibility surface practical: C++
primitive-only APIs continue to accept `PrimExpr`, Python exposes a
compatibility predicate for checking the primitive typed category, and
visitors/printers use one natural `Call` path rather than duplicating
Relax and primitive call handling. Missing expression types are
represented explicitly with `Type::Missing()` so constructors can leave
type inference to later analysis without relying on nullable `Type`
values.
2026-07-01 18:55:33 -04:00
Tianqi Chen 120812e9ac [REFACTOR][Relax] Phase out PrimValue and Relax expression wrappers (#19891)
This PR lets Relax expressions directly take `PrimExpr` values without
requiring the explicit `PrimValue` wrapper, continuing the Relax IR
unification work by removing Relax-specific leaf/base expression layers.

Summary:
- Remove `LeafExpr` / `LeafExprNode` and use direct expression-node
checks where needed.
- Converge Relax expression typing onto the shared IR `Expr` base.
- Remove the `PrimValue` node wrapper while keeping `relax.prim_value` /
`R.prim_value` as conversion helpers that return existing `PrimExpr`
values unchanged.
- Register direct `PrimExpr` handling through exact concrete node
dispatch, aligned with the `tirx` expression visitor list and excluding
arith iter-map intermediate nodes.
- Inline the private Python primitive conversion helper into public
`relax.prim_value`.
- Handle direct `PrimExpr` values in frontend scalar paths without
assuming a `.value` field on non-immediate expressions.
2026-06-26 07:18:04 -04:00
Bohan Hou 15f62fe020 [Docs] Add TIRx documentation section (#19855)
Adds a standalone TIRx documentation section under `docs/tirx/` — the
kernel-level compiler structure (DSL + tile primitives) that ships
inside Apache TVM as `tvm.tirx`.

**Contents**
- Overview, installation, and the storage-first tensor-layout model
(with an embedded interactive layout explorer).
- "Native basics" walkthrough for CUDA C++/PTX-level authoring (threads,
scopes, buffers, sync, compiling).
- Per-dispatch tile-primitive walkthroughs (`copy`, `copy_async`,
`gemm`/`gemm_async`, `reduction`, `elementwise`, `permute_layout`).
- Architecture (lowering pipeline) and the `tvm.tirx` Python API
reference (autodoc).
- Wiring: `docs/index.rst` toctree,
`docs/reference/api/python/index.rst`, `docs/conf.py`, and
`docs/_static/css/tirx_theme.css`.

**Scope:** docs-only — 46 files, all under `docs/`; no source changes.
The autodoc targets (`tvm.tirx`, `tvm.backend.cuda`, ...) already exist
in `main`.
2026-06-21 22:14:48 -04:00
Bohan Hou bb6f8aec55 [TIRx] Post-bringup follow-ups: op-dispatch, namespaces, launch bounds, gemm-async, backend reorg (#19757)
This PR batches several post-bringup TIRx follow-ups, rebased onto
current `main`.

### Changes
- **op-dispatch**: per-call exec scope via `Tx.<scope>.op`; remove
`ExecScopeStmt`
- **namespaces**: split TIRx op namespaces; remove tile-primitive kind
attrs
- **codegen**: support explicit CUDA launch bounds
- **gemm-async**: support contiguous-axis (K-major) operand slicing
- **backend reorg**: move in-tree GPU backends out of core into
`src/backend/<target>/` and `python/tvm/backend/<target>/`
(codegen/runtime/op), with the corresponding `CMakeLists.txt` /
`cmake/modules` and include-path updates

### Testing
- Builds with `USE_CUDA=ON` / `USE_LLVM=ON`
- The TIRx Python test suite (`tests/python/tirx/`) passes locally
2026-06-13 21:12:40 -04:00
Tianqi Chen 4d28424268 [REFACTOR][IR] Phase out diagnostic.h for visit-context-aware pass errors (#19722)
Replace TVM's `Diagnostic` / `DiagnosticContext` machinery with the
tvm-ffi
`visit_error_context` mechanism. Validators throw an `ffi::Error` seeded
with the
offending node; leaf pass executors (`ModulePass` / relax `Function` /
`DataflowBlock`) catch and rethrow `EnrichPassErrorWithContext`, which
appends the
failing pass name and a TVMScript-rendered, underlined source location.

`relax.analysis.well_formed` now throws on the first violation; a new
`check_well_formed` returns a bool, and all C++/Python/test callers are
routed
accordingly. `include/tvm/ir/diagnostic.h` and `src/ir/diagnostic.cc`
are deleted.
The enrichment renders with `num_context_lines=10` so a small function
shows in
full with no skipped-lines marker, while a large module stays bounded.

The TVMScript parser diagnostics
(`python/tvm/script/parser/core/diagnostics.py`)
stay self-contained pure-Python with no `DiagnosticContext` dependency,
and
restore multi-line source rendering: a diagnostic whose offending AST
node spans
multiple source lines now renders every spanned line with its gutter
line number
and an underline covering the span. `tvm.error.DiagnosticError` (used by
the
TVMScript parser) is retained.

A rendered end-to-end enriched-error example is posted as a comment
below.
2026-06-10 20:13:33 -04:00
Tianqi Chen ffea531107 [REFACTOR][PYTHON] Lift compiler/CLI/process modules from tvm.contrib to tvm.support (#19624)
## Summary

Lifts 10 host-toolchain / CLI / process / utility modules from
`python/tvm/contrib/` to a new `python/tvm/support/` package, and
deletes two dead contrib shims.

`tvm.support` is the home for Python helpers that integrate TVM with
external CLIs and host-side tools — compilers, archivers, subprocess
pools, and build-info queries. These are load-bearing internal pieces
that TVM's compile/link/run paths depend on. `tvm.contrib` is reserved
for optional vendor SDK integrations and experimental features. The
distinction is documented in the `tvm.support` package docstring.

Moved (one commit each):

- `tvm.contrib.cc` → `tvm.support.cc`
- `tvm.contrib.nvcc` → `tvm.support.nvcc`
- `tvm.contrib.rocm` → `tvm.support.rocm`
- `tvm.contrib.ndk` → `tvm.support.ndk`
- `tvm.contrib.xcode` → `tvm.support.xcode`
- `tvm.contrib.clang` → `tvm.support.clang`
- `tvm.contrib.emcc` → `tvm.support.emcc`
- `tvm.contrib.popen_pool` → `tvm.support.popen_pool`
- `tvm.contrib.utils` → `tvm.support.utils`
- `tvm.contrib.tar` → `tvm.support.tar`

Deleted:
- `tvm.contrib.spirv` — single `optimize()` wrapping `spirv-opt`; zero
importers.
- `tvm.contrib.rpc` — self-deprecation shim with "removed in 0.5"
banner; honoring it.

Package conversion:
- `python/tvm/support.py` → `python/tvm/support/__init__.py` with
inclusion-rule docstring.
- `libinfo()` extracted into `python/tvm/support/libinfo.py`.
- `FrontendTestModule` dropped (audit confirmed zero callers outside its
own definition).

## Compatibility

Hard break — no `tvm.contrib.<mod>` re-export shims. All callers updated
in this PR.

C++-side FFI registry keys (`tvm.contrib.nvcc.*`, etc.) are unchanged —
only the Python module path moves. Renaming the FFI keys is a separate
follow-up.
2026-05-27 15:31:12 -04:00
Tianqi Chen 4e5b869c27 [REFACTOR][RUNTIME] Phase out profiling.h heavy types, rename to timer.h (#19455) 2026-04-27 20:27:07 -04:00
Shushi Hong ff127c48ea [Docs] Fix stale tvm.tirx exclude list and add missing legalize_ops.unary entry (#19414)
as per title
2026-04-17 08:54:44 -04:00
Shushi Hong e0e93151f2 [Docs] Fix outdated source install and API reference docs (#19409)
as per title
2026-04-16 21:38:12 +09:00
Shushi Hong b80d23f81c [Docs] Add tvm.s_tir.tensor_intrin API reference and remove empty legacy tvm/tir directory (#19386)
as per title
2026-04-11 14:29:34 -04:00
Shushi Hong b6f67b06db [Docs] Add Python API reference for tvm submodule docs (#19379)
as per title
2026-04-10 14:52:49 -04:00
Shushi Hong 726edbf54b [Docs] Complete API reference for tvm.relax backend and testing modules (#19378)
as per title
2026-04-10 00:30:26 -04:00
Shushi Hong 7dcdb56273 [Docs] Add API reference for tvm.s_tir submodules: dlight, meta_schedule, backend (#19369)
Add API reference for tvm.s_tir submodules: dlight, meta_schedule, backend
2026-04-09 13:22:13 -04:00
Shushi Hong 2345e6ea26 [Docs] Add API reference documentation for tvm.script module (#19366)
Add API reference documentation for tvm.script module
2026-04-08 00:58:00 -04:00
Shushi Hong 9ec6a52e21 [Docs] Add Dataflow Pattern Language (DPL) documentation for Relax (#19358)
DPL (`tvm.relax.dpl`) is heavily used across the TVM stack — operator
fusion, CUTLASS/cuBLAS/cuDNN backend dispatch, and user-defined graph
transforms all rely on it. Since there is no doc explaining how to use
it, this pr adds deep-dive documentation
(`docs/deep_dive/relax/dpl.rst`) covering DPL's pattern construction,
matching, rewriting APIs, and integration with `FuseOpsByPattern`
backend dispatch passes.
2026-04-06 14:47:57 -04:00
Shushi Hong 744ef561e4 [Docs] Fix outdated paths, links, and add missing API references across documentation (#19351)
This PR is a follow-up PR of #19344 , continuing cleaning up outdated
items in docs
2026-04-06 12:01:56 -04:00
Shushi Hong 491480d4db [Docs] Add tvm.s_tir.analysis API reference page (#19353)
This PR adds the API reference documentation for `tvm.s_tir.analysis`.
                                                           
`tvm.s_tir.analysis` functions use Var in their type annotations, which
exists in both `tvm.tirx` and `tvm.relax`. The existing disambiguator
uses common module prefix to pick the right one, but `tvm.s_tir` shares
no prefix with either. The new `tvm_module_type_preference` mapping
tells the disambiguator to prefer `tvm.tirx` types for `tvm.s_tir.*`
modules.
2026-04-06 09:51:19 -04:00
Shushi Hong befee5827e [Docs] Fix outdated code examples, typos, and missing API reference in documentation(2) (#19344)
This PR is a follow-up of #18965
- Fix incorrect variable names in Relax dataflow code example (`lv0` →
`lv`, `b` → `n`) in
`docs/deep_dive/relax/learning.rst`
- Fix `func.time_evaluator(func.entry_name, ...)` to
`func.time_evaluator("add_one", ...)`
in `docs/how_to/tutorials/cross_compilation_and_rpc.py`, since
`entry_name` is a class
constant `"main"` but the compiled function is named `"add_one"`
- Fix typo `tvfm.testing` → `tvm.testing` in
`docs/how_to/dev/pytest_target_parametrization.rst`
- Add missing `tvm.relax.frontend.tflite` automodule entry to
`docs/reference/api/python/relax/frontend.rst`
2026-04-04 22:55:19 -04:00
Shushi Hong 66019626a9 [Docs] Fix outdated code examples, types, and missing references across documentation (#18965)
- Fix incorrect function names (`lnumpy_matmul`→`lnumpy_linear`,
`lnumpy_relu`→`lnumpy_relu0`) and undefined variables (`lv0`→`lv`,
`b`→`n`) in Relax learning tutorial
- Add missing `I`, `T`, `R` imports in Relax and TensorIR learning
tutorials
- Update `pass_infra.rst` to match current source: fix `PassInfoNode`
field order and add `traceable`, correct `PassContextNode`
array types (`Expr`→`String`), remove obsolete `StringImm` cast in
`SequentialNode`, and add `traceable` param to `Create*Pass`
signatures                                                      
- Replace stale `PrintIRBefore`/`PrintAfter` TODOs with
already-implemented instruments (`PrintBeforeAll`, `PrintAfterAll`,
`PassPrintingInstrument`, `DumpIR`)
- Add missing `tvm.relax.op.vision` and `tvm.relax.op.vm` to API
reference
- Add `PythonDomain.find_obj` patch to resolve ambiguous
cross-references for classes that exist in multiple TVM namespaces (e.g.
`StringImm` in both `tvm.relax` and `tvm.tirx`). This is a general
solution that reuses the existing `tvm_class_name_rewrite_map` and also
benefits `Var`, `Call`, etc.
2026-04-04 00:56:15 -04:00
Tianqi Chen 141c22fd8a [Refactor] Bring up tirx namespace (#18913)
This PR brings up the tirx namespace. We have been spliting out the
original tir namespace to include high-level component s_tir and this PR
updates the remaining low-level part as tirx namespace
2026-03-19 21:27:54 -07:00
Shushi Hong c9fb8cd3cd [Docs] Clean up stale references from recent refactors (#18908)
This is a follow-up pr of #18906 

- **Removed "Unity" branding**: Replace "Apache TVM Unity" with "Apache
TVM" across all docs (Unity branch has been merged into
  main)
- **Fixed stale Python APIs**: `tvm.instrument` → `tvm.ir.instrument`,
`tvm.transform` → `tvm.ir.transform`, `tvm.module.Module` →
`tvm.runtime.Module`, `tvm.convert` → `tvm.runtime.convert`,
`tvm.runtime.load` → `tvm.runtime.load_module`
- **Fixed S-TIR migration**: `tvm.tir.transform.DefaultGPUSchedule` →
`tvm.s_tir.transform.DefaultGPUSchedule`; added missing
  `s_tir/transform` API doc page
- **Removed references to deleted features**: AutoTVM/AutoScheduler
(removed), FewShotTuning (phased out in #18864), i386 CI
(removed in #18737), VTA (removed), TensorFlow frontend (not in Relax),
MXNet/Gluon (archived)
- **Fixed stale C++ references**: `NodeRef` → `ObjectRef`, `make_node` →
`ffi::make_object`, removed unused `using
tvm::runtime::Registry`, `src/relax/transforms/` →
`src/relax/transform/`
- **Updated CI docs**: Added GitHub Actions lint workflow info to
`ci.rst`
- **Fixed broken links**: dead tutorial links in `pass_infra.rst`,
`gallery/` → `docs/how_to/tutorials/`, `how-to/index.rst` →
  `how_to/dev/index.rst`, `discuss.tvm.ai` → `discuss.tvm.apache.org`
- **Updated overview**: TensorFlow → ONNX in supported framework list,
AutoTVM → RPC in security docs
2026-03-18 13:57:14 -04:00
Tianqi Chen d463395706 [REFACTOR][RUNTIME] Phase out legacy contrib runtime backends (#18813)
This PR removes legacy runtime contrib backends that have no existing
compiler backend,
no active development. They can always be brought back in future in case
we find there is a need
2026-02-23 11:08:03 -05:00
Ruslan Baratov 4d4351dd68 [DOC] Fix various grammar and punctuation issues (#18790)
Fix various grammar and punctuation issues in next files:

- docs/arch/device_target_interactions.rst
- docs/arch/index.rst
- docs/arch/introduction_to_module_serialization.rst
- docs/arch/pass_infra.rst
- docs/contribute/document.rst
- docs/contribute/git_howto.rst
- docs/deep_dive/relax/tutorials/relax_transformation.py
- docs/reference/api/links.rst

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-02-17 10:30:39 -05:00
Tianqi Chen adda179705 [REFACTOR][S-TIR] Lift dlight into s_tir namespace (#18734)
This PR migrates dlight into s_tir namespace, so s_tir related
components are closely grouped together.
2026-02-08 20:20:11 -05:00
Tianqi Chen 2e34d8b04e [REFACTOR][S-TIR] Migrate meta_schedule into s_tir namespace (#18735) 2026-02-08 14:46:37 -05:00
Tianqi Chen d76c729259 [REFACTOR][S-TIR] Initialize the s_tir module (#18712)
This PR initalizes the s_tir for scheduable TensorIR. The change mainly
starts from python side, the we will gradually move towards the c++ side
in followup PRs. The python main change:

tir.Schedule => s_tir.Schedule
2026-02-05 09:40:31 -05:00
Tianqi Chen 877b448b02 [REFACTOR][TIR] Rename tir.Block to SBlock (#18689)
This PR renames tir.Block to SBlock. This clearly indicate the
scheduable property of the block and is a prereq for followup stir
passes refactor.

Main changes:

- Data structure change from Block to SBlock
- Syntax change from T.block to T.sblock
2026-01-28 08:02:10 -05:00
Tianqi Chen 3c36ce2ec6 [FFI][REFACTOR][ABI] Rename NDArray to Tensor (#18275)
This PR Updates the NDArray => Tensor.

Both tensor and ndarray are commonly used terms.

Because the term Tensor is getting more common in the context of ML,
we do the rename to stay more aligned with torch.Tensor and DLTensor.
2025-09-06 14:33:59 -07:00
Tianqi Chen a3ee59253e [FFI][REFACTOR] Phase out getattr based attribute handling (#18189)
[REFACTOR] Phase out getattr based attribute handling

This PR phases out getattar based attribute handling as they are slower
and introduces extra code path.

This does mean that if an Object is not explicitly registered
in python side, we will no longer be able to access the field by name.
Likely this is also desirable as we would like to enable faster use that
updates the python end and do not rely on these behavior.
2025-08-06 15:40:44 -04:00
Ruihang Lai 61e7c8fb63 [Refactor] Rename relax_vm to vm (#18049)
This PR renames the filenames/namespaces of `relax_vm`
to `vm`.

Previously, both VMs of relay and relax exist, and to avoid the
name conflicts, we added the prefix `relax_` to relax VM.
With the Relay runtime being phased out, we can now rename
`relax_vm` to `vm` for conciseness.
2025-06-06 18:54:28 -04:00
Siyuan Feng be8e43814a [Refactor] Migrate build API to tvm.compile (#17718)
* tvm.build -> tvm.compile

* relax.build -> tvm.compile

* update
2025-03-09 07:23:52 -04:00
Bohan Hou fc6775e770 [REFACTOR] move build flow from C++ to Python (#17665)
This PR moves build flow from C++ to python, enables more developer productivity and readabilities
2025-02-20 14:47:06 -05:00
Tianqi Chen c81fccaa2f [REFACTOR] Phase out te.Schedule c++ components (#17662)
* cleanup schedule c++

* remove vitis ai

* remove VERILATOR

* remove aocl and sdaccel

* remove opengl

* remove microdev and antlr

* remove frontends

* fix

* Cleanup relay related legacy components

* fix

---------

Co-authored-by: Siyuan Feng <hzfengsy@sjtu.edu.cn>
2025-02-17 17:03:09 -05:00
Tianqi Chen 9f846bda5b [REFACTOR] Phase out te.schedule python components (#17658)
* [REFACTOR] Phase out te.schedule python components

This PR phases out te.schedule python components.
te.compute is kept around for future usages.
tir.Schedule is a more modern version of the scheduling that we can use onwards.

Doing so also helps us to cleanup the testcases that relies on
explicit full build and execution. As we move future unit testcases
towards structural equality based unit tests.

* Simplify CI to focus on UT

The main rationale is that we should only have very few target
dependent UT in tests/python/codegen and possible
a new category in future for op-level integration if needed.

* Re-enable wasm

* fix lint

* remove hybrid,sparse autodoc and remove tests

---------

Co-authored-by: Siyuan Feng <hzfengsy@sjtu.edu.cn>
2025-02-16 17:13:10 +08:00
Tianqi Chen ccaa534b2c [REFACTOR] Phase out relay python components (#17656)
This PR starts the step 0 to phase out relay from the current
development main branch.  This PR focuses on the python
components of relay, autotvm, auto_scheduler. To make the change
manageable, we will also do followup steps on te.Schedule and
c++ components in followup PRs.

To continue support community members who depends on
legacy flows, the [v0.19.0](https://github.com/apache/tvm/tree/v0.19.0)
branch will continue contain these components.


As noted in [discussion on phasing out legacy components](https://discuss.tvm.apache.org/t/phasing-out-legacy-components/17703/30),
this would help us to do two purposes:

- By removing outdated or redundant elements, we can significantly
reduce complexity and improve maintainability.
- Unify our focus: Concentrating our efforts on the new unity flow
will allow for more efficient development and innovation.

It is also a good opportunity for us to revisit and reduce CI time.
The past relay legacy flow contains a lot of end to end tests that
requires hardware resources to run and causing long CI time.
Moving onwards, we can focus more on unit-tests that focuses
on structural equality and runs within seconds, while be mindful
about tests that requires hardware resources (by restricting them
to specific folders and CI nightly in some cases).

---

Co-authored-by: Siyuan Feng <hzfengsy@sjtu.edu.cn>
2025-02-15 13:48:28 -05:00
Siyuan Feng a65d3d4d57 [Refactor] Phase out legacy docs
This commit removes legacy docs.
2025-01-24 19:25:02 -05:00
Siyuan Feng f717c5655c [Refactor] Phase out microTVM (#17554) 2024-12-10 08:43:05 -05:00
Siyuan Feng 9e865b4b8f [Docs] Introduce Relax API and move legacy part to standalone page (#17286)
* [Docs] Introduce Relax API and move legacy part to standalone page

As the TVM project evolves, the Unity strategy has been the recommended
way to use Apache TVM applications. Hence, we are pushing documentation
for the Relax API to the forefront and moving the legacy part to a
standalone page, which may be removed in the future.

* update for ci

* update for ci
2024-08-22 18:16:56 -04:00
Siyuan Feng 707492a677 Revert "[#15157][Rust][Doc] Re-enable the Rust documentation build (#15213)" (#16127)
This reverts commit c928852d59.
2023-11-14 18:22:16 -05:00
Neo Chien c928852d59 [#15157][Rust][Doc] Re-enable the Rust documentation build (#15213)
This PR is trying to fix issues #15157 and #9217, any suggestions and feedback would be appreciated if you are available.

Reference: #9288
2023-07-04 23:23:12 -07:00
Xiyou Zhou 17bd178bfa [Docs] Fix MetaSchedule Docs (#14480)
* [Doc] Publish MetaSchedule API Doc

See discussion thread for details:
https://discuss.tvm.apache.org/t/ask-for-help-do-we-have-metaschedule-python-api-docs/14643.

Python API docs need to be explicitly specified to be published on TVM
website, which we have mistakenly forgotten in previous releases.
This PR fixes this issue.

* Fix docs.

* Add blank line.

---------

Co-authored-by: Junru Shao <junrushao@apache.org>
2023-04-07 20:29:09 -07:00
driazati a4840e7de3 [ci] Lint for trailing newlines and spaces (#13058)
This adds a short lint to ensure that all files have a single trailing newline and no trailing whitespaces. This PR is in two commits, one to add the check and another to fix currently offending files in the repo. See https://github.com/apache/tvm/pull/13058/commits/ba2c2e235e2a16d62fdeed959044c65012d9f942 for just the significant changes. Auto-corrections applied with

```
pre-commit run --all-files
```
2022-10-18 23:36:35 -07:00
chiwwang 111b2da137 RelayViz Graphviz renderer (#10400)
Following https://github.com/apache/tvm/pull/10085, this PR adds a
graphviz backend. It requires python `graphviz` package and `dot`
executable in the PATH, similar to `tedd.py`.

This implementation is much like a porting of `visualize` function in
https://tvm.apache.org/2020/07/14/bert-pytorch-tvm, except that
`node_attr_dict` is replaced with a callback `get_node_attr`.

`get_node_attr` can be somehow used to emphasize a set of nodes.
It might be useful if we encounter problems in inferences
and want to find nodes with certain types and attributes.

An example is provided in
https://github.com/chiwwang/tvm/blob/graphviz_renderer_example/test_viz.py

Its outputs are (conv2d with NCHW layout is green-colored):
https://github.com/chiwwang/tvm/blob/graphviz_renderer_example/mod_with_subgraph.pdf
https://github.com/chiwwang/tvm/blob/graphviz_renderer_example/mod_wo_subgraph.pdf
2022-03-01 12:50:33 +09:00
chiwwang 55cfc4ad2d RelayViz interface and terminal ast-dump (#10085)
* RelayViz interface and terminal ast-dump.

This PR follows https://github.com/apache/tvm/pull/8668, with splitting
out interfaces class and terminal ast-dump implementation.

This visualizer is aimed for quick look-then-fix, so the interface is
simple. Despite that, customization is still possbile through
implementing interfaces defined in `interface.py` or overriding existent
implementations inside a renderer module, like `terminal.py`.

A tutorial is also provided in this PR.

A graphviz renderer will also be contributed after this PR.

* lint and typo
2022-02-22 11:41:40 +09:00
Michalis Papadimitriou 6ef1c2a4b0 [CORE][Relay] Swap and remove compile_engine with te_compiler followup of #8775 (#9282)
* Remove compile_engine.h for real

* Fix format

* RM compile_engine.cc

* Swap compile engine with TECompiler

* Cleanup on compile engine py leftovers

* [WIP] Exposing legacy compile engine capabilities through TE Compiler

* Swap usages for depreciated compile engine with TE compiler

* Track and replace usages of compile engine refactor them to TE compiler

* [Docs] Log helper mod

* Remove depreciated function for lookup compile engine cachce

* Fix typos

* Debug misc cleanups

* Register global pass for using te compiler for auto scheduler

* Fix tests using the legacy compile engine

* Fix broken autotuner tests and minor cleanups

* Swap compile engine with te_compiler in rst config

* PR nits

* Fix failed test

Co-authored-by: Jared Roesch <roeschinc@gmail.com>
2021-10-23 06:16:05 +09:00
Chris Hoge 0147b0445d Fix direct and broken links (#9314)
Updates links to use references instead of direct links, fixing
broken links and making all internal docs links more durable to
refactoring
2021-10-19 09:55:11 -04:00
Chris Hoge 44549e6234 Documentation Refactor (#9203)
* Documentation Refactor - Stage 1

RFC: https://github.com/apache/tvm-rfcs/blob/main/rfcs/0027-formalize-documentation-organization.md
Tracking Issue: https://github.com/apache/tvm/issues/8987

Stage 1 of the documentation refactor reorganizes the docs structure,
moving files (without content changes) and adding new scaffolding to
generate the proper document tree.

It does not address naming, style, content, links, or other existing
content in documents that were moved. State 2 will address fixing these
issues with existing content.

Major changes include but are not limited to:

* Dividing the existing tutorials into two sections:
  * Tutorials
  * How Tos
* Moving all of the existing tutorials out of the `/tutorial`
  directory and into the more general `/gallery` directory.
* Breaking up how-tos into individual sections for more
  flexibility and more consistent rendering.
* Moving content into new classifications:
  * `/docs/arch` for architecture guides
  * `/docs/reference` for API guides and other reference material
  * `/docs/topic` for topic specific guides such as microTVM and VTA
  * Restructuring `/docs/dev`
* Adding a table of contents to the doc index
* Adding instructions on how to install using third-party tlcpack

* Documentation Refactor - Stage 2

RFC: https://github.com/apache/tvm-rfcs/blob/main/rfcs/0027-formalize-documentation-organization.md
Tracking Issue: https://github.com/apache/tvm/issues/8987

Stage 2 of the documentation refactor fixes naming and links
in the documentation to be consistent with the overall structure.

Major changes include:

* an update to how to contribute to docs.
* several updated index pages with title changes to match
  the organization style and bring consistency to the sections
* expanded descriptions of some page collections
* fixed links

* Documentation Refactor - Stage 3

RFC: https://github.com/apache/tvm-rfcs/blob/main/rfcs/0027-formalize-documentation-organization.md
Tracking Issue: https://github.com/apache/tvm/issues/8987

Stage 3 of the documentation refactor adjusts CI for the new structure.
The CI build script takes into account the new gallery format. It
also prevents deleting existing documents, and takes advantage of the
`_staging` and `_build` directories to clean out previous builds.
2021-10-09 19:52:54 -04:00