Skip to content
KernelIndex
Search⌘K

cuda_fp4_fp8_naive_n2048_k2048

FlashInfer-Bench baselines · cuda · Apache-2.0

Use it

Vendorable · source mirrored · Apache-2.0View source →

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

main.cpp
curl "https://kernelindex.com/api/v1/implementations/flashinfer-cuda-fp4-fp8-naive-n2048-k2048?include=source"
interfacecuda
revisionda915083d4c7
symbolrun
pathmain.cpp
Compatibility
measured onNVIDIA B200
declared hardwareNVIDIA B200
architecturessm_100
dtypesfp8_e4m3, int8

Benchmark evidence

2 measurements across 1 GPU, fastest first.

Operation / workload
Hardware
Latency
Rank
Observed
GEMM fp4 FP8 n2048 k2048fp8_e4m3 · [64, 1024]
NVIDIA B200
1.59ms
#1 of 1
2026-06-06
GEMM fp4 FP8 n2048 k2048fp8_e4m3 · [128, 1024]
NVIDIA B200
2.82ms
#1 of 1
2026-06-06

Reproduction-ready · How evidence levels are derived →

Source and license

sourcehttps://huggingface.co/datasets/flashinfer-ai/flashinfer-trace
commitda915083d4c7c5e61aa3005e3d17ae488e0fc71c
revision digestsha256:c0ed3107c230bcfee6c8adfbf39fb727632de9937682f63cfcde5cdc64af1476
license declaredApache-2.0
license concludedApache-2.0
authorsbaseline
imported2026-08-16

Techniques

Extracted from the mirrored source by pattern, never inferred. Each row cites its line.

fp4m.def("run", &run, "Unscaled FP4 x FP8 GEMM", py::arg("A_fp4"), py::arg("B_fp8"));

Kernel source

main.cpp18 lines
#include "kernel.h"
#include <torch/extension.h>

torch::Tensor run(torch::Tensor A_fp4, torch::Tensor B_fp8) {
    TORCH_CHECK(A_fp4.is_cuda() && B_fp8.is_cuda(), "inputs must be CUDA");
    auto A = A_fp4.contiguous();
    auto B = B_fp8.contiguous();
    const auto M = A.size(0);
    const auto N = B.size(0);
    auto C = torch::empty({M, N}, torch::dtype(at::kBFloat16).device(A.device()));
    launch_gemm_fp4_fp8(A, B, C);
    return C;
}

PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
    m.def("run", &run, "Unscaled FP4 x FP8 GEMM", py::arg("A_fp4"), py::arg("B_fp8"));
}

Source code from FlashInfer-Bench (flashinfer-ai/flashinfer-trace) · Apache-2.0

Best evidence level for this revision: reproducible

JSON