Instructions to use replicate/triton-kernels with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use replicate/triton-kernels with Kernels:
# !pip install kernels from kernels import get_kernel # a version (or an explicit revision) is required; see the "Files and versions" tab for the available ones kernel = get_kernel("replicate/triton-kernels", version=1) - Notebooks
- Google Colab
- Kaggle
Download build/torch-cuda/__init__.py from replicate/triton-kernels: direct link, hf CLI and curl.
- Browser
- Download file 423 Bytes
-
https://huggingface.co/replicate/triton-kernels/resolve/main/build/torch-cuda/__init__.py
- Command line
-
hf download hf://replicate/triton-kernels/build/torch-cuda/__init__.py
-
curl -L -o __init__.py https://huggingface.co/replicate/triton-kernels/resolve/main/build/torch-cuda/__init__.py
423 Bytes
| # Make sure to add this in the build folder as this won't build if we put that here | |
| # from . import matmul_ogs, tensor_details, numerics_details, tensor, swiglu, routing | |
| # __all__ = ["matmul_ogs" , "tensor_details", "numerics_details", "tensor", "swiglu", "routing"] | |
| # Then, run the following code to build the kernels: | |
| # docker run --rm \ | |
| # -v $(pwd):/app \ | |
| # -w /app \ | |
| # ghcr.io/huggingface/kernel-builder:main | |