Skip to content
KernelIndex
Search⌘K

gpt-o3 / cudaaf0f3d

gpt-o3_cuda_af0f3d · gpt-o3 · cuda · Apache-2.0

Use it

Vendorable · source mirrored · Apache-2.0View source →

No package. Vendor the mirrored source: 49 lines, Apache-2.0, pinned at da91508.

main.cpp
curl "https://kernelindex.com/api/v1/implementations/flashinfer-gpt-o3-cuda-af0f3d?include=source"
interfacecuda
revisionda915083d4c7
symbolrun
pathmain.cpp
Compatibility
measured onNVIDIA B200
declared hardwareNVIDIA B200
architecturessm_100
dtypesfp16

Benchmark evidence

25 measurements across 1 GPU, fastest first.

Operation / workload
Hardware
Latency
Rank
Observed
GEMM n5120 k2048fp16 · [2, 2048]
NVIDIA B200
12.1µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [6, 2048]
NVIDIA B200
12.1µs
#2 of 6
2025-10-16
GEMM n5120 k2048fp16 · [8, 2048]
NVIDIA B200
12.1µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [5, 2048]
NVIDIA B200
12.2µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [4, 2048]
NVIDIA B200
12.3µs
#2 of 6
2025-10-16
GEMM n5120 k2048fp16 · [1, 2048]
NVIDIA B200
12.3µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [16, 2048]
NVIDIA B200
12.3µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [63, 2048]
NVIDIA B200
12.3µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [34, 2048]
NVIDIA B200
12.5µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [32, 2048]
NVIDIA B200
12.6µs
#2 of 6
2025-10-16
Show all 25 measurements ›
GEMM n5120 k2048fp16 · [93, 2048]
NVIDIA B200
12.7µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [64, 2048]
NVIDIA B200
12.7µs
#2 of 6
2025-10-16
GEMM n5120 k2048fp16 · [25, 2048]
NVIDIA B200
12.7µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [128, 2048]
NVIDIA B200
12.8µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [17, 2048]
NVIDIA B200
12.9µs
#2 of 6
2025-10-16
GEMM n5120 k2048fp16 · [172, 2048]
NVIDIA B200
14.6µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [289, 2048]
NVIDIA B200
16.2µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [492, 2048]
NVIDIA B200
16.3µs
#2 of 6
2025-10-16
GEMM n5120 k2048fp16 · [952, 2048]
NVIDIA B200
22.2µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [8828, 2048]
NVIDIA B200
130.7µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [11006, 2048]
NVIDIA B200
167.5µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [12251, 2048]
NVIDIA B200
180.0µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [12853, 2048]
NVIDIA B200
194.3µs
#1 of 6
2025-10-16
GEMM n5120 k2048fp16 · [14915, 2048]
NVIDIA B200
235.1µs
#2 of 6
2025-10-16
GEMM n5120 k2048fp16 · [16294, 2048]
NVIDIA B200
244.8µs
#2 of 6
2025-10-16

Reproduction-ready · How evidence levels are derived →

Source and license

sourcehttps://huggingface.co/datasets/flashinfer-ai/flashinfer-trace
commitda915083d4c7c5e61aa3005e3d17ae488e0fc71c
revision digestsha256:4d4e9546c44a877709066a939c301037ce1372cb021b718f6f61c33d90199a9e
license declaredApache-2.0
license concludedApache-2.0
authorsgpt-o3
imported2026-08-20

Kernel source

main.cpp49 lines
#include "kernel.h"

#include <ATen/cuda/CUDAContext.h>
#include <torch/extension.h>
#include <vector>

/*  Public entry point exposed to Python.
    Accepts:
        A : torch.float16  [M , 2048]   (CUDA)
        B : torch.float16  [5120 , 2048](CUDA)
    Returns:
        C : torch.float16  [M , 5120]   (CUDA)   */
torch::Tensor run(torch::Tensor A, torch::Tensor B) {
    /*  Basic argument checking  */
    TORCH_CHECK(A.is_cuda() && B.is_cuda(), "Inputs must reside on the GPU");
    TORCH_CHECK(A.scalar_type() == torch::kFloat16 &&
                B.scalar_type() == torch::kFloat16,
                "Inputs must be float16 / half");
    TORCH_CHECK(A.dim() == 2 && B.dim() == 2,
                "Inputs must be 2-D matrices");
    TORCH_CHECK(A.size(1) == GEMM_K,
                "A must have shape [M , 2048]");
    TORCH_CHECK(B.size(0) == GEMM_N && B.size(1) == GEMM_K,
                "B must have shape [5120 , 2048]");

    const int64_t M = A.size(0);

    /*  Allocate output tensor on the same device  */
    auto C = torch::empty({M, GEMM_N},
                          torch::dtype(torch::kFloat16).device(A.device()));

    /*  Extract the current CUDA stream used by PyTorch  */
    cudaStream_t stream = at::cuda::getCurrentCUDAStream().stream();

    /*  Launch the optimised GEMM  */
    gemm_n5120_k2048(
        reinterpret_cast<const __half*>(A.data_ptr<at::Half>()),
        reinterpret_cast<const __half*>(B.data_ptr<at::Half>()),
        reinterpret_cast<__half*>(C.data_ptr<at::Half>()),
        static_cast<int>(M),
        stream);

    return C;
}

/*  PyBind11 module declaration  */
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
    m.def("run", &run, "Optimised GEMM  (B200, fp16)");
}
scrolls · 49 lines total

Source code from FlashInfer-Bench (flashinfer-ai/flashinfer-trace) · Apache-2.0

Best evidence level for this revision: reproducible

JSON