Skip to content
KernelIndex
Search⌘K

gpt-o3 / cuda73b50f

gpt-o3_cuda_73b50f · gpt-o3 · cuda · Apache-2.0

Use it

Vendorable · source mirrored · Apache-2.0View source →

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

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

Benchmark evidence

No published measurement for this revision.

No evidence · How evidence levels are derived →

Source and license

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

Kernel source

main.cpp50 lines
/*
 *  PyTorch binding for the specialised RMS-Norm kernel (hidden_size = 7168).
 *  The Python-visible entry point is `run(hidden_states, weight)`.
 */

#include "kernel.h"

#include <ATen/cuda/CUDAGuard.h>
#include <torch/extension.h>

/* -------------------------------------------------------------------------- */
/* Python-visible API                                                         */
/* -------------------------------------------------------------------------- */
torch::Tensor run(torch::Tensor hidden_states,
                  torch::Tensor weight)
{
    TORCH_CHECK(hidden_states.is_cuda(), "hidden_states must reside on GPU");
    TORCH_CHECK(weight.is_cuda(),        "weight must reside on GPU");
    TORCH_CHECK(hidden_states.device() == weight.device(),
                "hidden_states and weight must be on the same GPU");

    /* Ensure execution on the correct device */
    at::cuda::CUDAGuard device_guard(hidden_states.device());

    /* The kernel expects contiguous memory */
    hidden_states = hidden_states.contiguous();
    weight        = weight.contiguous();

    /* Prepare output tensor */
    torch::Tensor output = torch::empty_like(hidden_states);

    /* Launch the CUDA kernel */
    launch_rmsnorm_h7168(hidden_states, weight, output);

    return output;
}

/* -------------------------------------------------------------------------- */
/* PyBind11 registration                                                      */
/* -------------------------------------------------------------------------- */
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m)
{
    m.doc() = "Optimised RMS-Norm (hidden_size = 7168, BF16)";

    m.def("run",
          &run,
          "Execute RMS-Norm on BF16 tensors",
          pybind11::arg("hidden_states"),
          pybind11::arg("weight"));
}
scrolls · 50 lines total

Source code from the importing source · Apache-2.0

No published measurement for this revision

JSON