gpt-o3 / cuda8eed1f
gpt-o3_cuda_8eed1f · gpt-o3 · cuda · Apache-2.0
Use it
Vendorable · source mirrored · Apache-2.0View source →
No package. Vendor the mirrored source: 44 lines, Apache-2.0, pinned at da91508.
main.cpp
curl "https://kernelindex.com/api/v1/implementations/flashinfer-gpt-o3-cuda-8eed1f?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:34303d7011fdc5355975e6458f4ff286ebf425f29e909c215078e9e169e46f81
license declaredApache-2.0
license concludedApache-2.0
authorsgpt-o3
imported2026-08-20
Kernel source
main.cpp44 lines
#include "kernel.h"
#include <ATen/cuda/CUDAGuard.h>
#include <torch/extension.h>
// ---------------------------------------------------------------------------
// Python-visible wrapper
// ---------------------------------------------------------------------------
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 have dtype torch.bfloat16.");
TORCH_CHECK(weight.dtype() == torch::kBFloat16,
"weight must have dtype torch.bfloat16.");
TORCH_CHECK(hidden_states.size(1) == 4096,
"hidden_size must be 4096.");
at::cuda::CUDAGuard device_guard(hidden_states.device());
// Ensure contiguous memory for coalesced access
auto x = hidden_states.contiguous();
auto w = weight.contiguous();
auto y = torch::empty_like(x);
rmsnorm_h4096_cuda_forward(x, w, y);
return y;
}
// ---------------------------------------------------------------------------
// PyBind11 binding
// ---------------------------------------------------------------------------
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m)
{
m.def("run",
&run,
pybind11::arg("hidden_states"),
pybind11::arg("weight"),
"Fast RMS-Norm forward (hidden_size = 4096, BF16, B200)");
}scrolls · 44 lines total
Source code from the importing source · Apache-2.0
No published measurement for this revision
JSON