Skip to content
KernelIndex
Search⌘K

submission 651473

Shiyi Lin · python · License unknown

Use it

Vendorable · source mirrored · license unknownView source →

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

submission_mxfp4_v14.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-amd-mxfp4-mm-651473?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.4µs
#1080 of 1143
2026-03-28

Reported · How evidence levels are derived →

Source and license

sourceavailable
revision digestsha256:48402114ea711e9cc303cbbff461d5cabac22452134fc4f4a7140da6ddd14d59
license declaredunknown
license concludedunknown
authorsShiyi Lin
imported2026-08-26

Techniques

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

fp4'fp4': torch.empty((M, K//2), dtype=torch.uint8, device=A.device),

Kernel source

submission_mxfp4_v14.py64 lines

import torch

from task import input_t, output_t

from aiter import dtypes

import aiter

from aiter.ops.triton.quant import dynamic_mxfp4_quant

from aiter.utility.fp4_utils import e8m0_shuffle

_out_cache = {}

_quant_cache = {}

def custom_kernel(data: input_t) -> output_t:

    A, B, B_q, B_shuffle, B_scale_sh = data

    M, K = A.shape

    N = B.shape[0]

    # 预分配量化输出

    key = (M, K)

    if key not in _quant_cache:

        _quant_cache[key] = {

            'fp4': torch.empty((M, K//2), dtype=torch.uint8, device=A.device),

            'scale': torch.empty(((K+31)//32, M), dtype=torch.uint8, device=A.device).T,

        }

    A_fp4, A_scale = dynamic_mxfp4_quant(A)

    A_scale = e8m0_shuffle(A_scale)

    A_fp4 = A_fp4.view(dtypes.fp4x2)

    A_scale = A_scale.view(dtypes.fp8_e8m0)

    return aiter.gemm_a4w4(

        A_fp4,

        B_shuffle,

        A_scale,

        B_scale_sh,

        dtype=dtypes.bf16,

        bpreshuffle=True,

    )

scrolls · 64 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