Skip to content
KernelIndex
Search⌘K

submission 614253

KingOfZhao · python · License unknown

Use it

Vendorable · source mirrored · license unknownView source →

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

mx_fp4_mm_optimized.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-amd-mxfp4-mm-614253?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
24.0µs
#863 of 1143
2026-03-23

Reported · How evidence levels are derived →

Source and license

sourceavailable
revision digestsha256:ed476c3c27d93bcf569830180c7c39d864572620ad35da0ee0e7bca1d6ab8f7e
license declaredunknown
license concludedunknown
authorsKingOfZhao
imported2026-08-26

Techniques

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

fp4MXFP4 GEMM — Zhao Dylan

Kernel source

mx_fp4_mm_optimized.py26 lines
#!POPCORN leaderboard amd-mxfp4-mm
#!POPCORN gpu MI355X
"""
MXFP4 GEMM — Zhao Dylan
优化: 模块级import, 消除冗余contiguous/变量, 内联quant, 最小Python开销
"""
from task import input_t, output_t
import aiter
from aiter import dtypes
from aiter.ops.triton.quant import dynamic_mxfp4_quant
from aiter.utility.fp4_utils import e8m0_shuffle


def custom_kernel(data: input_t) -> output_t:
    A, B, B_q, B_shuffle, B_scale_sh = data
    # MXFP4 动态量化 A (Triton kernel)
    A_fp4, A_scale = dynamic_mxfp4_quant(A)
    # dtype转换 + scale shuffle (为CK GEMM tile对齐)
    A_q = A_fp4.view(dtypes.fp4x2)
    A_scale_sh = e8m0_shuffle(A_scale).view(dtypes.fp8_e8m0)
    # CK gemm_a4w4: MXFP4×MXFP4 → bf16
    return aiter.gemm_a4w4(
        A_q, B_shuffle, A_scale_sh, B_scale_sh,
        dtype=dtypes.bf16, bpreshuffle=True,
    )

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

Best evidence level for this revision: reported

JSON