Skip to main content
Pre-release

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

Tensor Contraction Language

Tensor Contraction Language (TCL) is a Python-embedded language for writing NPU kernels, provided by furiosa.tcl. Kernels built with it live in furiosa-kernels, which depends on this package.

Installation

Install from PyPI Package

uv pip install furiosa-tcl

Install from source

uv sync

Tests

Runnable examples are in src/furiosa/tcl/examples.

uv run pytest

Changelog

TCL will be released into public in the end of November 2026.

Compatibility


Tensor Contraction Language

Tensor Contraction Language (TCL) is a Python-embedded language for writing NPU kernels, provided by furiosa.tcl. Kernels built with it live in furiosa-kernels, which depends on this package.

Installation

Python 3.12 or newer is required.

Install from PyPI Package

uv pip install furiosa-tcl

Install from source

uv sync

Usage

Write a kernel with @tcl.kernel, then bind its axes with its instantiate method to get a Kernel with its TCL IR:

from __future__ import annotations

import furiosa.tcl as tcl

@tcl.kernel
def gather(weight: bf16[E, D], index: i32[G]) -> bf16[G, D]:
    return tcl.gather(weight, index, E)

k = gather.instantiate(bindings={'E': 64, 'D': 128, 'G': 8})
print(k.dsl)  # TCL IR: def gather<D=128, E=64, G=8>(...)

instantiate also takes config= for compilation-wide compiler settings, keyed by tcl.CompilerOption members or strings. Candidates declared with @tcl.kernel(auto_config=...) are tuned with AUTOEXPR_MODE=tune; tcl.CompilerOption.AUTOEXPR_EVALUATION selects how they are compared.

Runnable examples are in src/furiosa/tcl/examples.

Ordered auto config rules

In the default AUTOEXPR_MODE=use, a kernel reads its sibling *.auto_config.json (or its explicit auto_config_path). Records are evaluated in array order, and the first matching record supplies all autoexpr values. The function selector can specify only the specialization arguments that matter. Omitted arguments are unconstrained. A bare function name matches every specialization of that function, so put it after exceptions to provide a default:

[
  {
    "function": "project_vocabulary<T=2>",
    "revision": "manual",
    "values": {
      "use_cluster_split": true
    }
  },
  {
    "function": "project_vocabulary",
    "revision": "manual",
    "values": {
      "use_cluster_split": false
    }
  }
]

Here every T=2 bucket uses true, regardless of D, V_INNER, weight_first, or other arguments. A bucket such as project_vocabulary<D=2880, T=16, V_INNER=204800, V_ORIGINAL=201088, V_OUTER=1, V_PADDED=204800, cluster_split=False, final_logit_softcapping=0.0, output_multiplier=1.0, weight_first=True> uses the fallback false without enumerating that bucket in JSON.

Multiple conditions, such as project_vocabulary<D=2880, T=2>, must all match; their order does not matter. Values must match their spelling in the TCL IR function name exactly. Fully specified records continue to work. Duplicate selectors, including reordered conditions, are errors. Optional arguments appear as bias=None or bias=Some; omit bias from a manual selector to match both.

Rules do not merge values or prefer more specific conditions. Each selected record must specify every autoexpr parameter with a valid type and candidate. A matching record with invalid values raises an error instead of falling through. Put exceptions before broad rules: any later rule covered by an earlier one is unreachable. If no rule matches, the declared candidates remain available for search as before.

AUTOEXPR_MODE=tune ignores all stored rules and searches the declared candidates. The writer removes any existing record with the identical full function name and puts the tuned full-name record at the beginning of the file. This also moves an existing result ahead of partial selectors or defaults that previously shadowed it. Other records keep their relative order and values. Subsequent use runs therefore select the tuned result for that specialization, while other buckets continue to use the existing rules. Tracing in use mode never rewrites the JSON.

Tests

uv run pytest
uv run typecheck/run --check

tcl-fuzz, a fuzzing library for TCL, has its own README.

Changelog

TCL will be released into public until the end of November 2026.

Compatibility

Status Compatibility Examples
Stable Preserved until deprecated Unmarked public APIs
Preview Same deprecation policy as Stable; documentation may not yet be comprehensive, and performance and stability are still being refined tcl.Dram, tcl.autoexpr, tcl.core.call, tcl.CompilerOption
Experimental Can change or be removed without deprecation; documentation may be insufficient, and performance and stability are not guaranteed; not recommended for end users tcl.experimental.*
Deprecated Still works and emits a FutureWarning with migration guidance; support ends in the next release tcl.copy, tcl.context, tcl.ShardedAxis

Preview APIs keep their import paths when stabilized. Experimental APIs live only in tcl.experimental; every other non-stable API is Preview. Deprecation can cover a whole API or only part of it.

Metadata

Release files for furiosa-tcl 2026.6.0b0

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

Built distribution (wheel)

Table of built distributions (wheels) for furiosa-tcl 2026.6.0b0
File Interpreter ABI Platform Actions
furiosa_tcl-2026.6.0b0-py3-none-any.whl Python 3 none any Details for furiosa_tcl-2026.6.0b0-py3-none-any.whl

Release files / furiosa_tcl-2026.6.0b0-py3-none-any.whl

Download URL furiosa_tcl-2026.6.0b0-py3-none-any.whl
Size 390.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
935c26f565867dcff9fad40a3beb50ee66dd8cf3b797fa6b3f0dda934b4fede0
BLAKE2b-256 checksum
How to use checksums
4d9955210e186fa6ffa89482bc4b5e02777f507ab2bb4477d17cde8e3322ad0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Security for furiosa-tcl 2026.6.0b0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release
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