gpt-5 / cuda8ba217
gpt-5_cuda_8ba217 · gpt-5-2025-08-07 · cuda · Apache-2.0
Kernel source · 52 lines ↓holds 2 records
Use it
Vendorable · source mirrored · Apache-2.0View source →
No package. Vendor the mirrored source: 52 lines, Apache-2.0, pinned at da91508.
main.cpp
curl "https://kernelindex.com/api/v1/implementations/flashinfer-gpt-5-cuda-8ba217?include=source"interfacecuda
revisionda915083d4c7
symbolrun
pathmain.cpp
Compatibility
measured onNVIDIA B200
declared hardwareNVIDIA B200
architecturessm_100
dtypesfp16
Benchmark evidence
43 measurements across 1 GPU, fastest first.
Operation / workload
Hardware
Latency
Rank
Observed
Show all 43 measurements ›Showing all 43 measurements ⌄
Reproduction-ready · How evidence levels are derived →
Source and license
sourcehttps://huggingface.co/datasets/flashinfer-ai/flashinfer-trace
commitda915083d4c7c5e61aa3005e3d17ae488e0fc71c
revision digestsha256:5403fa34448dd4b18ceaf939fd50ff8eedf46ec6e2099e0e3aa06cc72b24de7a
license declaredApache-2.0
license concludedApache-2.0
authorsgpt-5-2025-08-07
imported2026-08-20
Kernel source
main.cpp52 lines
#include <torch/extension.h>
#include <ATen/cuda/CUDAContext.h>
#include <cuda_runtime.h>
#include <cuda_fp16.h>
#include <stdexcept>
#include <string>
#include "kernel.h"
namespace py = pybind11;
static void validate_inputs(const torch::Tensor& A, const torch::Tensor& B) {
if (!A.is_cuda() || !B.is_cuda())
throw std::invalid_argument("A and B must be CUDA tensors");
if (A.scalar_type() != at::kHalf || B.scalar_type() != at::kHalf)
throw std::invalid_argument("A and B must be float16 (Half) tensors");
if (A.dim() != 2 || B.dim() != 2)
throw std::invalid_argument("A and B must be 2D tensors");
if (A.size(1) != CONST_K)
throw std::invalid_argument("A.shape[1] must be 4096");
if (B.size(0) != CONST_N || B.size(1) != CONST_K)
throw std::invalid_argument("B must have shape [28672, 4096]");
if (A.device().index() != B.device().index())
throw std::invalid_argument("A and B must be on the same CUDA device");
}
torch::Tensor run(torch::Tensor A, torch::Tensor B) {
validate_inputs(A, B);
if (!A.is_contiguous()) A = A.contiguous();
if (!B.is_contiguous()) B = B.contiguous();
const int64_t M = A.size(0);
auto options = A.options();
torch::Tensor C = torch::empty({M, (int64_t)CONST_N}, options);
const __half* A_ptr = reinterpret_cast<const __half*>(A.data_ptr<at::Half>());
const __half* B_ptr = reinterpret_cast<const __half*>(B.data_ptr<at::Half>());
__half* C_ptr = reinterpret_cast<__half*>(C.data_ptr<at::Half>());
cudaStream_t stream = at::cuda::getCurrentCUDAStream().stream();
gemm_n_28672_k_4096(A_ptr, B_ptr, C_ptr, M, stream);
CUDA_CHECK(cudaGetLastError());
return C;
}
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
m.def("run", &run, "gemm_n_28672_k_4096 (CUDA, cuBLASLt if available)",
py::arg("A"), py::arg("B"));
}scrolls · 52 lines total
Source code from FlashInfer-Bench (flashinfer-ai/flashinfer-trace) · Apache-2.0
Best evidence level for this revision: reproducible
JSON