submission 553217
the.defenestrator · python · License unknown
Use it
Vendorable · source mirrored · license unknownView source →
No package. Vendor the mirrored source: 82 lines, June 9 Researcher Reciprocity License v1.0.
submission.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-gated-deltanet-chunk-fwd-h-553217?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:3fb7ec399a31fe6e7ff7338d434275e35ceeff764fab2a7c0938ad049274db4c
license declaredunknown
license concludedunknown
authorsthe.defenestrator
imported2026-08-15
Techniques
Extracted from the mirrored source by pattern, never inferred. Each row cites its line.
num-warps = 4
(1, 64, 2, 64, 64): helion.Config(block_sizes=[], num_warps=4, num_stages=1),stages = 1
(1, 64, 2, 64, 64): helion.Config(block_sizes=[], num_warps=4, num_stages=1),Kernel source
submission.py82 lines
#!POPCORN leaderboard gated_deltanet_chunk_fwd_h
#!POPCORN gpu B200_Nebius
from task import input_t, output_t
import torch
import helion
import helion.language as hl
SHAPE_CONFIGS: dict[tuple, helion.Config] = {
(1, 64, 2, 64, 64): helion.Config(block_sizes=[], num_warps=4, num_stages=1),
(2, 128, 4, 64, 64): helion.Config(block_sizes=[], num_warps=4, num_stages=1),
(1, 256, 4, 64, 128): helion.Config(block_sizes=[], num_warps=4, num_stages=1),
(1, 64, 1, 64, 64): helion.Config(block_sizes=[], num_warps=4, num_stages=1),
(2, 512, 3, 64, 64): helion.Config(block_sizes=[], num_warps=8, num_stages=1),
(2, 1024, 3, 64, 64): helion.Config(block_sizes=[], num_warps=8, num_stages=1),
(3, 1024, 4, 100, 100): helion.Config(block_sizes=[], num_warps=4, num_stages=1),
(4, 1024, 4, 128, 128): helion.Config(block_sizes=[], num_warps=4, num_stages=1),
(2, 1536, 4, 128, 128): helion.Config(block_sizes=[], num_warps=4, num_stages=1),
(4, 2048, 8, 64, 64): helion.Config(block_sizes=[], num_warps=8, num_stages=1),
}
def _make_kernel(config: helion.Config):
@helion.kernel(static_shapes=True, dot_precision="ieee", config=config)
def kernel(
k: torch.Tensor,
w: torch.Tensor,
u: torch.Tensor,
g: torch.Tensor,
) -> tuple[torch.Tensor, torch.Tensor]:
B, T, H, K = k.shape
V = u.shape[-1]
C = 64
K = hl.specialize(K)
V = hl.specialize(V)
NT = (T + C - 1) // C
h_out = torch.empty(B, NT, H, K, V, dtype=k.dtype, device=k.device)
v_out = torch.empty_like(u)
BH = B * H
for flat, tv in hl.tile([BH, V], block_size=[1, 8]):
b_idx = flat.begin // H
h_idx = flat.begin % H
state = hl.zeros([K, tv], dtype=torch.float32)
for tc in hl.tile(T, block_size=C):
chunk_idx = tc.begin // C
t_end = min(tc.begin + C, T) - 1
h_out[b_idx, chunk_idx, h_idx, :, tv] = state.to(k.dtype)
proj = hl.dot(w[b_idx, tc, h_idx, :], state, out_dtype=torch.float32)
diff = u[b_idx, tc, h_idx, tv].to(torch.float32) - proj
v_out[b_idx, tc, h_idx, tv] = diff.to(u.dtype)
g_end = g[b_idx, t_end, h_idx].to(torch.float32)
g_t = g[b_idx, tc, h_idx].to(torch.float32)
gate = torch.exp(g_end - g_t)
diff_gated = diff * gate[:, None]
state = state * torch.exp(g_end)
p_k = k[b_idx, tc, h_idx, :]
state = hl.dot(p_k.T, diff_gated, acc=state)
return h_out, v_out
return kernel
_KERNELS = {shape: _make_kernel(cfg) for shape, cfg in SHAPE_CONFIGS.items()}
def custom_kernel(data: input_t) -> output_t:
k, w, u, g = data
B, T, H, K = k.shape
V = u.shape[-1]
kernel = _KERNELS[(B, T, H, K, V)]
return kernel(k, w, u, g)scrolls · 82 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