Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

TIRx kernels

Curated high-performance TIRx GPU kernels, with support for tirx-harness.

Kernels

Native kernels are grouped by workload under tirx_kernels/<workload>/. External ports live under tirx_kernels/ported/<upstream>/, with subpackages for upstream entry points. Unless annotated, a kernel runs on sm_100a, sm_103a and sm_107a, and its performance was measured and tuned on sm_100a; every listed architecture is gated by the registry correctness tests. Annotations mark the exceptions: ⟨sm_103a⟩ runs only on that architecture and was tuned there, and ⟨+sm_110a⟩ runs on that architecture in addition to the default three. Annotations follow KERNEL_META["runtime_cuda_archs"] and tests/lint/check_readme_kernels.py keeps them in sync.

Native TIRx

cuDNN Frontend ports

FlashAttention ports

FlashInfer ports

Grouped by the FlashInfer Python entry point each port backs.

FlashMLA ports

DeepGEMM ports

DeepEP ports

fast.cu ports

MSA ports

Performance

Per-workload numbers — our kernel time, every reference impl, and the ref/ours ratio (>1 means ours is faster) — are pinned in tirx_kernels/bench_suite/baseline.md, regenerated on every baseline promotion. See the bench-suite README for how the sweep runs and how to refresh the baseline.

Installation

pip install tirx-kernels
# or, from a checkout:
pip install -e .

TIRx and TVM FFI are installed automatically. For remote benchmarking, install pip install 'tirx-kernels[remote]' (or pip install -e '.[remote]' from a checkout).

External dependencies

Correctness uses the original upstream implementations. Install the exact, mutually compatible revisions from the repository lock:

python scripts/install_reference_dependencies.py

reference-dependencies.json is the single source of truth for reference revisions and the shared CUTLASS DSL version. The same command installs the pinned pytest/xdist runner. torch remains an externally managed GPU runtime dependency.

Dependency Needed by Notes
torch all kernels CUDA build matching your GPU.
deep_gemm FP8 GEMM and deepgemm_* baselines Used for optimized reference kernels and the MegaMoE timer.
cuDNN Frontend (cudnn) cudnn_* correctness and baselines Source install pinned in the lock (v1.28.0); replaces any released nvidia-cudnn-frontend wheel, which lacks the CuTeDSL kernel sources.
flashinfer all flashinfer.* ports, nvfp4_gemm and rmsnorm baselines Correctness reference and optimized baseline.
flash-attn + CUTLASS DSL flash_attention_backward_sm100 baseline Current SM100 forward/backward reference.
SGLang CuTeDSL kernels (vendored, + CUTLASS DSL) deepgemm_sm100_fp8_paged_mqa_logits reference sglang_cutedsl benchmark reference; copied into tirx_kernels/ported/deepgemm/_sglang_cutedsl/, no SGLang install needed.
flash_mla sparse_flashmla_* / flash_mla_sparse_fwd baselines Reference impls.
deep_ep deepep_* correctness and baselines Reference implementation.
flash-linear-attention kda_forward_portfolio_multishape and kda_backward_packed correctness Independent FLA BF16/Triton chunk reference.
flash_kda flashkda_* and kda_forward_portfolio_multishape optional baselines Raw FlashKDA benchmark peer.
fmha_sm100 (MSA) msa_* correctness and baselines Reference implementation; set MSA_PATH to use a checkout elsewhere.
NVSHMEM allgather_gemm, gemm_reduce_scatter Required to compile/run the GemmComm kernels.

Correctness tests import and run these upstream implementations. The bench suite does not launch or time benchmark reference implementations by default (kernel data-preparation helpers may still import their upstream package). Pass --with-references to enable reference launches; a missing enabled reference fails its workload. See tirx_kernels/bench_suite/README.md for the prerequisites and workarounds.

Usage

Command line

# List discovered kernels (with their config labels)
python -m tirx_kernels.registry --format json

