Skip to main content

tilelang-devkit

Developer tooling for TileLang.

The package currently ships lower_trace, a pass-by-pass IR tracing tool built on TVM PassInstrument and TileLang's compilation instrumentation interfaces. It records raw before/after IR, prints terminal diffs, and generates a self-contained HTML report without patching TVM globals.

Install

pip install tilelang-devkit

The package has no hard dependencies. Install it into the Python environment that already provides the compatible TileLang/TVM build you want to inspect. Python 3.10 or newer is required.

For development:

git clone https://github.com/easy-tilelang/tilelang-devkit.git
cd tilelang-devkit
pip install -e '.[dev]'

Trace a complete TileLang compilation

Compatible TileLang versions discover the package through the tilelang.instrumentation_tools entry point:

TL_LOWER_TRACE=both python kernel.py

Supported values are terminal, html, and both. The truthy shorthand values 1, true, yes, and on select html; 0, false, no, and off disable tracing.

Reports are written below ./tmp/lower_trace_dir/<script-name>/ by default. Select another base directory with:

TL_LOWER_TRACE=both \
TL_LOWER_TRACE_DIR="$PWD/tmp/lower_trace_dir" \
python kernel.py

The latest report is available as <script-name>/report.html; immutable run data lives under <script-name>/.run_records/run_<timestamp>_<pid>_<id>/. If TileLang serves a cached compilation result, no lowering passes execute and there is nothing new to trace; disable the TileLang kernel cache when you need a fresh compilation trace.

Tracing can also be controlled from Python:

import tilelang_devkit.lower_trace as lt

lt.enable(mode="both", trace_dir="./traces")
# tilelang.compile(...)
lt.disable()

The v0.1 context-manager API remains available and selects terminal mode:

from tilelang_devkit.lower_trace import trace

with trace(trace_dir="./traces"):
    # compile a TileLang kernel
    ...

Trace selected TVM passes

Apply and compare a fixed pass chain:

import tilelang_devkit.lower_trace as lt

results = lt.lower_trace(
    mod,
    [("Simplify", simplify_pass)],
    mode="both",
    html_path="lower-trace.html",
)

Or instrument an existing PassContext:

from tvm.ir.transform import PassContext
import tilelang_devkit.lower_trace as lt

instrument = lt.create_pass_instrument(mode="html", trace_dir="./traces")
with PassContext(instruments=[instrument]):
    with lt.phase("optimization"):
        # run TVM passes
        ...
instrument.finish()

The full manual covers the HTML viewer, raw IR files, host/device source output, and the edit-and-recompile workflow.

Public API

  • lower_trace(...): run and compare selected passes.
  • create_pass_instrument(...): create a standalone TVM pass instrument.
  • phase(name): label records produced by the standalone instrument.
  • enable(...), disable(), reset(): control future TileLang sessions.
  • trace(trace_dir=None): compatibility context manager.
  • LowerRecord: one pass or code-generation record.

Importing tilelang_devkit.lower_trace does not eagerly import TileLang. The TileLang-specific adapter is loaded only when its API or plugin entry point is used.

License

Apache-2.0

Metadata

Release files for tilelang-devkit 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tilelang-devkit 0.2.0
File Size Uploaded Provenance Actions
tilelang_devkit-0.2.0.tar.gz 718.5 kB With provenance Details for tilelang_devkit-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tilelang-devkit 0.2.0
File Interpreter ABI Platform Actions
tilelang_devkit-0.2.0-py3-none-any.whl Python 3 none any Details for tilelang_devkit-0.2.0-py3-none-any.whl

Total release size: 761.5 kB

Release files / tilelang_devkit-0.2.0.tar.gz

Download URL tilelang_devkit-0.2.0.tar.gz
Size 718.5 kB
Tags Source
SHA-256 checksum
How to use checksums
46df00d303a5ce181353c855259b4e9b7a58e36cb96d426b3e4ea42f7453573f
BLAKE2b-256 checksum
How to use checksums
22363550e38bd7c78a6844639faf6d3e3074fb93ce7035e9877375d6d0ffc55c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / tilelang_devkit-0.2.0-py3-none-any.whl

Download URL tilelang_devkit-0.2.0-py3-none-any.whl
Size 43.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8e99666457ca2f7aee05980ccaac6f7ee265a2ec1670e53e5f2461b5292b947
BLAKE2b-256 checksum
How to use checksums
42b5a695bb6e2e155dbc60e40d60fde37cbfe71296b3b27aa76e742e292b3106
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for tilelang-devkit 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tilelang_devkit-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page