Skip to content
KernelIndex
Search⌘K

submission 117927

lucifer_0000007 · python · License unknown

Use it

Vendorable · source mirrored · license unknownView source →

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

submission.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-nvfp4-gemm-117927?include=source"
interfacepython
Compatibility
measured onNVIDIA B200
declared hardwareNVIDIA B200
architecturessm_100
dtypesfp8_e4m3, nvfp4

Benchmark evidence

1 measurement across 1 GPU, fastest first.

Operation / workload
Hardware
Latency
Rank
Observed
NVFP4 GEMMsuite of 3 cases
NVIDIA B200
13.3µs
#123 of 369
2025-12-01

Reported · How evidence levels are derived →

Source and license

sourceavailable
revision digestsha256:45c7d632bd29c58a3805b7ae7a006c99e769adc94fa365bc6f03ae0d653252f2
license declaredunknown
license concludedunknown
authorslucifer_0000007
imported2026-08-26

Kernel source

submission.py27 lines
import torch
from task import input_t, output_t

def custom_kernel(data: input_t) -> output_t:
    a, b, _, _, sfa_permuted, sfb_permuted, c = data
    
    # Use select() for potentially faster single-dimension indexing
    sfa_0 = sfa_permuted.select(5, 0)
    sfb_0 = sfb_permuted.select(5, 0)
    
    # Permute
    sfa_perm = sfa_0.permute(2,4,0,1,3)
    sfb_perm = sfb_0.permute(2,4,0,1,3)
    
    # Reshape
    sa = sfa_perm.reshape(-1)
    sb = sfb_perm.reshape(-1)
    
    # All matrix operations with select()
    a_0 = a.select(2, 0)
    b_0_t = b.select(2, 0).t()
    c_0 = c.select(2, 0)
    
    # GEMM
    torch._scaled_mm(a_0, b_0_t, sa, sb, out=c_0, out_dtype=torch.float16)
    
    return c

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

Best evidence level for this revision: reported

JSON