Skip to content
KernelIndex
Search⌘K

submission 676519

allan_g4073 · python · License unknown

Use it

Vendorable · source mirrored · license unknownView source →

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

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

Reported · How evidence levels are derived →

Source and license

sourceavailable
revision digestsha256:f49b110f818849f197f9f4e2662fb2c2e655d0fa4a414e530c82d8329025aeb2
license declaredunknown
license concludedunknown
authorsallan_g4073
imported2026-08-26

Techniques

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

fp4MXFP4 量化矩阵乘法 - MI355X 优化版本

Kernel source

submission.py48 lines
#!POPCORN leaderboard amd-mxfp4-mm
#!POPCORN gpu MI355X

"""
MXFP4 量化矩阵乘法 - MI355X 优化版本
优先使用 aiter 的优化内核,fallback 到 gemm_a4w4
"""
from task import input_t, output_t
import torch


def custom_kernel(data: input_t) -> output_t:
    """
    MXFP4 GEMM: A @ B^T = C
    
    输入 (A, B, B_q, B_shuffle, B_scale_sh):
        A:          [M, K]      bf16
        B_shuffle:  [N, K/2]    fp4 (preshuffle)
        B_scale_sh: [N, K/32]   e8m0
    """
    A, B, B_q, B_shuffle, B_scale_sh = data
    
    A = A.contiguous()
    M, K = A.shape
    N = B.shape[0]
    
    # MXFP4 量化 A
    from aiter.ops.triton.quant import dynamic_mxfp4_quant
    from aiter.utility.fp4_utils import e8m0_shuffle
    from aiter import dtypes
    
    A_fp4, A_scale = dynamic_mxfp4_quant(A)
    A_scale_sh = e8m0_shuffle(A_scale)
    
    # 使用 aiter gemm_a4w4(MI355X 优化)
    import aiter
    
    out = aiter.gemm_a4w4(
        A_fp4.view(dtypes.fp4x2),
        B_shuffle,
        A_scale_sh.view(dtypes.fp8_e8m0),
        B_scale_sh,
        dtype=dtypes.bf16,
        bpreshuffle=True,
    )
    
    return out
scrolls · 48 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