Skip to main content

ttfs

TriTon Frontend Supercharged

ttfs_ext is optional. Ordinary TTFS imports, kernels and tests use native Triton/Gluon without it. TTFS integration tests for the extension live in test/extension and skip when the extension is unavailable. Run that directory separately with the matching extension wheel installed:

PYTHONPATH=src python -m pytest -p ttfs_ext test/extension

-p ttfs_ext imports the compiler plugin before test collection initializes Triton or TTFS. If native Triton/TTFS was already initialized without the plugin, the integration kernel modules skip instead of changing that process's backend.

NPO2 TMA (experimental)

Import ttfs_ext before Triton/TTFS. Triton 3.7.1 and 3.8.0 support a constexpr first-axis TMA extent over a padded allocation:

B = ttfs.TensorDescCreator("N,K", {"N": "BN", "K": "BK"})
B = B.with_npo2_dim(dim=0, size="N_REAL")  # e.g. BN=128, BK=64, N_REAL=88
with ttfs.tensor_desc_creator_dispatch(is_gluon=True):
    b_desc = B.create_tma_desc(b)
    # Construct the tensor manager here, with BN/BK/N_REAL constexpr fields.

The expression is stored in block_sym_cfg and evaluated like block sizes. Pipeline setup constructs the device map once from the raw pointer, manager dimensions and existing stride resolution. Declare actual strides with tensor_desc_meta(...) for noncontiguous axes; other strides use contiguous inference as for ordinary pointer descriptors. Allocation shapes remain padded. Default iteration steps use the logical extent; explicit block_strides retain priority. Load barriers expect the actual transfer bytes, summed across the group.

For direct kernel usage, a pointer-backed TensorDesc provides desc.to_npo2_tma(shape, strides, block_shape, size="88", dim=0, layout=None). Use constexpr_fields=ttfs.mp.get_constexpr_field_dict(tm) for named expressions. It returns a new descriptor; existing tensor maps are rejected. On its blocked TMA descriptor, get_transfer_nbytes_cw() supplies the load expectation; get_block_nbytes_cw() continues to report padded capacity.

Device map storage uses Triton's scratch allocator, as native device descriptor creation does. Configure it before launch, for example with PyTorch:

triton.set_allocator(lambda size, alignment, stream:
    torch.empty(size, dtype=torch.uint8, device="cuda"))

Initial support is Gluon, SM90+, ranks 2–5, FP16/BF16 or FP8 E4M3/E5M2, one CTA, zero padding, at most 256 elements per padded dimension, and a nontransposed 32/64/128-byte inner row equal to the NVMMA swizzle width. Gather/scatter, reductions and multicast are rejected. Only the first physical axis can have a smaller issue extent; for example, [8, 2, 64] can issue [5, 2, 64], while all allocation dimensions stay padded. Unused first-axis slices in SMEM remain untouched; initialize them before full-tile reads. This feature changes TMA only; UMMA issue extents remain explicit.

NPO2 UMMA (experimental)

The ordinary unscaled UMMA functions and matching PipelineProducer methods accept an optional npo2_real_n constexpr integer:

ttfs.io.issue_mma_tn_async(acc, a_smem, b_smem,
                         use_acc=False, npo2_real_n=88)

npo2_real_n always names N of the logical result [M,N], including for issue_mma_nt_async and issue_mma_tt_async. None keeps the native path and does not require ttfs_ext. A custom extent requires the extension imported before Triton/TTFS, Triton 3.7.1 or 3.8.0, and Blackwell. Initial support is single-CTA matching shared FP16/BF16 or FP8 E4M3/E5M2 operands, packed FP32 TMEM with M=128 and one padded N=32..256 tile. The real N must be positive, divisible by 8 and within capacity; multicast is rejected. SMEM/TMEM allocation shapes stay padded.

For FP8, K must be divisible by 32 and operands use NVMMASharedLayout without FP4 padding. The TN path with physical B [N,K] supports N=72/88/120 over padded N=128; a [128,128] FP8 TMA tile uses 128-byte swizzling and 8-bit elements. N-major B (the TT/NT paths with contiguous N) requires real N divisible by 16. This is ordinary unscaled f8f6f4 MMA, without MXFP8 scale operands. The existing creator and producer arguments apply directly:

# Host, inside Gluon descriptor dispatch; REAL_N is a constexpr manager field.
b_creator = ttfs.TensorDescCreator("N,K", {"N": "128", "K": "128"})
b_desc = b_creator.with_npo2_dim(dim=0, size="REAL_N").create_tma_desc(b)
# Device, after waiting for the input pipeline's TMA completion.
producer = producer.issue_mma_tn_async(
    "acc", a_smem, b_smem, use_acc=False, npo2_real_n=tm.REAL_N)

Columns at or beyond the real N remain untouched. Initialize the whole accumulator if later code reads its padding. Existing predicates, attached completion barriers, explicit commits and waits keep their usual meaning; the extent does not add a completion wait. Extension-specific tests are in test/extension/test_npo2_umma.py.

Metadata

Release files for ttfs 0.6.9

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 ttfs 0.6.9
File Interpreter ABI Platform Actions
ttfs-0.6.9-py3-none-any.whl Python 3 none any Details for ttfs-0.6.9-py3-none-any.whl

Release files / ttfs-0.6.9-py3-none-any.whl

Download URL ttfs-0.6.9-py3-none-any.whl
Size 176.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
487140d38f298ce46fbaa297596abfaea43e4b0b7c8d4769c52b999da86fe36f
BLAKE2b-256 checksum
How to use checksums
6b99ab8a3659cbf78aaf50ef406a5a6a493d1c86c7460dc691dfb4a3896bbf41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for ttfs 0.6.9

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.

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