Skip to main content

Triton kernel repository

Project description

Conch :shell:

A "standard library" of Triton kernels.

What is Conch?

Conch is a central repository of Triton kernels for accelerating common AI operations. We strive to provide performant, well-written kernels that can be easily integrated into other projects. We also strive to support multiple hardware platforms (currently Nvidia and AMD).

Key Features

We support each of the following operations. Each operation is complete with a PyTorch-only reference implementation (and sometimes a reference implementation provided by another library, like vLLM), a microbenchmark, and a unit test.

  • Activation functions
    • GeLU and mul
    • SiLU and mul
  • Attention
    • Paged Attention (Flash-Decoding with Paged KV Cache)
    • Varlen Attention (Prefill/decode attention with paged KV cache)
  • Embedding
    • Rotary embedding
  • Normalization
    • Gemma-style RMS norm
    • Llama-style RMS norm
  • Quantization
    • bitsandbytes
      • NF4/FP4/8-bit blockwise quantize/dequantize
    • FP8 static quantization
    • Int8 static quantization
    • GEMM
      • Mixed-precision
      • Scaled
  • vLLM
    • KV cache operations
      • Copy blocks
      • Reshape and cache

Performance

The goal of Conch is not to claim that our operations are faster than CUDA implementations. Our goal is to write Triton operations that are as fast as the state-of-the-art CUDA implementations. This allows developers on any hardware platform (Nvidia, AMD, etc.) access to the same, performant kernels.

Below is a table comparing the relative performance of our Triton kernels to CUDA baselines (on NVIDIA H100). The listed runtime is the median runtime from 10,000 iterations on our microbenchmarks. Note: it's difficult to express the performance of a kernel with a single number (performance will vary with input sizes, data types, etc.). We tried our best to choose representative parameters for a fair comparison. Most relevant parameters are specified via CLI parameters to the microbenchmarks (benchmarks/), so feel free to collect your own results based on your use case. CUDA runtimes collected via vLLM and bitsandbytes (vllm==0.9.1 and bitsandbytes==0.46.0).

Operation CUDA Runtime Triton Runtime Triton Speedup
GeLU, Tanh, and Mul 0.722 ms 0.465 ms 1.55
SiLU and Mul 0.710 ms 0.046 ms 15.43
Paged Attention 0.740 ms 0.803 ms 0.92
Varlen Attention 0.360 ms 0.735 ms 0.49
Rotary Embedding 0.107 ms 0.103 ms 1.04
RMS Norm (Gemma-style) 2.320 ms 0.029 ms 80.00
RMS Norm (Llama-style) 0.042 ms 0.017 ms 2.47
bitsandbytes: Dequantize 0.073 ms 5.373 ms 0.01
bitsandbytes: Quantize 0.569 ms 5.511 ms 0.10
FP8 Static Quantization 0.025 ms 0.033 ms 0.76
Int8 Static Quantization 0.056 ms 0.033 ms 1.70
Mixed-precision GEMM [Int4 x FP16] 0.500 ms 1.656 ms 0.30
Scaled GEMM [Int8 x BF16] 0.206 ms 0.273 ms 0.75
vLLM: Copy Blocks 2.249 ms 1.818 ms 1.24
vLLM: Reshape and Cache 0.056 ms 0.021 ms 2.67

For additional analysis of kernel performance, check out our performance docs.

Supported platforms

Supported platforms:

  • Nvidia A10, CUDA 12.2
  • Nvidia H100, CUDA 12.2
  • AMD MI300X, ROCm 6.2.4

Work-in-progress platforms:

Getting Started

Users

Check out the installation instructions to get started!

Developers

Check out the developer instructions to get started!

Open-source credits

We were inspired by and leverage components of the following libraries:

License

Copyright 2025 Stack AV Co. Licensed under the Apache License, Version 2.0.

Project details


Download files

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

Source Distribution

conch_triton_kernels-1.2.1.tar.gz (111.2 kB view details)

Uploaded Source

Built Distribution

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

conch_triton_kernels-1.2.1-py3-none-any.whl (96.1 kB view details)

Uploaded Python 3

File details

Details for the file conch_triton_kernels-1.2.1.tar.gz.

File metadata

  • Download URL: conch_triton_kernels-1.2.1.tar.gz
  • Upload date:
  • Size: 111.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for conch_triton_kernels-1.2.1.tar.gz
Algorithm Hash digest
SHA256 5654c6d747d9746ac6daabdd8d31ce824c3004dffede91f922646670ccca936e
MD5 c49196547a3925b2f8f0f227f09c67ed
BLAKE2b-256 ee153d0de4bf4089e23e8ec642f480519d6618ce84098e72804aaa0cec9c980c

See more details on using hashes here.

File details

Details for the file conch_triton_kernels-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for conch_triton_kernels-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23034a8bd86c65108e0e8fc3cc684714fa869ddbf5f499b365377a495bd5bebc
MD5 e58bcdaaaef13efd9b81a3687d1d7393
BLAKE2b-256 0f5133cb64b6a998786d149fd713b31ee11a16fe968b903ac2c7264673a44301

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