Skip to content
KernelIndex
Search⌘K

cuda_sparse_nvfp4_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: 10 lines, Apache-2.0, pinned at da91508.

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

Benchmark evidence

2 measurements across 1 GPU, fastest first.

Operation / workload
Hardware
Latency
Rank
Observed
Sparse GEMM NVFP4 n2048 k2048int8 · [2048, 1024] · m=64
NVIDIA B200
1.54ms
#1 of 1
2026-06-06
Sparse GEMM NVFP4 n2048 k2048int8 · [2048, 1024] · m=128
NVIDIA B200
2.74ms
#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:997045efe13d7270fd9bad2fd114794bbb5f6c5e272bd6ca75a5b49c94a5f1b4
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.

fp4PYBIND11_MODULE(TORCH_EXTENSION_NAME,m){m.def("run",&run,"sparse nvfp4 gemm",py::arg("A_vals"),py::arg("A_meta"),py::arg("A_scale"),py::arg("B_fp4"),py::arg("B_scale"));}

Kernel source

main.cpp10 lines
#include "kernel.h"
#include <torch/extension.h>
torch::Tensor run(torch::Tensor A_vals,torch::Tensor A_meta,torch::Tensor A_scale,torch::Tensor B_fp4,torch::Tensor B_scale){
    auto Av=A_vals.contiguous();auto Am=A_meta.contiguous();auto As=A_scale.contiguous();auto B=B_fp4.contiguous();auto Bs=B_scale.contiguous();
    const auto M=Av.size(0); const auto N=B.size(0);
    auto C=torch::empty({M,N},torch::dtype(at::kBFloat16).device(Av.device()));
    launch_sparse_nvfp4(Av,Am,As,B,Bs,C); return C;
}
PYBIND11_MODULE(TORCH_EXTENSION_NAME,m){m.def("run",&run,"sparse nvfp4 gemm",py::arg("A_vals"),py::arg("A_meta"),py::arg("A_scale"),py::arg("B_fp4"),py::arg("B_scale"));}

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

Best evidence level for this revision: reproducible

JSON