XTC
Links
Refer to documentation at https://xtc-tools.github.io/xtc
Refer to tutorials here and to additionnal developers documentation here.
Overview
XTC is a domain-specific dataflow graph compiler for linear algebra operations. It provides:
- Operational DSL: Define computation graphs with tensors and operators
- Scheduling DSL: High-level transformations (tiling, parallelization, vectorization, etc.)
- Multiple backends: MLIR (linalg + transform), TVM (Tensor IR), JIR (INRIA internal)
- Autotuning: Definition and exploration of the optimization space
Build & Development
Installation
If needed, install uv following the instructions here.
Debian-like x86_64 or aarch64 Linux distributions (Python: 3.10 to 3.14 inclusive):
sudo apt install python3 python3-dev build-essential libomp5 binutils binutils-aarch64-linux-gnu binutils-x86-64-linux-gnu
sudo apt install libpfm4-dev # Optional: interface to Linux perf counters
sudo sysctl kernel.perf_event_paranoid=1 # Optional: give access to hardware counters
uv venv -p 3.12 && source .venv/bin/activate
uv pip install -e '.[dev]'
make test
MacOs M1+ macos-14/macos-15 (Python: 3.10 to 3.14 inclusive):
brew install libomp x86_64-linux-gnu-binutils aarch64-elf-binutils
export DYLD_LIBRARY_PATH="/opt/homebrew/opt/libomp/lib:$DYLD_LIBRARY_PATH"
uv venv -p 3.12 && source .venv/bin/activate
uv pip install -e '.[dev]'
make test
Note that [dev] extension installs both mlir and tvm backends in addition to development tools.
Available extensions are:
[mlir]: MLIR backend[tvm]: TVM backend[test]: develop, docs and tests tools[default]: mlir + tvm[dev]: default + test
Code quality
Code quality requirements:
- Type annotations: Strict pyright mode, full annotations required
- Formatting: Ruff (line length 88)
- License headers: BSD-3-Clause required on all source files
- All checks must pass before merge
Type checking:
make check-type # Run both pyright and mypy
pyright # Run pyright only
mypy # Run mypy only
Formatting:
make format # Apply all formatting (license + ruff)
make check-format # Check formatting without modifying files
Testing structure:
tests/pytest/unit/: Core interface unit teststests/pytest/{mlir,tvm}/: Backend-specific teststests/filecheck/: Lit+FileCheck functional tests for code generation
Global test commands:
make test # Run minimal unit tests
make check # Run ALL acceptance tests (required for contributions)
make check-pytest # Run pytest suite only
make check-lit # Run LIT tests for LLVM IR target
make check-lit-c # Run LIT tests for C target
pytest tests/pytest/unit # Run specific test directory
Running individual tests:
# Single pytest file
pytest tests/pytest/unit/test_specific.py -v
# Single lit test
lit -v tests/filecheck/backends/specific_test.py
# C target for lit tests
XTC_MLIR_TARGET=c lit -v tests/filecheck/backends/specific_test.py
Dependencies update
Python package dependencies are listed in dependencies.toml with definition of groups and groups
dependencies.
Always update dependencies there and run make dependencies to update pyproject.toml before commit.
Releases
Package versions are derived from Git tags. Successful updates to main are
published to TestPyPI as development versions, while tags of the form
xtc-vX.Y.Z are published to PyPI. See
the release guide for the release procedure and
required trusted-publishing configuration.
Architecture
Core Abstractions (src/xtc/itf/)
Abstract interfaces defining the compilation pipeline:
data/- Tensor, DataType, ShapeTypeoperator/- Linear algebra operator interfacegraph/- Graph, Node, Operation abstractionsback/- Backend interfaceschd/- Scheduler and Schedule abstractionscomp/- Compiler interfaceexec/- Executor and Evaluator interfacessearch/- Search space exploration interface
Backends (src/xtc/backends/)
Exposed backends:
mlir/- MLIR backend using linalg + transform dialectstvm/- TVM backend using Tensor IR + Schedule APIs
XTC also supports multiple MLIR Targets for the code generation:
- llvmir (default)
- c
- nvgpu
To force the use of a specific target, you can set the env variable XTC_MLIR_TARGET=<mlir-target>.
The MLIR backend can be extended using the SDist extension, which provides distribution primitives. To install SDist, follow the instructions in docs/develop/optional_backends.md, in the "MLIR development version" section.
Note that the nvgpu target requires a recent version of Cuda (tested with Cuda 13.0). By default, it tries to find Cuda at /usr/local/cuda, but it can be overridden with the CUDA_INSTALL_DIR env variable. The performance counters can be accessed is the GPU has a compute capability >=7.5.
Compilation Pipeline
- User defines Graph with Tensors and Operators
- Backend created from Graph
- Scheduler applies transformations and produces Schedule
- Compiler generates executable Module
- Executor/Evaluator runs and measures performance
CLI Tools (src/xtc/cli/)
mlir-loop- High-level scheduling for MLIR linalg operatorsmlir-backend- MLIR backend wrapperloop-explore- Autotuning and space explorationloop-display- Visualization of exploration results
AI assistants
To create agent guidance files from this README: make agents (AGENTS.md) or make claude (CLAUDE.md)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xtc_tools-0.3.0.tar.gz.
File metadata
- Download URL: xtc_tools-0.3.0.tar.gz
- Upload date:
- Size: 710.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11c83e59aae60b1e6246060fd3d6c8111aa8d537abf45c4a3ac24780e588c0de
|
|
| MD5 |
f111a0267e92c93e9e7b952cabc99833
|
|
| BLAKE2b-256 |
eaccdb33d9cd22eb26f8d72182fd479d2ab9e63e4d7c47848b2e57b577cebfd3
|
Provenance
The following attestation bundles were made for xtc_tools-0.3.0.tar.gz:
Publisher:
xtc-tests.yml on xtc-tools/xtc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xtc_tools-0.3.0.tar.gz -
Subject digest:
11c83e59aae60b1e6246060fd3d6c8111aa8d537abf45c4a3ac24780e588c0de - Sigstore transparency entry: 2688379495
- Sigstore integration time:
-
Permalink:
xtc-tools/xtc@27e6a52a64125938001ef26628d8c2b91b4d1497 -
Branch / Tag:
refs/tags/xtc-v0.3.0 - Owner: https://github.com/xtc-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
xtc-tests.yml@27e6a52a64125938001ef26628d8c2b91b4d1497 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xtc_tools-0.3.0-py3-none-any.whl.
File metadata
- Download URL: xtc_tools-0.3.0-py3-none-any.whl
- Upload date:
- Size: 319.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2348751854b538a35f5ad28b59bc3b6733da9f78512d8dd871bafcd0ce8a0660
|
|
| MD5 |
bee02bf01b0049f85df48ff24665bd5a
|
|
| BLAKE2b-256 |
c9ac1aad3ed2731f0da01ad161b6d1749c2a95514140833b5bb24495da8b4691
|
Provenance
The following attestation bundles were made for xtc_tools-0.3.0-py3-none-any.whl:
Publisher:
xtc-tests.yml on xtc-tools/xtc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xtc_tools-0.3.0-py3-none-any.whl -
Subject digest:
2348751854b538a35f5ad28b59bc3b6733da9f78512d8dd871bafcd0ce8a0660 - Sigstore transparency entry: 2688379555
- Sigstore integration time:
-
Permalink:
xtc-tools/xtc@27e6a52a64125938001ef26628d8c2b91b4d1497 -
Branch / Tag:
refs/tags/xtc-v0.3.0 - Owner: https://github.com/xtc-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
xtc-tests.yml@27e6a52a64125938001ef26628d8c2b91b4d1497 -
Trigger Event:
push
-
Statement type: