MCPcopy
hub / github.com/apache/tvm

github.com/apache/tvm @v0.25.0.post1 sqlite

repository ↗ · DeepWiki ↗ · release v0.25.0.post1 ↗
26,900 symbols 121,560 edges 1,622 files 7,656 documented · 28%
README

Open Machine Learning Compiler Framework

Documentation | Contributors | Community | Release Notes

Apache TVM is an open machine learning compilation framework, following the following principles:

  • Python-first development that enables quick customization of machine learning compiler pipelines.
  • Universal deployment to bring models into minimum deployable modules.

License

TVM is licensed under the Apache-2.0 license.

Getting Started

Check out the TVM Documentation site for installation instructions, tutorials, examples, and more. The Getting Started with TVM tutorial is a great place to start.

Contribute to TVM

TVM adopts the Apache committer model. We aim to create an open-source project maintained and owned by the community. Check out the Contributor Guide.

History and Acknowledgement

TVM started as a research project for deep learning compilation. The first version of the project benefited a lot from the following projects:

  • Halide: Part of TVM's TIR and arithmetic simplification module originates from Halide. We also learned and adapted some parts of the lowering pipeline from Halide.
  • Loopy: use of integer set analysis and its loop transformation primitives.
  • Theano: the design inspiration of symbolic scan operator for recurrence.

Since then, the project has gone through several rounds of redesigns. The current design is also drastically different from the initial design, following the development trend of the ML compiler community.

The most recent version focuses on a cross-level design with TensorIR as the tensor-level representation and Relax as the graph-level representation and Python-first transformations. The project's current design goal is to make the ML compiler accessible by enabling most transformations to be customizable in Python and bringing a cross-level representation that can jointly optimize computational graphs, tensor programs, and libraries. The project is also a foundation infra for building Python-first vertical compilers for domains, such as LLMs.

Extension points exported contracts — how you extend this code

ServerProcessor (Interface)
Abstract runnable class for RPC server process. [14 implementers]
jvm/core/src/main/java/org/apache/tvm/rpc/ServerProcessor.java
ArtifactCacheTemplate (Interface)
(no doc) [8 implementers]
web/src/artifact_cache.ts
Action (Interface)
(no doc) [6 implementers]
jvm/core/src/main/java/org/apache/tvm/NativeLibraryLoader.java
Disposable (Interface)
(no doc) [7 implementers]
web/src/types.ts
Callback (Interface)
(no doc) [6 implementers]
jvm/core/src/main/java/org/apache/tvm/Function.java
LibraryProvider (Interface)
(no doc) [2 implementers]
web/src/types.ts
GPUDeviceDetectOutput (Interface)
(no doc)
web/src/webgpu.ts
FunctionInfo (Interface)
(no doc)
web/src/webgpu.ts

Core symbols most depended-on inside this repo

Tensor
called by 20423
jvm/core/src/main/java/org/apache/tvm/Tensor.java
spatial
called by 3117
python/tvm/tirx/script/builder/ir.py
remap
called by 2758
python/tvm/tirx/script/builder/ir.py
dataflow
called by 2210
python/tvm/relax/block_builder.py
output
called by 2046
python/tvm/te/tensor.py
astype
called by 1877
python/tvm/tirx/expr.py
numpy
called by 1334
python/tvm/runtime/_tensor.py
emit
called by 1003
python/tvm/relax/block_builder.py

Shape

Function 14,241
Method 8,501
Class 3,635
Route 489
Interface 27
Enum 7

Languages

Python97%
TypeScript2%
Java1%

Modules by API surface

tests/python/relax/test_frontend_from_exported_program.py1,071 symbols
tests/python/relax/test_frontend_from_fx.py872 symbols
tests/python/relax/test_frontend_tflite.py570 symbols
python/tvm/relax/frontend/onnx/onnx_frontend.py424 symbols
tests/python/nightly/test_nnapi/test_from_exported_to_cuda.py281 symbols
tests/python/relax/test_frontend_onnx.py258 symbols
python/tvm/relax/frontend/tflite/tflite_frontend.py234 symbols
tests/python/relax/test_tvmscript_parser.py203 symbols
python/tvm/script/parser/core/doc_core.py200 symbols
python/tvm/backend/cuda/op.py192 symbols
python/tvm/tirx/script/builder/ir.py172 symbols
python/tvm/relax/frontend/torch/base_fx_graph_translator.py163 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

Dependencies from manifests, versioned

com.puppycrawl.tools:checkstyle8.18 · 1×
junit:junit4.11 · 1×
org.apache.tvm:libtvm4j-linux-x86_64
org.apache.tvm:libtvm4j-osx-x86_64
org.apache.tvm:tvm4j-core
org.slf4j:slf4j-api1.7.25 · 1×
org.slf4j:slf4j-simple1.7.25 · 1×
@rollup/plugin-commonjs29.0.0 · 1×
@rollup/plugin-node-resolve16.0.3 · 1×
@rollup/plugin-typescript12.3.0 · 1×
@types/node25.3.0 · 1×
@typescript-eslint/eslint-plugin8.56.0 · 1×

For agents

$ claude mcp add tvm \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact