Skip to main content

TCL kernels for NPU

Project description

furiosa-kernels

A Python package providing TCL kernels as reusable Kernel data objects.

Install

cd /path/to/npu-tools/furiosa-kernels
pip install -e ".[dev]"

Test

pytest tests/ -v

Usage

Load a kernel from a .tc file

from furiosa_kernels import Kernel

k = Kernel.from_file(name='my_kernel', path='path/to/my_kernel.tc')
print(k.dsl)

Build a kernel with Python eDSL

import furiosa.tcl as tcl
from furiosa_kernels import Kernel

@tcl.kernel
def my_kernel(
    weight: bf16[E, D, F],
    gather_index: i32[G],
) -> bf16[G, D, F]:
    output: bf16[G, D, F] = tcl.gather(weight, gather_index, E)
    return output

k = Kernel.from_edsl(my_kernel)
print(k.dsl)

CLI: convert eDSL to DSL

scripts/run_kernel.py converts @tcl.kernel functions to TCL IR:

# Print generated DSL for a kernel
python scripts/run_kernel.py convert path/to/kernels.py my_kernel

# List all @tcl.kernel functions in a file
python scripts/run_kernel.py list path/to/kernels.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

furiosa_kernels-2026.3.0-py3-none-any.whl (507.3 kB view details)

Uploaded Python 3

File details

Details for the file furiosa_kernels-2026.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for furiosa_kernels-2026.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e9b66f982173c3b7c63f1d5d96ccef53f69421839b27cd88e7be10a74bbb18c
MD5 2c677f18f535b1aef1150cdd1703ff9b
BLAKE2b-256 c98796f0bcee0c8cc0ed24708e4cfc0bc141709a69d54a4d1ec02a04c4850ded

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page