Instructions to use kernels-community/triton_kernels with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use kernels-community/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("kernels-community/triton_kernels", version=1) - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files
torch-ext/triton_kernels/matmul_ogs_details/opt_flags.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
# fmt: off
|
| 3 |
from dataclasses import dataclass
|
| 4 |
import triton
|
| 5 |
-
from
|
| 6 |
import torch
|
| 7 |
from .opt_flags_details import opt_flags_amd, opt_flags_nvidia
|
| 8 |
|
|
|
|
| 2 |
# fmt: off
|
| 3 |
from dataclasses import dataclass
|
| 4 |
import triton
|
| 5 |
+
from ..target_info import get_cdna_version
|
| 6 |
import torch
|
| 7 |
from .opt_flags_details import opt_flags_amd, opt_flags_nvidia
|
| 8 |
|
torch-ext/triton_kernels/matmul_ogs_details/opt_flags_details/opt_flags_amd.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import torch
|
| 2 |
import triton
|
| 3 |
-
from
|
| 4 |
-
from
|
| 5 |
|
| 6 |
|
| 7 |
def compute_block_nk(n, block_m, grid_m, num_xcds, lhs_dtype, rhs_dtype, precision_config):
|
|
|
|
| 1 |
import torch
|
| 2 |
import triton
|
| 3 |
+
from ...target_info import get_cdna_version
|
| 4 |
+
from ...tensor import bitwidth
|
| 5 |
|
| 6 |
|
| 7 |
def compute_block_nk(n, block_m, grid_m, num_xcds, lhs_dtype, rhs_dtype, precision_config):
|
torch-ext/triton_kernels/matmul_ogs_details/opt_flags_details/opt_flags_nvidia.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import torch
|
| 2 |
import triton
|
| 3 |
from triton_kernels import target_info
|
| 4 |
-
from
|
| 5 |
-
from
|
| 6 |
-
from
|
| 7 |
|
| 8 |
|
| 9 |
def compute_grid_size(routing_data, m, n, block_m, block_n):
|
|
|
|
| 1 |
import torch
|
| 2 |
import triton
|
| 3 |
from triton_kernels import target_info
|
| 4 |
+
from ...tensor import get_layout, bitwidth, FP4
|
| 5 |
+
from ...tensor_details.layout import HopperMXScaleLayout
|
| 6 |
+
from ...numerics_details.mxfp_details._downcast_to_mxfp import MXFP_BLOCK_SIZE
|
| 7 |
|
| 8 |
|
| 9 |
def compute_grid_size(routing_data, m, n, block_m, block_n):
|