submission 553343
kitrak_rev. · python · License unknown
Use it
Vendorable · source mirrored · license unknownView source →
No package. Vendor the mirrored source: 70 lines, June 9 Researcher Reciprocity License v1.0.
submission.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-fp8-quant-553343?include=source"interfacepython
Compatibility
measured onNVIDIA B200
declared hardwareNVIDIA B200
architecturessm_100
dtypesfp32
Benchmark evidence
1 measurement across 1 GPU, fastest first.
Operation / workload
Hardware
Latency
Rank
Observed
Reported · How evidence levels are derived →
Source and license
sourceavailable
revision digestsha256:ad6afc263ce0d05cd91c9591045c6e926ddb837387068c4b94361b02e3cbd577
license declaredunknown
license concludedunknown
authorskitrak_rev.
imported2026-08-15
Techniques
Extracted from the mirrored source by pattern, never inferred. Each row cites its line.
num-warps = 8
(1, 256, 64): helion.Config(block_sizes=[16], num_warps=8, num_stages=1),stages = 1
(1, 256, 64): helion.Config(block_sizes=[16], num_warps=8, num_stages=1),Kernel source
submission.py70 lines
#!POPCORN leaderboard fp8_quant
#!POPCORN gpu B200_Nebius
from task import input_t, output_t
import torch
import helion
import helion.language as hl
from pathlib import Path
# Per-shape configs from autotuning. KernelBot does NOT have /opt/booster_pack/ - use minimal config (block_sizes, num_warps, num_stages only).
# Full autotuned configs with ACF-specific params (indexing, load_eviction_policies, etc.) fail without ACF.
SHAPE_CONFIGS: dict[tuple, helion.Config] = {
# Test shapes
(1, 256, 64): helion.Config(block_sizes=[16], num_warps=8, num_stages=1),
(4, 512, 128): helion.Config(block_sizes=[32], num_warps=8, num_stages=2),
(16, 1024, 64): helion.Config(block_sizes=[16], num_warps=8, num_stages=1),
(1, 4096, 128): helion.Config(block_sizes=[8], num_warps=2, num_stages=1),
(8, 4096, 128): helion.Config(block_sizes=[32], num_warps=4, num_stages=1),
# Benchmark shapes
(16, 4096, 128): helion.Config(block_sizes=[1], num_warps=4, num_stages=1),
(256, 4096, 128): helion.Config(block_sizes=[8], num_warps=4, num_stages=3),
(256, 8192, 128): helion.Config(block_sizes=[8], num_warps=2, num_stages=1),
(4096, 7168, 128): helion.Config(block_sizes=[32], num_warps=8, num_stages=1),
}
def _make_kernel(config: helion.Config):
@helion.kernel(static_shapes=True, config=config)
def kernel(
data: torch.Tensor, # [N, G] input rows
qout: torch.Tensor, # [N, G] output buffer (writes in-place)
scales_out: torch.Tensor, # [N] output normalization factors
) -> None:
nrows = data.size(0)
ncols = hl.specialize(data.size(1))
MAX_VAL = 448.0
for rr in hl.tile(nrows):
row = data[rr, :].to(torch.float32)
amax = torch.amax(torch.abs(row), -1)
amax = torch.clamp(amax, min=1e-10)
scale = amax / MAX_VAL
qout[rr, :] = torch.clamp(row / scale[:, None], min=-448.0, max=448.0)
scales_out[rr] = scale
return kernel
_KERNELS = {shape: _make_kernel(cfg) for shape, cfg in SHAPE_CONFIGS.items()}
def custom_kernel(data: input_t) -> output_t:
x, x_q, x_s = data
T, H = x.shape
G = x_s.shape[1]
gsz = H // G
N = T * G
kernel = _KERNELS[(T, H, gsz)]
flat_in = x.reshape(N, gsz)
flat_q = x_q.reshape(N, gsz)
flat_s = x_s.reshape(N)
kernel(flat_in, flat_q, flat_s)
return x_q, x_s
scrolls · 70 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