Skip to content
KernelIndex
Search⌘K

gpt-o3 / cuda64f9f5

gpt-o3_cuda_64f9f5 · 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-64f9f5?include=source"
interfacecuda
revisionda915083d4c7
symbolrun
pathmain.cpp
Compatibility
measured onNVIDIA B200
declared hardwareNVIDIA B200
architecturessm_100
dtypesbf16

Benchmark evidence

14 measurements across 1 GPU, fastest first.

Operation / workload
Hardware
Latency
Rank
Observed
RMSNorm h128bf16 · [128] · batch_size=136
NVIDIA B200
6.17µs
#1 of 9
2025-10-16
RMSNorm h128bf16 · [128] · batch_size=192
NVIDIA B200
6.18µs
#1 of 9
2025-10-16
RMSNorm h128bf16 · [128] · batch_size=32
NVIDIA B200
6.18µs
#2 of 9
2025-10-16
RMSNorm h128bf16 · [128] · batch_size=4
NVIDIA B200
6.18µs
#2 of 9
2025-10-16
RMSNorm h128bf16 · [128] · batch_size=256
NVIDIA B200
6.18µs
#2 of 9
2025-10-16
RMSNorm h128bf16 · [128] · batch_size=24
NVIDIA B200
6.18µs
#2= of 9
2025-10-16
RMSNorm h128bf16 · [128] · batch_size=316
NVIDIA B200
6.18µs
#2 of 9
2025-10-16
RMSNorm h128bf16 · [128] · batch_size=1088
NVIDIA B200
6.23µs
#2 of 9
2025-10-16
RMSNorm h128bf16 · [128] · batch_size=2048
NVIDIA B200
8.18µs
#8 of 9
2025-10-16
RMSNorm h128bf16 · [128] · batch_size=2528
NVIDIA B200
8.21µs
#6 of 9
2025-10-16
Show all 14 measurements ›
RMSNorm h128bf16 · [128] · batch_size=49532
NVIDIA B200
32.8µs
#8 of 9
2025-10-16
RMSNorm h128bf16 · [128] · batch_size=65016
NVIDIA B200
40.4µs
#4 of 9
2025-10-16
RMSNorm h128bf16 · [128] · batch_size=396256
NVIDIA B200
241.8µs
#8 of 9
2025-10-16
RMSNorm h128bf16 · [128] · batch_size=520128
NVIDIA B200
276.4µs
#8 of 9
2025-10-16

Reproduction-ready · How evidence levels are derived →

Source and license

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

Kernel source

main.cpp49 lines
#include <torch/extension.h>
#include <ATen/cuda/CUDAContext.h>
#include "kernel.h"

/* -------------------------------------------------------------------------- */
/* Python-exposed host function                                               */
/* -------------------------------------------------------------------------- */
torch::Tensor run(torch::Tensor hidden_states, torch::Tensor weight) {
    TORCH_CHECK(hidden_states.is_cuda(), "hidden_states must be a CUDA tensor");
    TORCH_CHECK(weight.is_cuda(),        "weight must be a CUDA tensor");
    TORCH_CHECK(hidden_states.dtype() == torch::kBFloat16,
                "hidden_states must be BF16");
    TORCH_CHECK(weight.dtype() == torch::kBFloat16,
                "weight must be BF16");
    TORCH_CHECK(hidden_states.dim() == 2 && hidden_states.size(1) == HIDDEN_SIZE,
                "hidden_states shape must be [batch, 128]");
    TORCH_CHECK(weight.numel() == HIDDEN_SIZE,
                "weight size must be 128");

    const int64_t batch_size = hidden_states.size(0);

    /* Ensure contiguous tensors ------------------------------------------------*/
    auto h_in  = hidden_states.contiguous();
    auto w_in  = weight.contiguous();
    auto out   = torch::empty_like(h_in);

    /* Convert tensor pointers to BF16 device pointers ------------------------- */
    const __nv_bfloat16* h_ptr =
        reinterpret_cast<const __nv_bfloat16*>(h_in.data_ptr<torch::BFloat16>());
    const __nv_bfloat16* w_ptr =
        reinterpret_cast<const __nv_bfloat16*>(w_in.data_ptr<torch::BFloat16>());
    __nv_bfloat16* o_ptr =
        reinterpret_cast<__nv_bfloat16*>(out.data_ptr<torch::BFloat16>());

    /* Launch kernel ----------------------------------------------------------- */
    auto stream = at::cuda::getCurrentCUDAStream();
    rmsnorm_h128_launcher(h_ptr, w_ptr, o_ptr, static_cast<int>(batch_size),
                          stream.stream());

    return out;
}

/* -------------------------------------------------------------------------- */
/* PyBind11 binding                                                           */
/* -------------------------------------------------------------------------- */
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
    m.def("run", &run,
          "RMSNorm with hidden_size = 128 (BF16, CUDA/B200 optimised)");
}
scrolls · 49 lines total

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

Best evidence level for this revision: reproducible

JSON