gpt-o3 / cuda7f55e3
gpt-o3_cuda_7f55e3 · gpt-o3 · cuda · Apache-2.0
Use it
Vendorable · source mirrored · Apache-2.0View source →
No package. Vendor the mirrored source: 36 lines, Apache-2.0, pinned at da91508.
main.cpp
curl "https://kernelindex.com/api/v1/implementations/flashinfer-gpt-o3-cuda-7f55e3?include=source"interfacecuda
revisionda915083d4c7
symbolrun
pathmain.cpp
Compatibility
declared hardwareNVIDIA B200
architecturessm_100
dtypesfp32, int32
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:0c4f0e0b1cbd3536ad48a2e95b75ff739cd5da6267f7ef81d73ac9cf79bce9d9
license declaredApache-2.0
license concludedApache-2.0
authorsgpt-o3
imported2026-08-20
Kernel source
main.cpp36 lines
#include "kernel.h"
#include <torch/extension.h>
/* -------------------------------------------------------------------------- */
/* Python exposed entry */
/* -------------------------------------------------------------------------- */
torch::Tensor run(torch::Tensor probs,
torch::Tensor top_k,
torch::Tensor top_p)
{
TORCH_CHECK(probs.is_cuda(), "probs must reside on CUDA");
TORCH_CHECK(top_k.is_cuda(), "top_k must reside on CUDA");
TORCH_CHECK(top_p.is_cuda(), "top_p must reside on CUDA");
TORCH_CHECK(probs.dtype() == torch::kFloat32,
"probs must be float32 tensor");
const int batch_size = probs.size(0);
auto samples = torch::empty({batch_size},
torch::dtype(torch::kInt64).device(probs.device()));
top_k_top_p_sampling_from_probs_v128256_launcher(
probs.contiguous(),
top_k.contiguous(),
top_p.contiguous(),
samples);
return samples;
}
/* -------------------------------------------------------------------------- */
/* pybind11 registration */
/* -------------------------------------------------------------------------- */
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m)
{
m.def("run", &run, "top-k / top-p sampling kernel (B200 optimised)");
}scrolls · 36 lines total
Source code from the importing source · Apache-2.0
No published measurement for this revision
JSON