submission 66724
michaelp5386 · python · License unknown
Use it
Vendorable · source mirrored · license unknownView source →
No package. Vendor the mirrored source: 36 lines, June 9 Researcher Reciprocity License v1.0.
submission.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-vectoradd-v2-66724?include=source"interfacepython
Compatibility
measured onNVIDIA A100
declared hardwareNVIDIA A100
architecturessm_80
dtypesfp16
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:f64466ad068d0973750059e84ca23181bc7f6cfdc5b682e3bc765f76fd64b42e
license declaredunknown
license concludedunknown
authorsmichaelp5386
imported2026-08-15
Techniques
Extracted from the mirrored source by pattern, never inferred. Each row cites its line.
num-warps = 4
num_warps=4, # try 4, 8 depending on your GPUKernel source
submission.py36 lines
import triton
import triton.language as tl
from task import input_t, output_t
@triton.jit
def add_fp16_kernel(x_ptr, y_ptr, out_ptr, n_elements, BLOCK_SIZE: tl.constexpr):
pid = tl.program_id(axis=0)
offsets = pid * BLOCK_SIZE + tl.arange(0, BLOCK_SIZE)
mask = offsets < n_elements
x = tl.load(x_ptr + offsets, mask=mask, other=0)
y = tl.load(y_ptr + offsets, mask=mask, other=0)
# For extra numerical headroom, you could do:
# z = tl.cast(tl.cast(x, tl.float32) + tl.cast(y, tl.float32), tl.float16)
z = x + y
tl.store(out_ptr + offsets, z, mask=mask)
# User kernel implementation.
def custom_kernel(data: input_t) -> output_t:
A, B, output = data
n = A.numel()
grid = lambda meta: (triton.cdiv(n, meta["BLOCK_SIZE"]),)
add_fp16_kernel[grid](
A,
B,
output,
n,
BLOCK_SIZE=1024, # try 1024, 2048, 4096
num_warps=4, # try 4, 8 depending on your GPU
)
return output
scrolls · 36 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