Skip to content
KernelIndex
Search⌘K

gpt-o3 / cuda3def09

gpt-o3_cuda_3def09 · gpt-o3 · cuda · Apache-2.0

Use it

Vendorable · source mirrored · Apache-2.0View source →

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

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

Benchmark evidence

7 measurements across 1 GPU, fastest first.

Operation / workload
Hardware
Latency
Rank
Observed
Fused add RMSNorm h2048bf16 · [2048] · batch_size=6
NVIDIA B200
7.28µs
#5 of 8
2025-10-16
Fused add RMSNorm h2048bf16 · [2048] · batch_size=1
NVIDIA B200
7.94µs
#4 of 8
2025-10-16
Fused add RMSNorm h2048bf16 · [2048] · batch_size=79
NVIDIA B200
8.02µs
#4 of 8
2025-10-16
Fused add RMSNorm h2048bf16 · [2048] · batch_size=34
NVIDIA B200
8.05µs
#6 of 8
2025-10-16
Fused add RMSNorm h2048bf16 · [2048] · batch_size=64
NVIDIA B200
8.10µs
#6 of 8
2025-10-16
Fused add RMSNorm h2048bf16 · [2048] · batch_size=12383
NVIDIA B200
78.1µs
#7 of 8
2025-10-16
Fused add RMSNorm h2048bf16 · [2048] · batch_size=16254
NVIDIA B200
100.3µs
#7 of 8
2025-10-16

Reproduction-ready · How evidence levels are derived →

Source and license

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

Kernel source

main.cpp41 lines
#include "kernel.h"

#include <torch/extension.h>

/*
 * Python-facing entry point.
 * It validates inputs, allocates the output tensor and
 * dispatches to the CUDA launcher.
 */
torch::Tensor run(torch::Tensor hidden_states,
                  torch::Tensor residual,
                  torch::Tensor weight)
{
    // Ensures the tensors live on the same device / stream
    TORCH_CHECK(hidden_states.is_cuda(), "hidden_states must be CUDA");
    TORCH_CHECK(residual.is_cuda()     , "residual must be CUDA");
    TORCH_CHECK(weight.is_cuda()       , "weight must be CUDA");

    TORCH_CHECK(hidden_states.dtype() == at::kBFloat16,
                "hidden_states must be BF16");
    TORCH_CHECK(residual.dtype() == at::kBFloat16,
                "residual must be BF16");
    TORCH_CHECK(weight.dtype() == at::kBFloat16,
                "weight must be BF16");

    // Output – same shape/dtype/device as hidden_states
    auto output = torch::empty_like(hidden_states);

    // Launch CUDA kernel
    fused_add_rmsnorm_h2048(hidden_states, residual, weight, output);

    return output;
}

/* ------------------------------------------------------------------ */
/*  PyBind11 registration                                             */
/* ------------------------------------------------------------------ */
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
    m.def("run", &run,
          "Fused Add + RMSNorm (hidden_size = 2048, BF16, B200-optimised)");
}
scrolls · 41 lines total

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

Best evidence level for this revision: reproducible

JSON