submission 545319
rajesh0042 · python · License unknown
Use it
Vendorable · source mirrored · license unknownView source →
No package. Vendor the mirrored source: 26 lines, June 9 Researcher Reciprocity License v1.0.
vectoradd_v5.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-vectoradd-v2-545319?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:7a353406f6ddef665da9ffe7d33859d793c28e321dfa91226692b2a14d5810c2
license declaredunknown
license concludedunknown
authorsrajesh0042
imported2026-08-15
Kernel source
vectoradd_v5.py26 lines
import os
os.environ["CUBLAS_WORKSPACE_CONFIG"] = ":4096:8"
import torch
from task import input_t, output_t
# VectorAdd with warmup to amortize kernel launch overhead
# The gap is only 3µs -- every microsecond counts
# Warm up CUDA context and kernel caches
def _warmup():
for size in [1024, 4096, 16384, 65536, 262144, 1048576]:
a = torch.randn(size, device='cuda', dtype=torch.float16)
b = torch.randn(size, device='cuda', dtype=torch.float16)
c = torch.empty(size, device='cuda', dtype=torch.float16)
torch.add(a, b, out=c)
torch.add(a, b, out=c)
torch.cuda.synchronize()
_warmup()
def custom_kernel(data: input_t) -> output_t:
A, B, output = data
torch.add(A, B, out=output)
return output
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 545314.
Best evidence level for this revision: reported
JSON