Skip to content
KernelIndex
Search⌘K

submission 66209

Nikhil Bhoir · python · License unknown

Use it

Vendorable · source mirrored · license unknownView source →

No package. Vendor the mirrored source: 57 lines, June 9 Researcher Reciprocity License v1.0.

vectorsubmission.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-vectoradd-v2-66209?include=source"
interfacepython
Compatibility
measured onNVIDIA B200
declared hardwareNVIDIA B200
architecturessm_100
dtypesfp16

Benchmark evidence

1 measurement across 1 GPU, fastest first.

Operation / workload
Hardware
Latency
Rank
Observed
FP16 vector additionsuite of 5 cases
NVIDIA B200
236.5µs
#26 of 66
2025-10-18

Reported · How evidence levels are derived →

Source and license

sourceavailable
revision digestsha256:3ff1a484f8580f6be0389e2b8653f41f03254c07e452ad05aff318f60bf9bcab
license declaredunknown
license concludedunknown
authorsNikhil Bhoir
imported2026-08-15

Techniques

Extracted from the mirrored source by pattern, never inferred. Each row cites its line.

autotune@triton.autotune(
num-warps = 2triton.Config({'BLOCK_SIZE': 256}, num_warps=2, num_stages=2),
stages = 2triton.Config({'BLOCK_SIZE': 256}, num_warps=2, num_stages=2),

Kernel source

vectorsubmission.py57 lines
import torch
import triton
import triton.language as tl
 
 
@triton.autotune(
    configs=[
        triton.Config({'BLOCK_SIZE': 256}, num_warps=2, num_stages=2),
        triton.Config({'BLOCK_SIZE': 512}, num_warps=2, num_stages=2),
        triton.Config({'BLOCK_SIZE': 1024}, num_warps=4, num_stages=2),
        triton.Config({'BLOCK_SIZE': 2048}, num_warps=4, num_stages=2),
        triton.Config({'BLOCK_SIZE': 2048}, num_warps=8, num_stages=2),
        triton.Config({'BLOCK_SIZE': 4096}, num_warps=8, num_stages=2),
        triton.Config({'BLOCK_SIZE': 4096}, num_warps=8, num_stages=3),
    ],
    key=['N'],
)
@triton.jit
def vectoradd_kernel(
    a_ptr,
    b_ptr,
    c_ptr,
    N,
    BLOCK_SIZE: tl.constexpr,
):
    """
    Ultra-optimized float16 vector addition for B200.
    Uses autotuning for optimal configuration.
    """
    pid = tl.program_id(0)
    block_start = pid * BLOCK_SIZE
    offsets = block_start + tl.arange(0, BLOCK_SIZE)
    mask = offsets < N
    # Load with cache eviction hints optimized for B200
    a = tl.load(a_ptr + offsets, mask=mask, other=0.0, eviction_policy='evict_last')
    b = tl.load(b_ptr + offsets, mask=mask, other=0.0, eviction_policy='evict_last')
    # Perform addition
    c = a + b
    # Store with write-back policy
    tl.store(c_ptr + offsets, c, mask=mask, eviction_policy='evict_last')
 
 
def custom_kernel(data):
    """
    Main kernel with autotuning for peak B200 performance.
    """
    A, B, C = data
    # Ensure contiguous layout
    A = A.contiguous()
    B = B.contiguous()
    C = C.contiguous()
    N = A.numel()
    # Grid configuration - will be optimized by autotune
    grid = lambda meta: (triton.cdiv(N, meta['BLOCK_SIZE']),)
    # Launch autotuned kernel
    vectoradd_kernel[grid](A, B, C, N)
    return C
scrolls · 57 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