submission 68617
gau.nernst · python · License unknown
Use it
Vendorable · source mirrored · license unknownView source →
No package. Vendor the mirrored source: 46 lines, June 9 Researcher Reciprocity License v1.0.
submission_triton_v0.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-histogram-v2-68617?include=source"interfacepython
Compatibility
measured onNVIDIA B200
declared hardwareNVIDIA B200
architecturessm_100
dtypesuint8
Benchmark evidence
1 measurement across 1 GPU, fastest first.
Reported · How evidence levels are derived →
Source and license
sourceavailable
revision digestsha256:363510141003897bb27065366d05eaaba34e0be346923402505a766c2044254f
license declaredunknown
license concludedunknown
authorsgau.nernst
imported2026-08-15
Techniques
Extracted from the mirrored source by pattern, never inferred. Each row cites its line.
persistent-kernel
num_pids = tl.num_programs(0)Kernel source
submission_triton_v0.py46 lines
#!POPCORN leaderboard histogram_v2
import triton
import triton.language as tl
from task import input_t, output_t
@triton.jit
def kernel(
data_ptr, # (size,)
output_ptr, # (256,)
size,
BLOCK_SIZE: tl.constexpr,
NUM_BINS: tl.constexpr = 256,
):
pid = tl.program_id(0)
num_pids = tl.num_programs(0)
acc = tl.zeros((NUM_BINS,), dtype=tl.int32)
num_iters = tl.cdiv(size, BLOCK_SIZE * num_pids)
for iter_id in range(num_iters):
offs = iter_id * (num_pids * BLOCK_SIZE) + (pid * BLOCK_SIZE) + tl.arange(0, BLOCK_SIZE)
mask = offs < size
data = tl.load(data_ptr + offs, mask, other=0).to(tl.int32) # tl.histogram() doesn't work with uint8
acc += tl.histogram(data, NUM_BINS) # old triton doesn't have mask for histogram
# NOTE: output_ptr is i64 type
tl.atomic_add(output_ptr + tl.arange(0, NUM_BINS), acc)
# compensation since we use 0 for masked elements
if pid == 0:
compensate = size - num_iters * BLOCK_SIZE * num_pids
tl.atomic_add(output_ptr, compensate)
def custom_kernel(data: input_t) -> output_t:
data, output = data
BLOCK_SIZE = 8192
num_blocks = 264
output.zero_()
kernel[(num_blocks,)](data, output, data.shape[0], BLOCK_SIZE)
return output
scrolls · 46 lines total
Source code from GPU Mode and the KernelBot dataset · June 9 Researcher Reciprocity License v1.0
Changes from previous submission
Against this author's previous submission submission 68615.
⋯ 36 unchanged linesdef custom_kernel(data: input_t) -> output_t:data, output = data- BLOCK_SIZE = 4096+ BLOCK_SIZE = 8192num_blocks = 264output.zero_()kernel[(num_blocks,)](data, output, data.shape[0], BLOCK_SIZE)
Best evidence level for this revision: reported
JSON