# Run correctness tests (optionally filter by kernel / config label)
pytest -n 16 tests/test_correctness.py

# Benchmark
python -m tirx_kernels.bench --kernel nvfp4_gemm
python -m tirx_kernels.bench --kernel nvfp4_gemm --with-references

# Pre-commit regression benchmark sweep on the kcoral benchmark server
# (see tirx_kernels/bench_suite/README.md)
python -m tirx_kernels.bench_suite --server http://127.0.0.1:8901

Programmatic API

Every kernel module exposes a small, uniform interface (see tirx_kernels/_protocol.py):

from tirx_kernels.registry import discover_kernels

kernels = discover_kernels()          # {name: module}
mod = kernels["fp16_bf16_gemm"]

mod.run_test(M=1024, N=1024, K=1024)  # compile + run + correctness check
mod.run_bench(M=1024, N=1024, K=1024) # profile (needs a GPU)

func = mod.get_kernel(M=1024, N=1024, K=1024)  # the TIRx PrimFunc

A native module uses its workload as KERNEL_META["category"] (e.g. kda); a port uses ported.<upstream> (e.g. ported.flashinfer). Registry category filters use those same names. CLI kernel names are independent of module paths.

Each module also provides KERNEL_META: its name, category, exact runtime_cuda_archs, and optional correctness-only reference_requirements. The registry and test harness reject unsupported architectures before compile, and skip correctness before GPU work when a declared reference package, version, or Git source identity is unavailable. CONFIGS contains the test parameter sweep.

License

Except where otherwise noted, this project is licensed under the Apache License 2.0; see LICENSE. Required Apache attribution notices are collected in NOTICE.

Every Python source file carries SPDX tags. Kernel ports derived from third-party projects (cuDNN Frontend, DeepGEMM, DeepEP, fast.cu, FlashMLA, flash-attention, flash-attention-fp4, FlashInfer, MSA) additionally cite the upstream project and the exact commit ported, retain the upstream copyright notice, and declare the combined terms — for example Apache-2.0 AND MIT. Where an upstream license requires its conditions text to travel with the source, that text is kept in the file verbatim. The third-party section at the end of LICENSE lists which components fall under which license, and licenses/ holds the corresponding license texts.

Metadata

Release files for tirx-kernels 0.1.3rc1

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

Source distribution (sdist)

Source distribution for tirx-kernels 0.1.3rc1
File Size Uploaded Provenance Actions
tirx_kernels-0.1.3rc1.tar.gz 2.4 MB With provenance Details for tirx_kernels-0.1.3rc1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tirx-kernels 0.1.3rc1
File Interpreter ABI Platform Actions
tirx_kernels-0.1.3rc1-py3-none-any.whl Python 3 none any Details for tirx_kernels-0.1.3rc1-py3-none-any.whl

Total release size: 5.0 MB

Release files / tirx_kernels-0.1.3rc1.tar.gz

Download URL tirx_kernels-0.1.3rc1.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
fb2873bfee6c0c5e38d30124485027a2cca1176c1a1afcac436785c0617fb31f
BLAKE2b-256 checksum
How to use checksums
fa67dc2971ab850eed0059fde656ca52409e70f184afb093cca2f6a7bfbc2f6d
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 Nov 12, 2026.

Transparency log

Release files / tirx_kernels-0.1.3rc1-py3-none-any.whl

Download URL tirx_kernels-0.1.3rc1-py3-none-any.whl
Size 2.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e9be89a1494d28dc969e192b43d8e759ffb9e9122641147b3d6ee20ddaf61e06
BLAKE2b-256 checksum
How to use checksums
be393f4ba4652ed7364d6ef2966706170ee68e8c36645b7fd169bc0062dd135d
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 Nov 12, 2026.

Transparency log

Security for tirx-kernels 0.1.3rc1

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 tirx_kernels-0.1.3rc1.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 Nov 12, 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