Skip to content
KernelIndex
Search⌘K

submission 513577

Denis Gavriloff · python · License unknown

Use it

Vendorable · source mirrored · license unknownView source →

No package. Vendor the mirrored source: 45 lines, June 9 Researcher Reciprocity License v1.0.

submission_v2_triton_quant.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-amd-mxfp4-mm-513577?include=source"
interfacepython
Compatibility
measured onAMD Instinct MI355X
declared hardwareAMD Instinct MI355X
architecturesgfx950
dtypesbf16, mxfp4

Benchmark evidence

1 measurement across 1 GPU, fastest first.

Operation / workload
Hardware
Latency
Rank
Observed
AMD MXFP4 GEMMsuite of 6 cases
AMD Instinct MI355X
398.5µs
#1140 of 1143
2026-03-06

Reported · How evidence levels are derived →

Source and license

sourceavailable
revision digestsha256:851ce5c258c4df6b36ee3ddbdc0363b83a2e93726fd95c54775bb2963e33adeb
license declaredunknown
license concludedunknown
authorsDenis Gavriloff
imported2026-08-26

Kernel source

submission_v2_triton_quant.py45 lines
"""
V2 variant: Same CUDA graph approach but with Triton quant instead of HIP quant.
Try this if HIP quant is slower or unavailable.
"""
import torch
from task import input_t, output_t
import aiter
from aiter import QuantType, dtypes

_quant = aiter.get_triton_quant(QuantType.per_1x32)
_graphs: dict = {}
_no_graph: set = set()


def custom_kernel(data: input_t) -> output_t:
    A, _, _, B_shuffle, B_scale_sh = data
    key = (A.data_ptr(), B_shuffle.data_ptr(), B_scale_sh.data_ptr())

    cached = _graphs.get(key)
    if cached is not None:
        cached[0].replay()
        return cached[1]

    A_q, A_s = _quant(A, shuffle=True)
    out = aiter.gemm_a4w4(
        A_q, B_shuffle, A_s, B_scale_sh,
        dtype=dtypes.bf16, bpreshuffle=True,
    )

    if key not in _no_graph:
        try:
            torch.cuda.synchronize()
            g = torch.cuda.CUDAGraph()
            with torch.cuda.graph(g):
                _aq, _as = _quant(A, shuffle=True)
                _out = aiter.gemm_a4w4(
                    _aq, B_shuffle, _as, B_scale_sh,
                    dtype=dtypes.bf16, bpreshuffle=True,
                )
            _graphs[key] = (g, _out)
        except Exception:
            _no_graph.add(key)

    return out
scrolls · 45 lines total

Source code from GPU Mode and the KernelBot dataset · June 9 Researcher Reciprocity License v1.0

Best evidence level for this revision: reported

JSON