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
File size: 819 Bytes
567c8ad 9c3f05a 567c8ad 9c3f05a 567c8ad 9c3f05a 567c8ad | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | import pytest
import triton
def pytest_addoption(parser):
parser.addoption("--device", action="store", default="cuda")
@pytest.fixture
def device(request):
return request.config.getoption("--device")
@pytest.fixture
def fresh_knobs(monkeypatch):
try:
_ver_str = getattr(triton, "__version__", "0.0.0").split("+")[0]
_parts = _ver_str.split(".")
_ver_tuple = tuple(int(p) for p in (_parts + ["0", "0", "0"])[:3])
except Exception:
_ver_tuple = (0, 0, 0)
from triton._internal_testing import _fresh_knobs_impl
if _ver_tuple > (3, 4, 0):
fresh_function, reset_function = _fresh_knobs_impl()
else:
fresh_function, reset_function = _fresh_knobs_impl(monkeypatch)
try:
yield fresh_function()
finally:
reset_function()
|