Description
<!--- Licensed to the Apache Software Foundation (ASF) under one --> <!--- or more contributor license agreements. See the NOTICE file --> <!--- distributed with this work for additional information --> <!--- regarding copyright ownership. The ASF licenses this file --> <!--- to you under the Apache License, Version 2.0 (the --> <!--- "License"); you may not use this file except in compliance --> <!--- with the License. You may obtain a copy of the License at --> <!--- http://www.apache.org/licenses/LICENSE-2.0 --> <!--- Unless required by applicable law or agreed to in writing, --> <!--- software distributed under the License is distributed on an --> <!--- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --> <!--- KIND, either express or implied. See the License for the --> <!--- specific language governing permissions and limitations --> <!--- under the License. --> # TVM FFI: Open ABI and FFI for Machine Learning Systems š [Documentation](https://tvm.apache.org/ffi/) | š [Quickstart](https://tvm.apache.org/ffi/get_started/quickstart.html) Apache TVM FFI is an open ABI and FFI for machine learning systems. It is a minimal, framework-agnostic, yet flexible open convention with the following systems in mind: - **Kernel libraries** - ship one wheel to support multiple frameworks, Python versions, and different languages. [[FlashInfer](https://docs.flashinfer.ai/)] - **Kernel DSLs** - reusable open ABI for JIT and AOT kernel exposure frameworks and runtimes. [[TileLang](https://tilelang.com/)][[cuteDSL](https://docs.nvidia.com/cutlass/latest/media/docs/pythonDSL/cute_dsl_general/compile_with_tvm_ffi.html)] - **Frameworks and runtimes** - a uniform extension point for ABI-compliant libraries and DSLs. [[PyTorch](https://tvm.apache.org/ffi/get_started/quickstart.html#ship-to-pytorch)][[JAX](https://tvm.apache.org/ffi/get_started/quickstart.html#ship-to-jax)][[PaddlePaddle](https://tvm.apache.org/ffi/get_started/quickstart.html#ship-to-paddle)][[NumPy/CuPy](https://tvm.apache.org/ffi/get_started/quickstart.html#ship-to-numpy)] - **ML infrastructure** - out-of-box bindings and interop across languages. [[Python](https://tvm.apache.org/ffi/get_started/quickstart.html#ship-to-python)][[C++](https://tvm.apache.org/ffi/get_started/quickstart.html#ship-to-cpp)][[Rust](https://tvm.apache.org/ffi/get_started/quickstart.html#ship-to-rust)] - **Coding agents** - a unified mechanism for shipping generated code in production. ## Features - **Stable, minimal C ABI** designed for kernels, DSLs, and runtime extensibility. - **Zero-copy interop** across PyTorch, JAX, and CuPy using [DLPack protocol](https://data-apis.org/array-api/2024.12/design_topics/data_interchange.html). - **Compact value and call convention** covering common data types for ultra low-overhead ML applications. - **Multi-language support** out of the box: Python, C++, and Rust (with a path towards more languages). These enable broad **interoperability** across frameworks, libraries, DSLs, and agents; the ability to **ship one wheel** for multiple frameworks and Python versions (including free-threaded Python); and consistent infrastructure across environments. ## Getting Started Install TVM-FFI with pip, uv or from source: ```bash pip install apache-tvm-ffi pip install torch-c-dlpack-ext # compatibility package for torch <= 2.9 ``` ## Status and Release Versioning **C ABI stability** is our top priority. **Status: RFC** Main features are complete and ABI stable. We recognize potential needs for evolution to ensure it works best for the machine learning systems community, and would like to work together with the community for such evolution. We plan to stay in the RFC stage for three months from the v0.1.0 release. Releases during the RFC stage will be `0.X.Y`, where bumps in `X` indicate C ABI-breaking changes and `Y` indicates other changes. We anticipate the RFC stage will last for three months, then we will start following [Semantic Versioning](https://packaging.python.org/en/latest/discussions/versioning/) (`major.minor.patch`) going forward. ## Documentation Our [documentation site](https://tvm.apache.org/ffi/) includes: ### Get Started - [Quick Start](https://tvm.apache.org/ffi/get_started/quickstart.html) - [Stable C ABI](https://tvm.apache.org/ffi/get_started/stable_c_abi.html) ### Guides - [Export Functions & Classes](https://tvm.apache.org/ffi/guides/export_func_cls.html) - [Kernel Library Guide](https://tvm.apache.org/ffi/guides/kernel_library_guide.html) ### Concepts - [ABI Overview](https://tvm.apache.org/ffi/concepts/abi_overview.html) - [Any](https://tvm.apache.org/ffi/concepts/any.html) - [Object & Class](https://tvm.apache.org/ffi/concepts/object_and_class.html) - [Tensor](https://tvm.apache.org/ffi/concepts/tensor.html) - [Function & Module](https://tvm.apache.org/ffi/concepts/func_module.html) - [Exception Handling](https://tvm.apache.org/ffi/concepts/exception_handling.html) ### Packaging - [Python
Release History
| Version | Changes | Urgency | Date |
|---|---|---|---|
| 0.1.10 | Imported from PyPI (0.1.10) | Low | 4/21/2026 |
| v0.1.10 | ## What's Changed * chore(release): Add GPG Key from Yong Wu by @yongwww in https://github.com/apache/tvm-ffi/pull/474 * [FIX] Prevent integer overflow in GetDataSize on 32-bit platforms by @gnguralnick in https://github.com/apache/tvm-ffi/pull/475 * refactor(dataclasses)!: remove Python-side field descriptor infrastructure by @junrushao in https://github.com/apache/tvm-ffi/pull/478 * feat: add cuLaunchKernelEx support by @lucifer1004 in https://github.com/apache/tvm-ffi/pull/476 * chore(re | Medium | 4/7/2026 |
| v0.1.9 | ## What's Changed * chore(release): Version bump after release v0.1.8 by @junrushao in https://github.com/apache/tvm-ffi/pull/404 * fix: add unified_api.h include to device_guard.h by @cyx-6 in https://github.com/apache/tvm-ffi/pull/405 * Revert "feat: Add `tvm_ffi.Function.__init__`" by @junrushao in https://github.com/apache/tvm-ffi/pull/406 * [CUDA] Isolate unified api to only in cubin launcher by @tqchen in https://github.com/apache/tvm-ffi/pull/408 * [FIX] Fix the error propagation in | Low | 2/27/2026 |
| v0.1.8-post2 | ## What's Changed * [FIX] Fix the error propagation in the case of tensor arguments by @tqchen in https://github.com/apache/tvm-ffi/pull/409 **Full Changelog**: https://github.com/apache/tvm-ffi/compare/v0.1.8-post1...v0.1.8-post2 | Low | 1/13/2026 |
| v0.1.8-post1 | ## What's Changed * [CUDA] Isolate unified api to only in cubin launcher by @tqchen in https://github.com/apache/tvm-ffi/pull/408 **Full Changelog**: https://github.com/apache/tvm-ffi/compare/v0.1.8-post0...v0.1.8-post1 | Low | 1/13/2026 |
| v0.1.8-post0 | ## What's Changed * chore(release): Version bump after release v0.1.8 by @junrushao in https://github.com/apache/tvm-ffi/pull/404 * fix: add unified_api.h include to device_guard.h by @cyx-6 in https://github.com/apache/tvm-ffi/pull/405 * Revert "feat: Add `tvm_ffi.Function.__init__`" by @junrushao in https://github.com/apache/tvm-ffi/pull/406 **Full Changelog**: https://github.com/apache/tvm-ffi/compare/v0.1.8...v0.1.8-post0 | Low | 1/12/2026 |
| v0.1.8 | ## What's Changed * [Feature] Support dynamic-style overload for FFI object types by @DarkSharpness in https://github.com/apache/tvm-ffi/pull/286 * fix(lint): Suppress latest clang-tidy warnings by @junrushao in https://github.com/apache/tvm-ffi/pull/361 * [Enhancement] Refactor cubin launcher by @oraluben in https://github.com/apache/tvm-ffi/pull/300 * fix(build): Link dl and pthread dependencies for tvm_ffi by @junrushao in https://github.com/apache/tvm-ffi/pull/360 * chore(release): Vers | Low | 1/12/2026 |
| v0.1.7 | ## What's Changed * chore(release): Bump version after v0.1.6 release by @junrushao in https://github.com/apache/tvm-ffi/pull/346 * Allow `tvm_ffi.device(..., id)` where id is numpy or torch scalar by @wrongtest-intellif in https://github.com/apache/tvm-ffi/pull/347 * feat(stubgen): Package generation with `--init-*` flags by @junrushao in https://github.com/apache/tvm-ffi/pull/295 * feat(cmake): Introduce `tvm_ffi_configure_target` and `tvm_ffi_install` by @junrushao in https://github.com/a | Low | 12/22/2025 |
| v0.1.6 | ## What's Changed * bugfix: Fix clang-tidy warnings in `test_c_env_api.cc` by @junrushao in https://github.com/apache/tvm-ffi/pull/318 * chore: Use `importlib.metadata` to locate DSOs by @junrushao in https://github.com/apache/tvm-ffi/pull/306 * chore(release): Version bump after v0.1.5 release by @junrushao in https://github.com/apache/tvm-ffi/pull/321 * fix(config): `tvm-ffi-config --sourcedir` broken in wheels by @junrushao in https://github.com/apache/tvm-ffi/pull/319 * [Fix] Fix missin | Low | 12/12/2025 |
| v0.1.5 | ## What's Changed * [Feature] Support vanilla C++ STL in FFI. by @DarkSharpness in https://github.com/apache/tvm-ffi/pull/228 * fix: Use-after-move when handling std::tuple by @junrushao in https://github.com/apache/tvm-ffi/pull/293 * chore(release): Version bump after v0.1.4 release by @junrushao in https://github.com/apache/tvm-ffi/pull/296 * Workaround Segfaults and clang-tidy warnings by @junrushao in https://github.com/apache/tvm-ffi/pull/297 * [TEST] Further fix potential use after fr | Low | 12/5/2025 |
| v0.1.4 | ## What's Changed * [Docs] Add kernel library guide by @cyx-6 in https://github.com/apache/tvm-ffi/pull/169 * feat: Embed metadata for FFI exported functions by @Kathryn-cat in https://github.com/apache/tvm-ffi/pull/230 * fix: clang tidy issue by @Kathryn-cat in https://github.com/apache/tvm-ffi/pull/279 * [TORCH] Fix precise version of f8e8m0 support by @tqchen in https://github.com/apache/tvm-ffi/pull/282 * [Feature] Add cubin launcher utility as an extra header by @yaoyaoding in https:// | Low | 11/27/2025 |
| v0.1.3 | ## What's Changed * feat(cython): Expose TypeAttr via `_lookup_type_attr` by @junrushao in https://github.com/apache/tvm-ffi/pull/247 * fix(cython): Make sure `TypeInfo` is properly registered by all classes by @junrushao in https://github.com/apache/tvm-ffi/pull/246 * chore(cython): Specify `--module-name` when building Cython by @junrushao in https://github.com/apache/tvm-ffi/pull/248 * feat: Introduce `tvm.registry.get_registered_type_keys()` by @junrushao in https://github.com/apache/tvm | Low | 11/17/2025 |
| v0.1.2 | This is a minor patch release, mainly to include the fixes support for corner cases and enable cuda-python CUstream compactibility ## What's Changed * Add torch c dlpack release workflow by @cyx-6 in https://github.com/apache/tvm-ffi/pull/220 * [Fix] fix iterator behavior by @DarkSharpness in https://github.com/apache/tvm-ffi/pull/218 * [Test] Add test for filelock utility by @yaoyaoding in https://github.com/apache/tvm-ffi/pull/216 * [LINT] Bump macro version after release by @tqchen in | Low | 11/11/2025 |
| v0.1.1 | This is a minor patch release, mainly to include the latest support for AOT torch-dlpack-ext and reduce JIT deadlock issues ## What's Changed * doc: Polish quickstart doc and add Examples by @junrushao in https://github.com/apache/tvm-ffi/pull/170 * feat: Automatically add `__init__` method if available by @junrushao in https://github.com/apache/tvm-ffi/pull/174 * doc: Migrate `.pyi` docstrings into Cython by @junrushao in https://github.com/apache/tvm-ffi/pull/175 * Introduce dtype proto | Low | 11/4/2025 |
| v0.1.0 | This is the first release of tvm-ffi Apache TVM FFI is an open ABI and FFI for ML systems. It is a minimal, framework-agnostic, yet flexible open convention with the following systems in mind: - Kernel libraries: ship one wheel to support multiple frameworks, Python versions, and different languages. - Kernel DSLs: reusable open ABI for JIT and AOT kernel exposure to PyTorch, JAX, and other ML runtimes. - ML frameworks and runtimes: unified mechanism to connect libraries and DSLs that ad | Low | 10/21/2025 |
