submission 132603
Nader · python · License unknown
Use it
Vendorable · source mirrored · license unknownView source →
No package. Vendor the mirrored source: 44 lines, June 9 Researcher Reciprocity License v1.0.
prefixsum_v2.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-prefixsum-v2-132603?include=source"interfacepython
Compatibility
measured onNVIDIA L4
declared hardwareNVIDIA L4
architecturessm_89
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:8771d2e31b40c8be7cd0fcdb8ba50145cf208ac02333561ff013da4bc382547d
license declaredunknown
license concludedunknown
authorsNader
imported2026-08-15
Kernel source
prefixsum_v2.py44 lines
#!POPCORN leaderboard prefixsum_v2
# This is a submission template for popcorn leaderboard 'prefixsum_v2'.
# Your task is as follows:
# > Implement an inclusive prefix sum (scan) kernel that matches the reference implementation.
# > The kernel should compute the cumulative sum of all elements up to each position.
# > Because of numerical instability, the tolerance is scaled by the square root of the input size.
# >
# > Input:
# > - `data`: A 1D tensor of size `n`
# > Output:
# > - `output`: A 1D tensor of size `n`
# The deadline for this leaderboard is 2025-12-30 00:00:00+00:00
# You can automatically route this file to specific GPUs by adding a line
# `#!POPCORN gpus <GPUs>` to the header of this file.
# Happy hacking!
import subprocess
subprocess.run(["pip", "install", "cuda-cccl[cu12]==0.4.1"])
from task import input_t, output_t
import cuda.compute
from cuda.compute import OpKind
import torch
build_in = torch.empty(1, dtype=torch.float32, device="cuda")
build_out = torch.empty(1, dtype=torch.float32, device="cuda")
scanner = cuda.compute.make_inclusive_scan(build_in, build_out, OpKind.PLUS, None)
input_size = 268435456
temp_storage_size = scanner(None, build_in, build_out, input_size, None)
d_temp_storage = torch.empty(temp_storage_size, dtype=torch.uint8, device="cuda")
def custom_kernel(data: input_t) -> output_t:
d_in, d_out = data
scanner(d_temp_storage, d_in, d_out, len(d_in), None)
return d_out
scrolls · 44 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 132601.
Best evidence level for this revision: reported
JSON