{"id":46641,"library":"tokenspeed-triton","title":"TokenSpeed Triton","description":"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.","status":"active","version":"3.7.10.post20260531","language":"python","source_language":"en","source_url":"https://github.com/triton-lang/triton/","tags":["triton","gpu","compiler","deep-learning","tokenspeed"],"install":[{"cmd":"pip install tokenspeed-triton","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for GPU tensor operations and integration.","package":"torch","optional":false},{"reason":"Optional for model serving integration.","package":"litellm","optional":true}],"imports":[{"wrong":"import triton","symbol":"JITFunction","correct":"from tokenspeed_triton import JITFunction"},{"wrong":"import triton","symbol":"autotune","correct":"from tokenspeed_triton import autotune"},{"wrong":"import triton","symbol":"compile","correct":"from tokenspeed_triton import compile"}],"quickstart":{"code":"import torch\nimport triton\nimport triton.language as tl\n\n@triton.jit\ndef add_kernel(x_ptr, y_ptr, output_ptr, n_elements, BLOCK_SIZE: tl.constexpr):\n    pid = tl.program_id(axis=0)\n    block_start = pid * BLOCK_SIZE\n    offsets = block_start + tl.arange(0, BLOCK_SIZE)\n    mask = offsets < n_elements\n    x = tl.load(x_ptr + offsets, mask=mask)\n    y = tl.load(y_ptr + offsets, mask=mask)\n    output = x + y\n    tl.store(output_ptr + offsets, output, mask=mask)\n\ndef add(x: torch.Tensor, y: torch.Tensor):\n    output = torch.empty_like(x)\n    n_elements = output.numel()\n    grid = lambda meta: (triton.cdiv(n_elements, meta['BLOCK_SIZE']),)\n    add_kernel[grid](x, y, output, n_elements, BLOCK_SIZE=1024)\n    return output\n\n# Example usage\ndevice = 'cuda' if torch.cuda.is_available() else 'cpu'\nx = torch.randn(10000, device=device)\ny = torch.randn(10000, device=device)\nresult = add(x, y)\nprint(result[:5])","lang":"python","description":"Defines a Triton kernel for element-wise addition and launches it with a grid."},"warnings":[{"fix":"Use `from triton.testing import do_bench` for benchmarking.","message":"In version 3.0+, the function `triton.jit` no longer accepts `device` and `do_bench` arguments; use `triton.testing.do_bench` instead.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Always do `import triton.language as tl` in addition to `import triton`.","message":"Importing submodules like `triton.language` without an explicit `import triton.language` may fail if only `import triton` is used.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace `@triton.kernel` with `@triton.jit`.","message":"The `triton.kernel` decorator is deprecated in favor of `triton.jit`.","severity":"deprecated","affected_versions":">=2.0"},{"fix":"Use `tl.constexpr` for parameters that determine memory layout (e.g., BLOCK_SIZE).","message":"Dynamic shapes require `tl.constexpr` for block sizes; using variable block sizes leads to JIT recompilation overhead.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'-3.14':23 '3.10':22 '3.7.10':18 'cadenc':25 'compil':6,37 'current':16 'custom':8 'deep':9,39 'deep-learn':38 'follow':26 'gpu':36 'languag':4 'learn':10,40 'oper':11 'patch':34 'post20260531':19 'python':21 'releas':13,24,29 'requir':20 'specif':33 'tokenspe':1,15,32,41 'tokenspeed-specif':31 'triton':2,28,35 'upstream':27 'vendor':12 'version':17","created_at":"2026-06-07T13:00:54.833033+00:00","updated_at":"2026-06-07T13:00:54.833033+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/triton-lang/triton/","github":"https://github.com/triton-lang/triton/","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}