Skip to content
KernelIndex
Search⌘K

submission 538949

suriyaa__mm · python · License unknown

Use it

Vendorable · source mirrored · license unknownView source →

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

submission.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-vectoradd-v2-538949?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
FP16 vector additionsuite of 5 cases
NVIDIA A100
904.9µs
#15 of 87
2026-03-12

Reported · How evidence levels are derived →

Source and license

sourceavailable
revision digestsha256:e7f7a0b6f5709f083ed9d05b2681e1195ab81d19b07e26c25be14f0ae1a33214
license declaredunknown
license concludedunknown
authorssuriyaa__mm
imported2026-08-15

Kernel source

submission.py60 lines
from utils import make_match_reference, DeterministicContext
import torch
from task import input_t, output_t
import triton
import triton.language as tl

@triton.jit(
    version=None,
    repr=None,
    launch_metadata=None,
    do_not_specialize=None,
    do_not_specialize_on_alignment=None,
    debug=None,
    noinline=None,
)
def _vadd(
    p_v1: torch.Tensor,
    p_v2: torch.Tensor,
    p_o: torch.Tensor,
    n: int,
    tile_size_x: tl.constexpr,
):
    pidx = tl.program_id(axis=0)

    stride = pidx * tile_size_x + tl.arange(start=0, end=tile_size_x)
    mask = stride < n

    v_v1 = tl.load(pointer=p_v1 + stride, mask=mask, other=0.0)
    v_v2 = tl.load(pointer=p_v2 + stride, mask=mask, other=0.0)

    tl.store(pointer=p_o + stride, value=(v_v1 + v_v2), mask=mask)

def vadd(
    v1: torch.Tensor,
    v2: torch.Tensor,
    o: torch.Tensor
):
    n = v1.shape[0] * v1.shape[0]
    tile_size = 32768
    grid = (triton.cdiv(n, tile_size),)

    _vadd[grid](p_v1=v1, p_v2=v2, p_o=o, n=n, tile_size_x=tile_size)

    return o


def custom_kernel(data: input_t) -> output_t:
    """
    Reference implementation of vector addition using PyTorch.
    Args:
        data: Tuple of tensors [A, B] to be added.
    Returns:
        Tensor containing element-wise sums.
    """
    with DeterministicContext():
        A, B, output = data
        output[...] = vadd(A, B, output)
        return output

scrolls · 60 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