build(python)!: require CMake 3.26 for ABI-aware builds (#661)

Architecture:
- Split Python interpreter discovery from development-component
discovery so the extension ABI is known before CMake resolves link
targets.
- Detect Py_GIL_DISABLED with the selected interpreter, pin its exact
version, and request only the development components used by that ABI
branch.
- Set CMake 3.26 as the project minimum, matching the first release that
provides Development.SABIModule and python_add_library(USE_SABI).

Public Interfaces:
- Standard CPython 3.12 and newer requires Development.Module and
Development.SABIModule and produces an abi3 extension.
- Free-threaded CPython and CPython older than 3.12 require only
Development.Module and produce a version-specific extension with SOABI.
- Building the root project now requires CMake 3.26 or newer. Runtime
APIs and the stable TVM FFI C ABI are unchanged.

UI/UX:
- none

Behavioral Changes:
- Stop requiring stable-ABI development artifacts for configurations
that cannot use the Limited API, including free-threaded CPython.
- Preserve the existing abi3 path for standard CPython 3.12 and newer
while allowing declared cp314t builds to configure against their native
ABI.
- Fail early with an explicit CMake version requirement instead of
reaching unsupported FindPython components or USE_SABI options on older
CMake.

Docs:
- Raise the CMake prerequisite to 3.26 in the source-build guide,
AGENTS.md, and the tracked developer-tool reference.

Tests:
- Executed: staged pre-commit hooks, isolated CMake configuration for
the C++ project, and isolated CMake configuration with the Python module
enabled.
- Result: all executed checks passed.

Untested Edge Cases:
- Free-threaded CPython, Windows, and Python versions older than 3.12
were not available locally; their component selection remains covered by
the explicit CMake branches and should be exercised in CI.
- Compilation, wheel creation, and the full unit-test suites were not
rerun because this commit changes configuration and dependency selection
only.

BREAKING CHANGE: Building TVM FFI now requires CMake 3.26 or newer.
Upgrade CMake before configuring either the standalone C++ project or
Python package.
4 files changed
tree: a9d61ec6b8b41acff8687e1403f4a36921fa4aa3
  1. .agents/
  2. .claude/
  3. .github/
  4. 3rdparty/
  5. addons/
  6. cmake/
  7. docs/
  8. examples/
  9. include/
  10. licenses/
  11. python/
  12. rust/
  13. src/
  14. tests/
  15. .asf.yaml
  16. .clang-format
  17. .clang-tidy
  18. .cmake-format.json
  19. .gitignore
  20. .gitmodules
  21. .markdownlint-cli2.yaml
  22. .pre-commit-config.yaml
  23. .yamllint.yaml
  24. AGENTS.md
  25. CLAUDE.md
  26. CMakeLists.txt
  27. CONTRIBUTING.md
  28. KEYS
  29. LICENSE
  30. NOTICE
  31. pyproject.toml
  32. README.md
README.md

TVM FFI: Open ABI and FFI for Machine Learning Systems

📚 Documentation | 🚀 Quickstart

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]
  • Kernel DSLs - reusable open ABI for JIT and AOT kernel exposure frameworks and runtimes. [TileLang][cuteDSL]
  • Frameworks and runtimes - a uniform extension point for ABI-compliant libraries and DSLs. [PyTorch][JAX][PaddlePaddle][NumPy/CuPy]
  • ML infrastructure - out-of-box bindings and interop across languages. [Python][C++][Rust][XGrammar]
  • 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.
  • 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:

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 (major.minor.patch) going forward.

Documentation

Our documentation site includes:

Get Started

Guides

Concepts

Packaging

Developer Manual