Skip to content
KernelIndex
Search⌘K

deepgemm_m_grouped_fp8_fp4_masked_g4_n2048_k2048

FlashInfer-Bench baselines · python · Apache-2.0

Use it

Vendorable · source mirrored · Apache-2.0View source →

No package. Vendor the mirrored source: 23 lines, Apache-2.0, pinned at da91508.

main.py
curl "https://kernelindex.com/api/v1/implementations/flashinfer-deepgemm-m-grouped-fp8-fp4-masked-g4-n2048-k2048?include=source"
interfacepython
revisionda915083d4c7
symbolrun
pathmain.py
Compatibility
measured onNVIDIA B200
declared hardwareNVIDIA B200
architecturessm_100
dtypesfp32, fp8_e4m3, int32, int8

Benchmark evidence

2 measurements across 1 GPU, fastest first.

Operation / workload
Hardware
Latency
Rank
Observed
Grouped GEMM FP8 fp4 m masked g4 n2048 k2048fp32/fp8_e4m3 · [4, 512, 2048]
NVIDIA B200
147.3µs
#1 of 2
2026-06-06
Grouped GEMM FP8 fp4 m masked g4 n2048 k2048fp32/fp8_e4m3 · [4, 512, 2048]
NVIDIA B200
153.2µs
#2 of 2
2026-06-06

Reported · How evidence levels are derived →

Source and license

sourcehttps://huggingface.co/datasets/flashinfer-ai/flashinfer-trace
commitda915083d4c7c5e61aa3005e3d17ae488e0fc71c
revision digestsha256:930d7077bf71491d77be0e954bd91eecd725caf66ab74ea4d03456d480ca9b73
license declaredApache-2.0
license concludedApache-2.0
authorsbaseline
imported2026-08-16

Kernel source

main.py23 lines
import torch
import deep_gemm


def run(a_fp8, a_scale, b_fp4, b_scale, masked_m, expected_m):
    G, max_m, k = a_fp8.shape
    n = b_fp4.shape[1]
    em = int(expected_m)
    deep_gemm.set_mk_alignment_for_contiguous_layout(
        deep_gemm.get_theoretical_mk_alignment_for_contiguous_layout(em)
    )
    d = torch.empty(G, max_m, n, device=a_fp8.device, dtype=torch.bfloat16)
    deep_gemm.m_grouped_fp8_fp4_gemm_nt_masked(
        (a_fp8, a_scale), (b_fp4, b_scale), d, masked_m, em,
        disable_ue8m0_cast=False, recipe_a=(1, 128), recipe_b=(1, 32),
    )
    out = torch.zeros_like(d)
    for g in range(G):
        mm = int(masked_m[g])
        if mm > 0:
            out[g, :mm] = d[g, :mm]
    return out

Source code from FlashInfer-Bench (flashinfer-ai/flashinfer-trace) · Apache-2.0

Best evidence level for this revision: reported

JSON