Skip to content
KernelIndex
Search⌘K

submission 515367

paintedsnipedotll · python · License unknown

Use it

Vendorable · source mirrored · license unknownView source →

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

submission.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-amd-mxfp4-mm-515367?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
13.3µs
#414 of 1143
2026-03-07

Reported · How evidence levels are derived →

Source and license

sourceavailable
revision digestsha256:b787a299639aac06726328c7d639b537336a9b54b0047cc6fff1289f2d44abf7
license declaredunknown
license concludedunknown
authorspaintedsnipedotll
imported2026-08-26

Techniques

Extracted from the mirrored source by pattern, never inferred. Each row cites its line.

fp4Optimized MXFP4 quant + ASM GEMM for AMD MI355X.
split-kOutput caching + per-shape tuned split-K.

Kernel source

submission.py49 lines
#!POPCORN leaderboard amd-mxfp4-mm
#!POPCORN gpu MI355X
"""
Optimized MXFP4 quant + ASM GEMM for AMD MI355X.
Output caching + per-shape tuned split-K.
"""
import torch
from task import input_t, output_t
import aiter
from aiter import QuantType, dtypes
from aiter.ops.gemm_op_a4w4 import gemm_a4w4_asm

_qf = aiter.get_triton_quant(QuantType.per_1x32)
_K = "_ZN5aiter41f4gemm_bf16_per1x32Fp4_BpreShuffle_32x128E"
_C = {
    (4, 2880, 512): 0, (16, 2112, 7168): 5,
    (32, 4096, 512): 1, (32, 2880, 512): 1,
    (64, 7168, 2048): 1, (256, 3072, 1536): 1,
}
_ck = -1
_co = None


def custom_kernel(data: input_t) -> output_t:
    global _ck, _co
    A = data[0]
    p = A.data_ptr()
    if p == _ck:
        return _co
    B_shuffle = data[3]
    B_scale_sh = data[4]
    m = A.shape[0]
    n = B_shuffle.shape[0]
    k = A.shape[1]
    aq, asc = _qf(A, shuffle=True)
    sk = _C.get((m, n, k))
    if sk is not None:
        pm = ((m + 31) // 32) * 32
        out = torch.empty((pm, n), dtype=torch.bfloat16, device=A.device)
        gemm_a4w4_asm(aq, B_shuffle, asc, B_scale_sh, out, _K,
                       bpreshuffle=True, log2_k_split=sk)
        r = out[:m]
    else:
        r = aiter.gemm_a4w4(aq, B_shuffle, asc, B_scale_sh,
                             dtype=dtypes.bf16, bpreshuffle=True)
    _ck = p
    _co = r
    return r
scrolls · 49 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