Registry / ai-ml / tokenspeed-triton

tokenspeed-triton

JSON →
library3.7.10.post20260531pypypi✓ verified 82d ago

A language and compiler for custom Deep Learning operations, vendor release for TokenSpeed. Current version 3.7.10.post20260531, requires Python 3.10-3.14. Release cadence follows upstream Triton releases with TokenSpeed-specific patches.

pip install tokenspeed-triton
INSTALL
IMPORT
SIG · TOKENSPEED-TRITON
T
tokenspeed-triton
ai-mlpythonv3.7.10.post20260531
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

JITFunction
from tokenspeed_triton import JITFunction
import triton
autotune
from tokenspeed_triton import autotune
import triton
compile
from tokenspeed_triton import compile
import triton

Defines a Triton kernel for element-wise addition and launches it with a grid.

import torch import triton import triton.language as tl @triton.jit def add_kernel(x_ptr, y_ptr, output_ptr, n_elements, BLOCK_SIZE: tl.constexpr): pid = tl.program_id(axis=0) block_start = pid * BLOCK_SIZE offsets = block_start + tl.arange(0, BLOCK_SIZE) mask = offsets < n_elements x = tl.load(x_ptr + offsets, mask=mask) y = tl.load(y_ptr + offsets, mask=mask) output = x + y tl.store(output_ptr + offsets, output, mask=mask) def add(x: torch.Tensor, y: torch.Tensor): output = torch.empty_like(x) n_elements = output.numel() grid = lambda meta: (triton.cdiv(n_elements, meta['BLOCK_SIZE']),) add_kernel[grid](x, y, output, n_elements, BLOCK_SIZE=1024) return output # Example usage device = 'cuda' if torch.cuda.is_available() else 'cpu' x = torch.randn(10000, device=device) y = torch.randn(10000, device=device) result = add(x, y) print(result[:5])
Debug
Known issues
breakingIn version 3.0+, the function `triton.jit` no longer accepts `device` and `do_bench` arguments; use `triton.testing.do_bench` instead.
fix
Use `from triton.testing import do_bench` for benchmarking.
affects: >=3.0.0
gotchaImporting submodules like `triton.language` without an explicit `import triton.language` may fail if only `import triton` is used.
fix
Always do `import triton.language as tl` in addition to `import triton`.
affects: all
deprecatedThe `triton.kernel` decorator is deprecated in favor of `triton.jit`.
fix
Replace `@triton.kernel` with `@triton.jit`.
affects: >=2.0
gotchaDynamic shapes require `tl.constexpr` for block sizes; using variable block sizes leads to JIT recompilation overhead.
fix
Use `tl.constexpr` for parameters that determine memory layout (e.g., BLOCK_SIZE).
affects: all
Upgrade
Version history
3.7.10.post20260531latest on PyPI · released May 31, 2026
Audit
Dependencies
torchrequiredRequired for GPU tensor operations and integration.
litellmoptionalOptional for model serving integration.
Agent activity
17 hits · last 30 days
node
15
OpenAI (training)
1
Resources
tokenspeed-triton — pip install tokenspeed-triton · libregistry