Skip to content
KernelIndex
Search⌘K

submission 762432

rawat_arpit_04702 · python · License unknown

Use it

Vendorable · source mirrored · license unknownView source →

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

submission.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-matmul-v2-762432?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 matmulsuite of 8 cases
NVIDIA A100
706.7µs
#16 of 27
2026-04-11

Reported · How evidence levels are derived →

Source and license

sourceavailable
revision digestsha256:60990b8502846ecce1c21689615671f25436807d1078257c33a5719599d1338a
license declaredunknown
license concludedunknown
authorsrawat_arpit_04702
imported2026-08-15

Techniques

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

mmaaccum = tl.dot(a_tile, b_tile, acc=accum)

Kernel source

submission.py85 lines
#!POPCORN leaderboard matmul_v2
#!POPCORN gpu A100

from task import input_t, output_t
from utils import make_match_reference

import triton
import triton.language as tl


# KxM @ MxN == KxN

@triton.jit
def matmul_kernel(a_ptr, b_ptr, c_ptr,
            ax_stride, ay_stride,
            bx_stride, by_stride,
            cx_stride, cy_stride,
            K: tl.constexpr, M: tl.constexpr, N: tl.constexpr,
            K_TILE_SIZE: tl.constexpr, 
            N_TILE_SIZE: tl.constexpr, 
            M_TILE_SIZE: tl.constexpr 
            ):
    pid_k = tl.program_id(0)
    pid_n = tl.program_id(1)

    a_block_ptr = tl.make_block_ptr(
        base=a_ptr,
        shape=(K, M),
        strides=(ax_stride, ay_stride),
        offsets=(pid_k * K_TILE_SIZE, 0), 
        block_shape=(K_TILE_SIZE, M_TILE_SIZE),
        order=(1, 0)
    )
    b_block_ptr = tl.make_block_ptr(
        base=b_ptr,
        shape=(M, N),
        strides=(bx_stride, by_stride),
        offsets=(0, pid_n * N_TILE_SIZE), 
        block_shape=(M_TILE_SIZE, N_TILE_SIZE),
        order=(1, 0)
    )

    accum = tl.zeros((K_TILE_SIZE, N_TILE_SIZE), dtype=tl.float32)

    for i in range(0, tl.cdiv(M, M_TILE_SIZE)):
        a_tile = tl.load(a_block_ptr, boundary_check=(0, 1))
        b_tile = tl.load(b_block_ptr, boundary_check=(0, 1))
        
        accum = tl.dot(a_tile, b_tile, acc=accum)
        
        a_block_ptr = tl.advance(a_block_ptr, (0, M_TILE_SIZE))
        b_block_ptr = tl.advance(b_block_ptr, (M_TILE_SIZE, 0))

    # write the C tile back to global memory
    c_block_ptr = tl.make_block_ptr(
        base=c_ptr,
        shape=(K, N),
        strides=(cx_stride, cy_stride),
        offsets=(pid_k * K_TILE_SIZE, pid_n * N_TILE_SIZE),
        block_shape=(K_TILE_SIZE, N_TILE_SIZE),
        order=(1, 0)
    )
    tl.store(c_block_ptr, accum.to(tl.float16), boundary_check=(0, 1))
    
    
def custom_kernel(data: input_t) -> output_t:
    a,b,c = data
    K,M = a.shape
    N = b.shape[-1]
    
    K_TILE_SIZE, N_TILE_SIZE, M_TILE_SIZE = 128, 128, 32
    
    grid = (triton.cdiv(K, K_TILE_SIZE), triton.cdiv(N, N_TILE_SIZE))
    
    matmul_kernel[grid](
        a,b,c,
        a.stride(0), a.stride(1),
        b.stride(0), b.stride(1),
        c.stride(0), c.stride(1),
        K, M, N,
        K_TILE_SIZE, N_TILE_SIZE, M_TILE_SIZE
    )
    return c

check_implementation = make_match_reference(custom_kernel)
scrolls · 85 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 760226.

⋯ 66 unchanged lines
a,b,c = data
K,M = a.shape
N = b.shape[-1]
- grid = (K,N)
- K_TILE_SIZE, N_TILE_SIZE, M_TILE_SIZE = 32,32,32
+ K_TILE_SIZE, N_TILE_SIZE, M_TILE_SIZE = 128, 128, 32
+ grid = (triton.cdiv(K, K_TILE_SIZE), triton.cdiv(N, N_TILE_SIZE))
+
matmul_kernel[grid](
a,b,c,
a.stride(0), a.stride(1),

Best evidence level for this revision: reported

JSON