gpt-o3 / cudaaf0f3d
gpt-o3_cuda_af0f3d · gpt-o3 · cuda · Apache-2.0
Kernel source · 49 lines ↓holds 17 records
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-af0f3d?include=source"interfacecuda
revisionda915083d4c7
symbolrun
pathmain.cpp
Compatibility
measured onNVIDIA B200
declared hardwareNVIDIA B200
architecturessm_100
dtypesfp16
Benchmark evidence
25 measurements across 1 GPU, fastest first.
Operation / workload
Hardware
Latency
Rank
Observed
Show all 25 measurements ›Showing all 25 measurements ⌄
Reproduction-ready · How evidence levels are derived →
Source and license
sourcehttps://huggingface.co/datasets/flashinfer-ai/flashinfer-trace
commitda915083d4c7c5e61aa3005e3d17ae488e0fc71c
revision digestsha256:4d4e9546c44a877709066a939c301037ce1372cb021b718f6f61c33d90199a9e
license declaredApache-2.0
license concludedApache-2.0
authorsgpt-o3
imported2026-08-20
Kernel source
main.cpp49 lines
#include "kernel.h"
#include <ATen/cuda/CUDAContext.h>
#include <torch/extension.h>
#include <vector>
/* Public entry point exposed to Python.
Accepts:
A : torch.float16 [M , 2048] (CUDA)
B : torch.float16 [5120 , 2048](CUDA)
Returns:
C : torch.float16 [M , 5120] (CUDA) */
torch::Tensor run(torch::Tensor A, torch::Tensor B) {
/* Basic argument checking */
TORCH_CHECK(A.is_cuda() && B.is_cuda(), "Inputs must reside on the GPU");
TORCH_CHECK(A.scalar_type() == torch::kFloat16 &&
B.scalar_type() == torch::kFloat16,
"Inputs must be float16 / half");
TORCH_CHECK(A.dim() == 2 && B.dim() == 2,
"Inputs must be 2-D matrices");
TORCH_CHECK(A.size(1) == GEMM_K,
"A must have shape [M , 2048]");
TORCH_CHECK(B.size(0) == GEMM_N && B.size(1) == GEMM_K,
"B must have shape [5120 , 2048]");
const int64_t M = A.size(0);
/* Allocate output tensor on the same device */
auto C = torch::empty({M, GEMM_N},
torch::dtype(torch::kFloat16).device(A.device()));
/* Extract the current CUDA stream used by PyTorch */
cudaStream_t stream = at::cuda::getCurrentCUDAStream().stream();
/* Launch the optimised GEMM */
gemm_n5120_k2048(
reinterpret_cast<const __half*>(A.data_ptr<at::Half>()),
reinterpret_cast<const __half*>(B.data_ptr<at::Half>()),
reinterpret_cast<__half*>(C.data_ptr<at::Half>()),
static_cast<int>(M),
stream);
return C;
}
/* PyBind11 module declaration */
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
m.def("run", &run, "Optimised GEMM (B200, fp16)");
}scrolls · 49 lines total
Source code from FlashInfer-Bench (flashinfer-ai/flashinfer-trace) · Apache-2.0
Best evidence level for this revision: reproducible
JSON