repo
stringclasses
3 values
commit
stringlengths
40
40
date
stringdate
2023-04-02 02:30:17-0500
2026-10-18 07:42:16-0500
pr_number
int64
20
61.9k
⌀
pr_url
stringlengths
44
53
⌀
title
stringlengths
8
263
message
stringlengths
8
8k
path
stringlengths
10
155
language
stringclasses
4 values
license
stringclasses
4 values
before_code
stringlengths
160
118k
after_code
stringlengths
340
120k
diff
stringlengths
149
51k
lines_added
int64
0
729
lines_removed
int64
0
488
files_in_commit
int64
1
10
models_mentioned
listlengths
0
4
hardware_mentioned
listlengths
0
16
speedup_claims
listlengths
0
10
prompt
stringlengths
569
119k
pr_body
stringlengths
0
24k
gains
stringlengths
2
197k
kernel_speedup
float64
0.78
150
⌀
e2e_speedup
float64
0.76
136
⌀
flashinfer
5a4b54bed1dfe6f112cd4ec9bc196da517369f46
2026-08-03T14:43:37-07:00
4,285
https://github.com/flashinfer-ai/flashinfer/pull/4285
perf(moe): sync SM12x NVFP4 fused-MoE kernels to b12x HEAD (#4285)
perf(moe): sync SM12x NVFP4 fused-MoE kernels to b12x HEAD (#4285) ## 📌 Description Syncs the SM12x NVFP4 (W4A4) fused-MoE kernels behind `b12x_fused_moe` and `B12xMoEWrapper` with upstream [b12x](https://github.com/local-inference-lab/sparkinfer) at `f9be272`, reaching backend parity. The module now has four kerne...
flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_micro_kernel.py
cute_dsl
Apache-2.0
""" MoEMicroKernel — micro-scheduled routed NVFP4 MoE kernel for SM120/SM121 (Blackwell). Ported from the b12x kernel library to FlashInfer. This is the micro control-plane fusion step for decode workloads: keep the proven FC1/FC2 compute body, but pull the route/pack frontend into the same resident kernel, using pre...
""" MoEMicroKernel — micro-scheduled routed NVFP4 MoE kernel for SM120/SM121 (Blackwell). Ported from the b12x kernel library to FlashInfer. This is the micro control-plane fusion step for decode workloads: keep the proven FC1/FC2 compute body, but pull the route/pack frontend into the same resident kernel, using pre...
--- flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_micro_kernel.py +++ flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_micro_kernel.py @@ -380,9 +380,10 @@ self.acc_dtype = cutlass.Float32 self.sf_vec_size = sf_vec_size self.input_scales_are_reciprocal = input_scales_are_reciprocal - ...
6
2
8
[]
[ "RTX5080", "SM121" ]
[ "1.06x", "1.30x", "1.40x", "1.00x", "1.00x", "1.00x", "1.10x", "1.10x", "1.09x", "1.00x" ]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_micro_kernel.py). Goal: perf(moe): sync SM12x NVFP4 fused-MoE kernels to b12x HEAD Target hardware: RTX5080, SM121 Target models: unspecified Current file: ```python """ MoEMicroKernel — micro-scheduled routed NVFP4 ...
## 📌 Description Syncs the SM12x NVFP4 (W4A4) fused-MoE kernels behind `b12x_fused_moe` and `B12xMoEWrapper` with upstream [b12x](https://github.com/local-inference-lab/sparkinfer) at `f9be272`, reaching backend parity. The module now has four kernels. `MoEDirectMicroKernel` takes the smallest decode batches, `MoEMi...
[{"scope": "e2e", "hardware": "DGX Spark", "model": null, "shape": "decode, batch 1-2", "batch_size": null, "metric": "speedup", "unit": null, "higher_is_better": true, "baseline": null, "optimized": null, "stated_speedup": 1.06, "speedup": 1.06}, {"scope": "e2e", "hardware": "RTX 5080", "model": null, "shape": "decode...
null
1.03
flashinfer
5a4b54bed1dfe6f112cd4ec9bc196da517369f46
2026-08-03T14:43:37-07:00
4,285
https://github.com/flashinfer-ai/flashinfer/pull/4285
perf(moe): sync SM12x NVFP4 fused-MoE kernels to b12x HEAD (#4285)
perf(moe): sync SM12x NVFP4 fused-MoE kernels to b12x HEAD (#4285) ## 📌 Description Syncs the SM12x NVFP4 (W4A4) fused-MoE kernels behind `b12x_fused_moe` and `B12xMoEWrapper` with upstream [b12x](https://github.com/local-inference-lab/sparkinfer) at `f9be272`, reaching backend parity. The module now has four kerne...
flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_static_kernel.py
cute_dsl
Apache-2.0
""" MoEStaticKernel — static-scheduled routed NVFP4 MoE kernel for SM120/SM121 (Blackwell). Ported from the b12x kernel library to FlashInfer. This is the current static control-plane fusion step: keep the proven FC1/FC2 compute body, but pull the route/pack frontend into the same resident kernel. The result is still...
""" MoEStaticKernel — static-scheduled routed NVFP4 MoE kernel for SM120/SM121 (Blackwell). Ported from the b12x kernel library to FlashInfer. This is the current static control-plane fusion step: keep the proven FC1/FC2 compute body, but pull the route/pack frontend into the same resident kernel. The result is still...
--- flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_static_kernel.py +++ flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_static_kernel.py @@ -113,12 +113,13 @@ quantize_block_fp4, quantize_block_fp4_fast, get_ptr_as_int64, + ld_shared_i32_relaxed, st_global_f32, st_global_i32, share...
78
34
8
[]
[ "RTX5080", "SM121" ]
[ "1.06x", "1.30x", "1.40x", "1.00x", "1.00x", "1.00x", "1.10x", "1.10x", "1.09x", "1.00x" ]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_static_kernel.py). Goal: perf(moe): sync SM12x NVFP4 fused-MoE kernels to b12x HEAD Target hardware: RTX5080, SM121 Target models: unspecified Current file: ```python """ MoEStaticKernel — static-scheduled routed NVF...
## 📌 Description Syncs the SM12x NVFP4 (W4A4) fused-MoE kernels behind `b12x_fused_moe` and `B12xMoEWrapper` with upstream [b12x](https://github.com/local-inference-lab/sparkinfer) at `f9be272`, reaching backend parity. The module now has four kernels. `MoEDirectMicroKernel` takes the smallest decode batches, `MoEMi...
[{"scope": "e2e", "hardware": "DGX Spark", "model": null, "shape": "decode, batch 1-2", "batch_size": null, "metric": "speedup", "unit": null, "higher_is_better": true, "baseline": null, "optimized": null, "stated_speedup": 1.06, "speedup": 1.06}, {"scope": "e2e", "hardware": "RTX 5080", "model": null, "shape": "decode...
null
1.03
flashinfer
4433996e45def64146c3aaf71341c4090a00c4fa
2026-08-03T05:39:45-07:00
4,279
https://github.com/flashinfer-ai/flashinfer/pull/4279
feat(cake_kda): add optimized B200 recurrent decode backend (#4279)
feat(cake_kda): add optimized B200 recurrent decode backend (#4279) ## 📌 Description This PR exports the CAKE internal recurrent-KDA decode family as 23 frozen CUDA modules behind the existing public `flashinfer.kda_decode.recurrent_kda` API. The export covers the exact B200 (`sm_100a`) BF16 D128 contracts for `T=1....
flashinfer/kda_kernels/recurrent_kda.py
cute_dsl
Apache-2.0
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
--- flashinfer/kda_kernels/recurrent_kda.py +++ flashinfer/kda_kernels/recurrent_kda.py @@ -36,7 +36,7 @@ import functools import math -from typing import Callable, Optional +from typing import Callable, Literal, Optional, cast import cutlass import cutlass.cute as cute @@ -47,6 +47,12 @@ from cutlass.cute.run...
428
1
4
[]
[ "B200", "CPU", "SM100" ]
[ "1.0923x", "1.0922x", "1.0905x", "1.0869x", "1.0689x", "1.0705x", "1.0710x", "1.0709x", "1.1470x", "1.1622x" ]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/kda_kernels/recurrent_kda.py). Goal: feat(cake_kda): add optimized B200 recurrent decode backend Target hardware: B200, CPU, SM100 Target models: unspecified Current file: ```python """ Copyright (c) 2025 by FlashInfer team. Licensed under the Apache Lic...
Developed by the **CAKE team**, the kernels in this PR **outperform** the relevant **SOTA baselines at the time of merge** on the **vast majority of performance benchmark shapes**, matching them otherwise. ## 📌 Description This PR exports the CAKE internal recurrent-KDA decode family as 23 frozen CUDA modules behind...
[{"scope": "kernel", "hardware": "B200", "model": null, "shape": "T=1,H=16,HV=32", "batch_size": 8, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 7.008, "optimized": 6.336, "stated_speedup": 1.1061, "speedup": 1.1061}, {"scope": "kernel", "hardware": "B200", "model": null, "shape": "T=1,H=16...
1.1349
null
flashinfer
dca55465f65ddd8513f79007b3482e9f348e62b3
2026-07-31T00:26:24-07:00
3,575
https://github.com/flashinfer-ai/flashinfer/pull/3575
perf: optimize trtllm_fmha_v2 fp8 causal attention q-tile scheduling & decoding for uniform seqlen (#3575)
perf: optimize trtllm_fmha_v2 fp8 causal attention q-tile scheduling & decoding for uniform seqlen (#3575) <!-- .github/pull_request_template.md --> ## 📌 Description The default logical order q-tile scheduling computes the heaviest (most work) tiles last in the case of causal attention (these tiles have the longest...
csrc/fmha_v2_run.cu
cuda
Apache-2.0
/* * Copyright (c) 2023-2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
/* * Copyright (c) 2023-2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
--- csrc/fmha_v2_run.cu +++ csrc/fmha_v2_run.cu @@ -630,6 +630,11 @@ scale_softmax, scale_bmm2, softcapping_scale_bmm1, false, false, false, has_alibi, skip_softmax_threshold_scale_factor); + // All Q lengths are equal iff they sum to b * max_q_len (each one is <= max_q_len). + // Padded batches decom...
8
0
5
[ "qwen" ]
[ "H200" ]
[ "1.28x", "0.99x", "1.20x", "0.99x", "1.08x", "1.06x", "1.04x", "1.04x", "1.00x", "1.00x" ]
Optimize this cuda kernel file from flashinfer (csrc/fmha_v2_run.cu). Goal: perf: optimize trtllm_fmha_v2 fp8 causal attention q-tile scheduling & decoding for uniform seqlen Target hardware: H200 Target models: qwen Current file: ```cuda /* * Copyright (c) 2023-2025 by FlashInfer team. * * Licensed under the Apac...
<!-- .github/pull_request_template.md --> ## 📌 Description The default logical order q-tile scheduling computes the heaviest (most work) tiles last in the case of causal attention (these tiles have the longest KV to attend to). We currently enable reverse q-tile scheduling within heads. However, if we know the input...
[{"scope": "kernel", "hardware": "H200", "model": "qwen3-8b", "shape": null, "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 29.54, "optimized": 23.05, "stated_speedup": null, "speedup": 1.2816}, {"scope": "kernel", "hardware": "H200", "model": "qwen3-8b", "shape": null, "batc...
1.0362
null
flashinfer
dca55465f65ddd8513f79007b3482e9f348e62b3
2026-07-31T00:26:24-07:00
3,575
https://github.com/flashinfer-ai/flashinfer/pull/3575
perf: optimize trtllm_fmha_v2 fp8 causal attention q-tile scheduling & decoding for uniform seqlen (#3575)
perf: optimize trtllm_fmha_v2 fp8 causal attention q-tile scheduling & decoding for uniform seqlen (#3575) <!-- .github/pull_request_template.md --> ## 📌 Description The default logical order q-tile scheduling computes the heaviest (most work) tiles last in the case of causal attention (these tiles have the longest...
csrc/trtllm_fmha_v2_binding.cu
cuda
Apache-2.0
/* * Copyright (c) 2023-2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
/* * Copyright (c) 2023-2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
--- csrc/trtllm_fmha_v2_binding.cu +++ csrc/trtllm_fmha_v2_binding.cu @@ -409,6 +409,9 @@ false, // is_s_padded false); // has_alibi + // cu_seqlens is built above as i * q_seqlen, so the batch is uniform by construction. + params.is_uniform_q = batch_size > 0; + if (...
3
0
5
[ "qwen" ]
[ "H200" ]
[ "1.28x", "0.99x", "1.20x", "0.99x", "1.08x", "1.06x", "1.04x", "1.04x", "1.00x", "1.00x" ]
Optimize this cuda kernel file from flashinfer (csrc/trtllm_fmha_v2_binding.cu). Goal: perf: optimize trtllm_fmha_v2 fp8 causal attention q-tile scheduling & decoding for uniform seqlen Target hardware: H200 Target models: qwen Current file: ```cuda /* * Copyright (c) 2023-2025 by FlashInfer team. * * Licensed und...
<!-- .github/pull_request_template.md --> ## 📌 Description The default logical order q-tile scheduling computes the heaviest (most work) tiles last in the case of causal attention (these tiles have the longest KV to attend to). We currently enable reverse q-tile scheduling within heads. However, if we know the input...
[{"scope": "kernel", "hardware": "H200", "model": "qwen3-8b", "shape": null, "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 29.54, "optimized": 23.05, "stated_speedup": null, "speedup": 1.2816}, {"scope": "kernel", "hardware": "H200", "model": "qwen3-8b", "shape": null, "batc...
1.0362
null
flashinfer
cd1342af6f633afaf8f1c6e1286c1e5027cae4e6
2026-07-28T09:03:48+08:00
4,152
https://github.com/flashinfer-ai/flashinfer/pull/4152
[perf] Optimize TRT-LLM routing for high-expert, high-top-k workloads (#4152)
[perf] Optimize TRT-LLM routing for high-expert, high-top-k workloads (#4152) <!-- .github/pull_request_template.md --> ## 📌 Description - Add Tier<896, 16> to the routing and post-TopK policy tables, avoiding fallback to Tier<1024, 32>. Static-block dimensions now follow the selected policy tier. - Add `reduceTo...
csrc/fused_moe/trtllm_backend/trtllm_fused_moe_routing_common.cu
cuda
Apache-2.0
/* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/fused_moe/trtllm_backend/trtllm_fused_moe_routing_common.cu +++ csrc/fused_moe/trtllm_backend/trtllm_fused_moe_routing_common.cu @@ -23,7 +23,7 @@ // and the kernel was actually launched; the definitions live in // trtllm_fused_moe_routing_custom.cu. Keep these signatures in sync (the return // type is not ...
2
2
5
[]
[ "SM90" ]
[ "1.1253x", "1.0008x", "1.1909x", "1.1623x", "1.1545x", "1.0012x", "1.1711x", "1.0673x", "1.1250x", "1.0169x" ]
Optimize this cuda kernel file from flashinfer (csrc/fused_moe/trtllm_backend/trtllm_fused_moe_routing_common.cu). Goal: [perf] Optimize TRT-LLM routing for high-expert, high-top-k workloads Target hardware: SM90 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All...
<!-- .github/pull_request_template.md --> ## 📌 Description - Add Tier<896, 16> to the routing and post-TopK policy tables, avoiding fallback to Tier<1024, 32>. Static-block dimensions now follow the selected policy tier. - Add `reduceTopKForLane`, where each lane retains only its assigned TopK rank instead of mater...
[{"scope": "kernel", "hardware": null, "model": null, "shape": "E=256,K=8", "batch_size": 1024, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 9.219, "optimized": 8.192, "stated_speedup": 1.1253, "speedup": 1.1254}, {"scope": "kernel", "hardware": null, "model": null, "shape": "E=256,K=8", "b...
1.0769
null
flashinfer
cd1342af6f633afaf8f1c6e1286c1e5027cae4e6
2026-07-28T09:03:48+08:00
4,152
https://github.com/flashinfer-ai/flashinfer/pull/4152
[perf] Optimize TRT-LLM routing for high-expert, high-top-k workloads (#4152)
[perf] Optimize TRT-LLM routing for high-expert, high-top-k workloads (#4152) <!-- .github/pull_request_template.md --> ## 📌 Description - Add Tier<896, 16> to the routing and post-TopK policy tables, avoiding fallback to Tier<1024, 32>. Static-block dimensions now follow the selected policy tier. - Add `reduceTo...
csrc/fused_moe/trtllm_backend/trtllm_fused_moe_routing_custom.cu
cuda
Apache-2.0
/* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/fused_moe/trtllm_backend/trtllm_fused_moe_routing_custom.cu +++ csrc/fused_moe/trtllm_backend/trtllm_fused_moe_routing_custom.cu @@ -300,8 +300,10 @@ // Returns whether a compiled tier covered the runtime (numExperts, topK) and the // kernel was actually launched. A false return means no routing output was w...
214
73
5
[]
[ "SM90" ]
[ "1.1253x", "1.0008x", "1.1909x", "1.1623x", "1.1545x", "1.0012x", "1.1711x", "1.0673x", "1.1250x", "1.0169x" ]
Optimize this cuda kernel file from flashinfer (csrc/fused_moe/trtllm_backend/trtllm_fused_moe_routing_custom.cu). Goal: [perf] Optimize TRT-LLM routing for high-expert, high-top-k workloads Target hardware: SM90 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All...
<!-- .github/pull_request_template.md --> ## 📌 Description - Add Tier<896, 16> to the routing and post-TopK policy tables, avoiding fallback to Tier<1024, 32>. Static-block dimensions now follow the selected policy tier. - Add `reduceTopKForLane`, where each lane retains only its assigned TopK rank instead of mater...
[{"scope": "kernel", "hardware": null, "model": null, "shape": "E=256,K=8", "batch_size": 1024, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 9.219, "optimized": 8.192, "stated_speedup": 1.1253, "speedup": 1.1254}, {"scope": "kernel", "hardware": null, "model": null, "shape": "E=256,K=8", "b...
1.0769
null
flashinfer
cd1342af6f633afaf8f1c6e1286c1e5027cae4e6
2026-07-28T09:03:48+08:00
4,152
https://github.com/flashinfer-ai/flashinfer/pull/4152
[perf] Optimize TRT-LLM routing for high-expert, high-top-k workloads (#4152)
[perf] Optimize TRT-LLM routing for high-expert, high-top-k workloads (#4152) <!-- .github/pull_request_template.md --> ## 📌 Description - Add Tier<896, 16> to the routing and post-TopK policy tables, avoiding fallback to Tier<1024, 32>. Static-block dimensions now follow the selected policy tier. - Add `reduceTo...
include/flashinfer/trtllm/fused_moe/RoutingCustomPolicy.cuh
cuda
Apache-2.0
/* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- include/flashinfer/trtllm/fused_moe/RoutingCustomPolicy.cuh +++ include/flashinfer/trtllm/fused_moe/RoutingCustomPolicy.cuh @@ -393,6 +393,7 @@ struct ScaledSumNormalizePostprocess { /// Opts into the block-per-token kernel (provides applyWithAux below). static constexpr bool kSupportsBlockPerToken = true; +...
87
2
5
[]
[ "SM90" ]
[ "1.1253x", "1.0008x", "1.1909x", "1.1623x", "1.1545x", "1.0012x", "1.1711x", "1.0673x", "1.1250x", "1.0169x" ]
Optimize this cuda kernel file from flashinfer (include/flashinfer/trtllm/fused_moe/RoutingCustomPolicy.cuh). Goal: [perf] Optimize TRT-LLM routing for high-expert, high-top-k workloads Target hardware: SM90 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All righ...
<!-- .github/pull_request_template.md --> ## 📌 Description - Add Tier<896, 16> to the routing and post-TopK policy tables, avoiding fallback to Tier<1024, 32>. Static-block dimensions now follow the selected policy tier. - Add `reduceTopKForLane`, where each lane retains only its assigned TopK rank instead of mater...
[{"scope": "kernel", "hardware": null, "model": null, "shape": "E=256,K=8", "batch_size": 1024, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 9.219, "optimized": 8.192, "stated_speedup": 1.1253, "speedup": 1.1254}, {"scope": "kernel", "hardware": null, "model": null, "shape": "E=256,K=8", "b...
1.0769
null
flashinfer
cd1342af6f633afaf8f1c6e1286c1e5027cae4e6
2026-07-28T09:03:48+08:00
4,152
https://github.com/flashinfer-ai/flashinfer/pull/4152
[perf] Optimize TRT-LLM routing for high-expert, high-top-k workloads (#4152)
[perf] Optimize TRT-LLM routing for high-expert, high-top-k workloads (#4152) <!-- .github/pull_request_template.md --> ## 📌 Description - Add Tier<896, 16> to the routing and post-TopK policy tables, avoiding fallback to Tier<1024, 32>. Static-block dimensions now follow the selected policy tier. - Add `reduceTo...
include/flashinfer/trtllm/fused_moe/RoutingKernel.cuh
cuda
Apache-2.0
/* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- include/flashinfer/trtllm/fused_moe/RoutingKernel.cuh +++ include/flashinfer/trtllm/fused_moe/RoutingKernel.cuh @@ -267,12 +267,16 @@ using OutputT = typename KernelParams::OutputT; using TypePacked = PackedScoreIdx<BaseType>; - // When MaxNumExperts > NumThreads, each thread handles multiple experts. + /...
15
6
5
[]
[ "SM90" ]
[ "1.1253x", "1.0008x", "1.1909x", "1.1623x", "1.1545x", "1.0012x", "1.1711x", "1.0673x", "1.1250x", "1.0169x" ]
Optimize this cuda kernel file from flashinfer (include/flashinfer/trtllm/fused_moe/RoutingKernel.cuh). Goal: [perf] Optimize TRT-LLM routing for high-expert, high-top-k workloads Target hardware: SM90 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All rights res...
<!-- .github/pull_request_template.md --> ## 📌 Description - Add Tier<896, 16> to the routing and post-TopK policy tables, avoiding fallback to Tier<1024, 32>. Static-block dimensions now follow the selected policy tier. - Add `reduceTopKForLane`, where each lane retains only its assigned TopK rank instead of mater...
[{"scope": "kernel", "hardware": null, "model": null, "shape": "E=256,K=8", "batch_size": 1024, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 9.219, "optimized": 8.192, "stated_speedup": 1.1253, "speedup": 1.1254}, {"scope": "kernel", "hardware": null, "model": null, "shape": "E=256,K=8", "b...
1.0769
null
flashinfer
cd1342af6f633afaf8f1c6e1286c1e5027cae4e6
2026-07-28T09:03:48+08:00
4,152
https://github.com/flashinfer-ai/flashinfer/pull/4152
[perf] Optimize TRT-LLM routing for high-expert, high-top-k workloads (#4152)
[perf] Optimize TRT-LLM routing for high-expert, high-top-k workloads (#4152) <!-- .github/pull_request_template.md --> ## 📌 Description - Add Tier<896, 16> to the routing and post-TopK policy tables, avoiding fallback to Tier<1024, 32>. Static-block dimensions now follow the selected policy tier. - Add `reduceTo...
include/flashinfer/trtllm/fused_moe/RoutingKernelTopK.cuh
cuda
Apache-2.0
/* * Copyright (c) 2022-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2022-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- include/flashinfer/trtllm/fused_moe/RoutingKernelTopK.cuh +++ include/flashinfer/trtllm/fused_moe/RoutingKernelTopK.cuh @@ -320,6 +320,70 @@ } }; +/// Capability envelope for the high-expert lane-owned routing specialization. +/// This predicate is shared by compile-time tier selection and runtime dispatch; +...
64
0
5
[]
[ "SM90" ]
[ "1.1253x", "1.0008x", "1.1909x", "1.1623x", "1.1545x", "1.0012x", "1.1711x", "1.0673x", "1.1250x", "1.0169x" ]
Optimize this cuda kernel file from flashinfer (include/flashinfer/trtllm/fused_moe/RoutingKernelTopK.cuh). Goal: [perf] Optimize TRT-LLM routing for high-expert, high-top-k workloads Target hardware: SM90 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2022-2025, NVIDIA CORPORATION. All rights...
<!-- .github/pull_request_template.md --> ## 📌 Description - Add Tier<896, 16> to the routing and post-TopK policy tables, avoiding fallback to Tier<1024, 32>. Static-block dimensions now follow the selected policy tier. - Add `reduceTopKForLane`, where each lane retains only its assigned TopK rank instead of mater...
[{"scope": "kernel", "hardware": null, "model": null, "shape": "E=256,K=8", "batch_size": 1024, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 9.219, "optimized": 8.192, "stated_speedup": 1.1253, "speedup": 1.1254}, {"scope": "kernel", "hardware": null, "model": null, "shape": "E=256,K=8", "b...
1.0769
null
flashinfer
f057e15bdf8285509f86bac3004adf25a274f121
2026-07-28T03:03:54+08:00
4,133
https://github.com/flashinfer-ai/flashinfer/pull/4133
[GDN] improve sm100 GDN performance (#4133)
[GDN] improve sm100 GDN performance (#4133) ## What Optimizes the Blackwell SM100 chunk-stream Gated Delta Net (GDN) prefill kernel. Coauthored by @guangyunh-nv @jhjpark ## Test environment - **GPU:** NVIDIA B300 SXM6 AC — Blackwell (SM100) - **Compile:** `--enable-tvm-ffi --opt-level 3` - **Dtype:** bf16 in/out, ...
flashinfer/gdn_kernels/blackwell/gdn_prefill.py
cute_dsl
Apache-2.0
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
--- flashinfer/gdn_kernels/blackwell/gdn_prefill.py +++ flashinfer/gdn_kernels/blackwell/gdn_prefill.py @@ -207,6 +207,10 @@ gdn = GatedDeltaNetChunkedKernel( io_dtype=io_dtype, + # The kernel requires the triangular-inverse dtype to match io_dtype + # (asserted in its __in...
5
1
2
[]
[ "B300", "BLACKWELL", "SM100" ]
[ "1.25x", "1.07x", "1.32x", "1.29x", "1.28x", "1.28x", "1.28x", "1.28x", "1.31x", "1.27x" ]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/gdn_kernels/blackwell/gdn_prefill.py). Goal: [GDN] improve sm100 GDN performance Target hardware: B300, BLACKWELL, SM100 Target models: unspecified Current file: ```python """ Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Vers...
## What Optimizes the Blackwell SM100 chunk-stream Gated Delta Net (GDN) prefill kernel. Coauthored by @guangyunh-nv @jhjpark ## Test environment - **GPU:** NVIDIA B300 SXM6 AC — Blackwell (SM100) - **Compile:** `--enable-tvm-ffi --opt-level 3` - **Dtype:** bf16 in/out, fp32 state + accumulation - **Benchmark:** `b...
[{"scope": "kernel", "hardware": "B300 SXM6 AC", "model": null, "shape": "h_qk/h_v=2/8, seqlen=1x65536", "batch_size": null, "metric": "latency", "unit": "ms", "higher_is_better": false, "baseline": 2.352, "optimized": 1.827, "stated_speedup": 1.29, "speedup": 1.2874}, {"scope": "kernel", "hardware": "B300 SXM6 AC", "m...
1.264
null
flashinfer
0f5bb82457f3c79c1747c951eecab9f658cea351
2026-07-23T21:48:03+08:00
4,063
https://github.com/flashinfer-ai/flashinfer/pull/4063
perf(sm103): optimize NVFP4 epilogue stores and scaling (#4063)
perf(sm103): optimize NVFP4 epilogue stores and scaling (#4063) ## 📌 Description This PR optimizes the native SM103 (`CTA_K=768`) CUTLASS NVFP4 GEMM epilogue: - Keeps the source/C alignment at 128 bits and raises the D/output alignment to 256 bits, enabling 256-bit global stores in the native SM103 no-smem epilogue...
csrc/fp4_gemm_cutlass_sm103.cu
cuda
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/fp4_gemm_cutlass_sm103.cu +++ csrc/fp4_gemm_cutlass_sm103.cu @@ -99,6 +99,7 @@ int64_t tactic) { CHECK_INPUT_AND_TYPE(mat1, FLOAT4_E2M1X2); CHECK_INPUT_AND_TYPE(mat2, FLOAT4_E2M1X2); + CHECK_INPUT(out); int mat2_k_scale = 1;
1
0
6
[]
[ "B300", "SM100", "SM103" ]
[ "1.115×", "1.120×", "1.157×", "1.161×" ]
Optimize this cuda kernel file from flashinfer (csrc/fp4_gemm_cutlass_sm103.cu). Goal: perf(sm103): optimize NVFP4 epilogue stores and scaling Target hardware: B300, SM100, SM103 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed un...
## 📌 Description This PR optimizes the native SM103 (`CTA_K=768`) CUTLASS NVFP4 GEMM epilogue: - Keeps the source/C alignment at 128 bits and raises the D/output alignment to 256 bits, enabling 256-bit global stores in the native SM103 no-smem epilogue. - Adds a local CUTLASS fusion callback that evaluates `alpha * ...
[{"scope": "e2e", "hardware": "B300", "model": null, "shape": null, "batch_size": null, "metric": "speedup", "unit": null, "higher_is_better": true, "baseline": null, "optimized": null, "stated_speedup": 1.115, "speedup": 1.115}, {"scope": "e2e", "hardware": "B300", "model": null, "shape": null, "batch_size": null, "me...
null
1.1385
flashinfer
0f5bb82457f3c79c1747c951eecab9f658cea351
2026-07-23T21:48:03+08:00
4,063
https://github.com/flashinfer-ai/flashinfer/pull/4063
perf(sm103): optimize NVFP4 epilogue stores and scaling (#4063)
perf(sm103): optimize NVFP4 epilogue stores and scaling (#4063) ## 📌 Description This PR optimizes the native SM103 (`CTA_K=768`) CUTLASS NVFP4 GEMM epilogue: - Keeps the source/C alignment at 128 bits and raises the D/output alignment to 256 bits, enabling 256-bit global stores in the native SM103 no-smem epilogue...
include/flashinfer/gemm/fp4_gemm_cutlass_template_sm103.h
cpp
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- include/flashinfer/gemm/fp4_gemm_cutlass_template_sm103.h +++ include/flashinfer/gemm/fp4_gemm_cutlass_template_sm103.h @@ -17,6 +17,9 @@ #ifndef FLASHINFER_FP4_GEMM_CUTLASS_TEMPLATE_H_ #define FLASHINFER_FP4_GEMM_CUTLASS_TEMPLATE_H_ +#include <algorithm> +#include <cstdint> + #ifndef _WIN32 #pragma GCC diagn...
98
18
6
[]
[ "B300", "SM100", "SM103" ]
[ "1.115×", "1.120×", "1.157×", "1.161×" ]
Optimize this cpp kernel file from flashinfer (include/flashinfer/gemm/fp4_gemm_cutlass_template_sm103.h). Goal: perf(sm103): optimize NVFP4 epilogue stores and scaling Target hardware: B300, SM100, SM103 Target models: unspecified Current file: ```cpp /* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights re...
## 📌 Description This PR optimizes the native SM103 (`CTA_K=768`) CUTLASS NVFP4 GEMM epilogue: - Keeps the source/C alignment at 128 bits and raises the D/output alignment to 256 bits, enabling 256-bit global stores in the native SM103 no-smem epilogue. - Adds a local CUTLASS fusion callback that evaluates `alpha * ...
[{"scope": "e2e", "hardware": "B300", "model": null, "shape": null, "batch_size": null, "metric": "speedup", "unit": null, "higher_is_better": true, "baseline": null, "optimized": null, "stated_speedup": 1.115, "speedup": 1.115}, {"scope": "e2e", "hardware": "B300", "model": null, "shape": null, "batch_size": null, "me...
null
1.1385
flashinfer
0f5bb82457f3c79c1747c951eecab9f658cea351
2026-07-23T21:48:03+08:00
4,063
https://github.com/flashinfer-ai/flashinfer/pull/4063
perf(sm103): optimize NVFP4 epilogue stores and scaling (#4063)
perf(sm103): optimize NVFP4 epilogue stores and scaling (#4063) ## 📌 Description This PR optimizes the native SM103 (`CTA_K=768`) CUTLASS NVFP4 GEMM epilogue: - Keeps the source/C alignment at 128 bits and raises the D/output alignment to 256 bits, enabling 256-bit global stores in the native SM103 no-smem epilogue...
include/flashinfer/gemm/fp4_gemm_template_sm100.h
cpp
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- include/flashinfer/gemm/fp4_gemm_template_sm100.h +++ include/flashinfer/gemm/fp4_gemm_template_sm100.h @@ -36,6 +36,9 @@ namespace flashinfer { namespace gemm { +#if defined(FLASHINFER_SM103_GENERIC_STORE256_NAMESPACE) +namespace sm103_generic_store256 { +#endif using namespace cute; #ifdef ENABLE_BF16 @@ ...
30
4
6
[]
[ "B300", "SM100", "SM103" ]
[ "1.115×", "1.120×", "1.157×", "1.161×" ]
Optimize this cpp kernel file from flashinfer (include/flashinfer/gemm/fp4_gemm_template_sm100.h). Goal: perf(sm103): optimize NVFP4 epilogue stores and scaling Target hardware: B300, SM100, SM103 Target models: unspecified Current file: ```cpp /* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. ...
## 📌 Description This PR optimizes the native SM103 (`CTA_K=768`) CUTLASS NVFP4 GEMM epilogue: - Keeps the source/C alignment at 128 bits and raises the D/output alignment to 256 bits, enabling 256-bit global stores in the native SM103 no-smem epilogue. - Adds a local CUTLASS fusion callback that evaluates `alpha * ...
[{"scope": "e2e", "hardware": "B300", "model": null, "shape": null, "batch_size": null, "metric": "speedup", "unit": null, "higher_is_better": true, "baseline": null, "optimized": null, "stated_speedup": 1.115, "speedup": 1.115}, {"scope": "e2e", "hardware": "B300", "model": null, "shape": null, "batch_size": null, "me...
null
1.1385
flashinfer
0f5bb82457f3c79c1747c951eecab9f658cea351
2026-07-23T21:48:03+08:00
4,063
https://github.com/flashinfer-ai/flashinfer/pull/4063
perf(sm103): optimize NVFP4 epilogue stores and scaling (#4063)
perf(sm103): optimize NVFP4 epilogue stores and scaling (#4063) ## 📌 Description This PR optimizes the native SM103 (`CTA_K=768`) CUTLASS NVFP4 GEMM epilogue: - Keeps the source/C alignment at 128 bits and raises the D/output alignment to 256 bits, enabling 256-bit global stores in the native SM103 no-smem epilogue...
include/flashinfer/gemm/fp4_gemm_template_sm103.h
cpp
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- include/flashinfer/gemm/fp4_gemm_template_sm103.h +++ include/flashinfer/gemm/fp4_gemm_template_sm103.h @@ -29,6 +29,7 @@ #include "cutlass/gemm/gemm.h" #include "flashinfer/arch_condition.h" #include "flashinfer/cutlass_utils.cuh" +#include "flashinfer/gemm/fp4_gemm_epilogue_sm103.h" #ifndef _WIN32 #pragma ...
7
4
6
[]
[ "B300", "SM100", "SM103" ]
[ "1.115×", "1.120×", "1.157×", "1.161×" ]
Optimize this cpp kernel file from flashinfer (include/flashinfer/gemm/fp4_gemm_template_sm103.h). Goal: perf(sm103): optimize NVFP4 epilogue stores and scaling Target hardware: B300, SM100, SM103 Target models: unspecified Current file: ```cpp /* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. ...
## 📌 Description This PR optimizes the native SM103 (`CTA_K=768`) CUTLASS NVFP4 GEMM epilogue: - Keeps the source/C alignment at 128 bits and raises the D/output alignment to 256 bits, enabling 256-bit global stores in the native SM103 no-smem epilogue. - Adds a local CUTLASS fusion callback that evaluates `alpha * ...
[{"scope": "e2e", "hardware": "B300", "model": null, "shape": null, "batch_size": null, "metric": "speedup", "unit": null, "higher_is_better": true, "baseline": null, "optimized": null, "stated_speedup": 1.115, "speedup": 1.115}, {"scope": "e2e", "hardware": "B300", "model": null, "shape": null, "batch_size": null, "me...
null
1.1385
flashinfer
5e891c6bbde7e02eaedbda92760e30185e6d6f55
2026-07-21T18:53:27-07:00
3,697
https://github.com/flashinfer-ai/flashinfer/pull/3697
Port the TensorRT-LLM one-sided A2A optimizations to Flashinfer (#3697)
Port the TensorRT-LLM one-sided A2A optimizations to Flashinfer (#3697) <!-- .github/pull_request_template.md --> ## 📌 Description Needs testing and comparison to TRTLLM ToT <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ## 🔍 Related Issues <!-- Link any related issues here ...
csrc/nv_internal/tensorrt_llm/common/envUtils.h
cpp
Apache-2.0
/* * SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights * reserved. SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the Lic...
/* * SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights * reserved. SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the Lic...
--- csrc/nv_internal/tensorrt_llm/common/envUtils.h +++ csrc/nv_internal/tensorrt_llm/common/envUtils.h @@ -16,10 +16,14 @@ */ #pragma once +#include <cuda_runtime_api.h> + #include <cstdint> #include <optional> #include <string> +#include <utility> +#include "flashinfer/exception.h" #include "tensorrt_llm/c...
23
0
7
[]
[ "B300" ]
[]
Optimize this cpp kernel file from flashinfer (csrc/nv_internal/tensorrt_llm/common/envUtils.h). Goal: Port the TensorRT-LLM one-sided A2A optimizations to Flashinfer Target hardware: B300 Target models: unspecified Current file: ```cpp /* * SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILI...
<!-- .github/pull_request_template.md --> ## 📌 Description Needs testing and comparison to TRTLLM ToT <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInf...
[]
null
null
flashinfer
5e891c6bbde7e02eaedbda92760e30185e6d6f55
2026-07-21T18:53:27-07:00
3,697
https://github.com/flashinfer-ai/flashinfer/pull/3697
Port the TensorRT-LLM one-sided A2A optimizations to Flashinfer (#3697)
Port the TensorRT-LLM one-sided A2A optimizations to Flashinfer (#3697) <!-- .github/pull_request_template.md --> ## 📌 Description Needs testing and comparison to TRTLLM ToT <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ## 🔍 Related Issues <!-- Link any related issues here ...
csrc/nv_internal/tensorrt_llm/kernels/communicationKernels/moeAlltoAllKernels.h
cpp
Apache-2.0
/* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requi...
/* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requi...
--- csrc/nv_internal/tensorrt_llm/kernels/communicationKernels/moeAlltoAllKernels.h +++ csrc/nv_internal/tensorrt_llm/kernels/communicationKernels/moeAlltoAllKernels.h @@ -24,6 +24,9 @@ static constexpr int kMaxTopK = 22; // Maximum supported top-k experts per token static constexpr int kMaxPayloads = 6; // Maxi...
59
4
7
[]
[ "B300" ]
[]
Optimize this cpp kernel file from flashinfer (csrc/nv_internal/tensorrt_llm/kernels/communicationKernels/moeAlltoAllKernels.h). Goal: Port the TensorRT-LLM one-sided A2A optimizations to Flashinfer Target hardware: B300 Target models: unspecified Current file: ```cpp /* * Copyright (c) 2025, NVIDIA CORPORATION. Al...
<!-- .github/pull_request_template.md --> ## 📌 Description Needs testing and comparison to TRTLLM ToT <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInf...
[]
null
null
flashinfer
5e891c6bbde7e02eaedbda92760e30185e6d6f55
2026-07-21T18:53:27-07:00
3,697
https://github.com/flashinfer-ai/flashinfer/pull/3697
Port the TensorRT-LLM one-sided A2A optimizations to Flashinfer (#3697)
Port the TensorRT-LLM one-sided A2A optimizations to Flashinfer (#3697) <!-- .github/pull_request_template.md --> ## 📌 Description Needs testing and comparison to TRTLLM ToT <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ## 🔍 Related Issues <!-- Link any related issues here ...
csrc/nv_internal/tensorrt_llm/thop/moeAlltoAllMeta.h
cpp
Apache-2.0
/* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requi...
/* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requi...
--- csrc/nv_internal/tensorrt_llm/thop/moeAlltoAllMeta.h +++ csrc/nv_internal/tensorrt_llm/thop/moeAlltoAllMeta.h @@ -36,8 +36,9 @@ COMBINE_COMPLETION_FLAGS_OFFSET_INDEX = 5, TOPK_TARGET_RANKS_OFFSET_INDEX = 6, TOPK_SEND_INDICES_OFFSET_INDEX = 7, - PAYLOAD_DATA_OFFSET_INDEX = 8, - NUM_METAINFO_FIELDS = 9 + ...
4
2
7
[]
[ "B300" ]
[]
Optimize this cpp kernel file from flashinfer (csrc/nv_internal/tensorrt_llm/thop/moeAlltoAllMeta.h). Goal: Port the TensorRT-LLM one-sided A2A optimizations to Flashinfer Target hardware: B300 Target models: unspecified Current file: ```cpp /* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Li...
<!-- .github/pull_request_template.md --> ## 📌 Description Needs testing and comparison to TRTLLM ToT <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInf...
[]
null
null
flashinfer
5e891c6bbde7e02eaedbda92760e30185e6d6f55
2026-07-21T18:53:27-07:00
3,697
https://github.com/flashinfer-ai/flashinfer/pull/3697
Port the TensorRT-LLM one-sided A2A optimizations to Flashinfer (#3697)
Port the TensorRT-LLM one-sided A2A optimizations to Flashinfer (#3697) <!-- .github/pull_request_template.md --> ## 📌 Description Needs testing and comparison to TRTLLM ToT <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ## 🔍 Related Issues <!-- Link any related issues here ...
csrc/trtllm_moe_alltoall.cu
cuda
Apache-2.0
/* * SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & * AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the ...
/* * SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & * AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the ...
--- csrc/trtllm_moe_alltoall.cu +++ csrc/trtllm_moe_alltoall.cu @@ -52,7 +52,40 @@ return (offset + alignment - 1) & ~(alignment - 1); } -fi_throughput::MoeA2ADataOffsets calculateOffsets(int epSize, int maxNumTokens) { +inline bool hasActiveRankMask(Optional<TensorView> const& maskTensor) { + return maskTensor....
153
26
7
[]
[ "B300" ]
[]
Optimize this cuda kernel file from flashinfer (csrc/trtllm_moe_alltoall.cu). Goal: Port the TensorRT-LLM one-sided A2A optimizations to Flashinfer Target hardware: B300 Target models: unspecified Current file: ```cuda /* * SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & * AFFILIATES. All right...
<!-- .github/pull_request_template.md --> ## 📌 Description Needs testing and comparison to TRTLLM ToT <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInf...
[]
null
null
flashinfer
97f3b035a1f2bfaa94b5f636b169d8fd35bcf2b7
2026-07-18T00:43:03+02:00
3,846
https://github.com/flashinfer-ai/flashinfer/pull/3846
perf(moe): optimize one-sided EP4 NVFP4 dispatch (#3846)
perf(moe): optimize one-sided EP4 NVFP4 dispatch (#3846) ## Summary Optimize one-sided MoE dispatch by: - constructing routing metadata cooperatively across a warp instead of using a serial thread-0 loop; - retaining one compact destination per rank when `ep_size == 4` and `top_k > 4`; - using a 128-thread CTA f...
csrc/nv_internal/tensorrt_llm/kernels/communicationKernels/moeAlltoAllKernels.cu
cuda
Apache-2.0
/* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requi...
/* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requi...
--- csrc/nv_internal/tensorrt_llm/kernels/communicationKernels/moeAlltoAllKernels.cu +++ csrc/nv_internal/tensorrt_llm/kernels/communicationKernels/moeAlltoAllKernels.cu @@ -30,6 +30,10 @@ #define ENABLE_DEBUG_PRINT 0 #define DISABLE_SYNC_FOR_PROFILING 0 + +constexpr int kEp4Size = 4; +constexpr int kCompactDispatc...
101
52
1
[ "nemotron" ]
[ "GB200" ]
[]
Optimize this cuda kernel file from flashinfer (csrc/nv_internal/tensorrt_llm/kernels/communicationKernels/moeAlltoAllKernels.cu). Goal: perf(moe): optimize one-sided EP4 NVFP4 dispatch Target hardware: GB200 Target models: nemotron Current file: ```cuda /* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reser...
## Summary Optimize one-sided MoE dispatch by: - constructing routing metadata cooperatively across a warp instead of using a serial thread-0 loop; - retaining one compact destination per rank when `ep_size == 4` and `top_k > 4`; - using a 128-thread CTA for that compact path when every payload is at most 1,024...
[{"scope": "kernel", "hardware": "GB200", "model": "H2048 NVFP4", "shape": "EP4, top-k22", "batch_size": 4, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 19.68, "optimized": 13.79, "stated_speedup": null, "speedup": 1.4271}, {"scope": "kernel", "hardware": "GB200", "model": "H2048 NVFP4", "s...
1.589
1.0551
flashinfer
37ce0366fd324c6b026f190aba7123be8ca3eb95
2026-07-18T02:22:31+05:30
3,908
https://github.com/flashinfer-ai/flashinfer/pull/3908
Ameyn/gdn wy perf followup (#3908)
Ameyn/gdn wy perf followup (#3908) ## 📌 Stacked on #3720 This branch builds on #3720's head (`00a655e`); the diff will show its commits until it merges. **Review only the 5 commits listed below.** Once #3720 lands, the diff collapses to just these changes (one rebase needed only if #3720 is squash-merged). ## What ...
flashinfer/gdn_kernels/gdn_decode_bf16_wy_output_only.py
cute_dsl
Apache-2.0
"""CuTeDSL GDN MTP Decode Kernel — WY-parallel, NOPREPACK variant. v6 (TMA + SW128 swizzle on H tile): - Replaces v5's 4-stage staggered cp.async H load with a single `cp.async.bulk.tensor.4d.shared.cluster.global` TMA issued once per CTA. - sH SMEM tile is allocated as a SW128-swizzled tensor (mandatory for the T...
"""CuTeDSL GDN MTP Decode Kernel — WY-parallel, NOPREPACK variant. v6 (TMA + SW128 swizzle on H tile): - Replaces v5's 4-stage staggered cp.async H load with a single `cp.async.bulk.tensor.4d.shared.cluster.global` TMA issued once per CTA. - sH SMEM tile is allocated as a SW128-swizzled tensor (mandatory for the T...
--- flashinfer/gdn_kernels/gdn_decode_bf16_wy_output_only.py +++ flashinfer/gdn_kernels/gdn_decode_bf16_wy_output_only.py @@ -305,28 +305,6 @@ return Int32(r) -def _st_global_bf16x2_f32(base_addr_i64, bf16_elem_offset, lo_f32, hi_f32): - r = llvm.inline_asm( - mlir_T.i32(), - [ - ba...
113
48
1
[]
[ "B200", "SM100" ]
[]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/gdn_kernels/gdn_decode_bf16_wy_output_only.py). Goal: Ameyn/gdn wy perf followup Target hardware: B200, SM100 Target models: unspecified Current file: ```python """CuTeDSL GDN MTP Decode Kernel — WY-parallel, NOPREPACK variant. v6 (TMA + SW128 swizzle on...
## 📌 Stacked on #3720 This branch builds on #3720's head (`00a655e`); the diff will show its commits until it merges. **Review only the 5 commits listed below.** Once #3720 lands, the diff collapses to just these changes (one rebase needed only if #3720 is squash-merged). ## What Performance and correctness follow-...
[{"scope": "kernel", "hardware": "B200", "model": null, "shape": "T=4", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 5.28, "optimized": 5.12, "stated_speedup": null, "speedup": 1.0312}, {"scope": "kernel", "hardware": "B200", "model": null, "shape": "T=8", "batch_size": 1, ...
1.0589
null
flashinfer
c27cb0e5b06818cffb609bd53b204560ec27d281
2026-07-16T13:31:45-07:00
3,524
https://github.com/flashinfer-ai/flashinfer/pull/3524
perf: vectorize AppendPagedKVMlaCache to 128-bit access (#3524)
perf: vectorize AppendPagedKVMlaCache to 128-bit access (#3524) <!-- .github/pull_request_template.md --> ## 📌 Description `AppendPagedKVMlaCache` (the MLA paged-KV append used by DeepSeek-V3/R1 MLA serving) hard-coded `vec_size = 2`, i.e. 4-byte (2× bf16) global loads/stores. With `head_dim_ckv=512` this leaves th...
include/flashinfer/page.cuh
cuda
Apache-2.0
/* * Copyright (c) 2023 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
/* * Copyright (c) 2023 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
--- include/flashinfer/page.cuh +++ include/flashinfer/page.cuh @@ -851,7 +851,8 @@ constexpr uint32_t HEAD_KPE_DIM = 64; FLASHINFER_CHECK(head_dim_ckv == HEAD_CKV_DIM, "head_dim_ckv must be equal to 512"); FLASHINFER_CHECK(head_dim_kpe == HEAD_KPE_DIM, "head_dim_kpe must be equal to 64"); - constexpr uint32_...
2
1
1
[ "deepseek" ]
[ "H200" ]
[ "2×", "4×", "1.80×", "1.80×", "1.87×" ]
Optimize this cuda kernel file from flashinfer (include/flashinfer/page.cuh). Goal: perf: vectorize AppendPagedKVMlaCache to 128-bit access Target hardware: H200 Target models: deepseek Current file: ```cuda /* * Copyright (c) 2023 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "Licens...
<!-- .github/pull_request_template.md --> ## 📌 Description `AppendPagedKVMlaCache` (the MLA paged-KV append used by DeepSeek-V3/R1 MLA serving) hard-coded `vec_size = 2`, i.e. 4-byte (2× bf16) global loads/stores. With `head_dim_ckv=512` this leaves the memory subsystem 4× under-utilized per transaction. This sets ...
[{"scope": "kernel", "hardware": "H200", "model": "DeepSeek-V3", "shape": "head_dim_ckv=512,head_dim_kpe=64,page_size=64", "batch_size": 16384, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 15.7, "optimized": 8.8, "stated_speedup": 1.8, "speedup": 1.7841}, {"scope": "kernel", "hardware": "H2...
1.8051
null
flashinfer
a85d020f48ca00faf81aae0f6bf1b54c351eb736
2026-07-11T10:50:29+08:00
3,756
https://github.com/flashinfer-ai/flashinfer/pull/3756
[CuTe DSL][MoE] Optimize PDL startup and balance GEMM2 partial-tile stores (#3756)
[CuTe DSL][MoE] Optimize PDL startup and balance GEMM2 partial-tile stores (#3756) <!-- .github/pull_request_template.md --> ## 📌 Description 1. PDL optimization: Move TMEM allocation and scheduling of the first tile earlier, while reducing thread usage and barrier overhead in the GEMM1 scheduler. 2. Balanced store...
flashinfer/fused_moe/cute_dsl/blackwell/blockscaled_contiguous_grouped_gemm_finalize_fusion.py
cute_dsl
BSD-3-Clause
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the abov...
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the abov...
--- flashinfer/fused_moe/cute_dsl/blackwell/blockscaled_contiguous_grouped_gemm_finalize_fusion.py +++ flashinfer/fused_moe/cute_dsl/blackwell/blockscaled_contiguous_grouped_gemm_finalize_fusion.py @@ -1156,6 +1156,7 @@ is_two_cta=use_2cta_instrs, two_cta_tmem_dealloc_mbar_ptr=storage.tmem_dea...
76
25
1
[]
[ "BLACKWELL" ]
[]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/fused_moe/cute_dsl/blackwell/blockscaled_contiguous_grouped_gemm_finalize_fusion.py). Goal: [CuTe DSL][MoE] Optimize PDL startup and balance GEMM2 partial-tile stores Target hardware: BLACKWELL Target models: unspecified Current file: ```python # Copyrigh...
<!-- .github/pull_request_template.md --> ## 📌 Description 1. PDL optimization: Move TMEM allocation and scheduling of the first tile earlier, while reducing thread usage and barrier overhead in the GEMM1 scheduler. 2. Balanced store: Distribute the GEMM2 partial-tile epilogue stores across warps in an interleaved ...
[{"scope": "e2e", "hardware": null, "model": null, "shape": "hidden=4096", "batch_size": 64, "metric": "latency", "unit": "ms", "higher_is_better": false, "baseline": 0.067951, "optimized": 0.065088, "stated_speedup": 1.044, "speedup": 1.044}, {"scope": "e2e", "hardware": null, "model": null, "shape": "hidden=4096", "b...
null
1.015
flashinfer
d527621951244b8be4dd412b1a6729295697f3a7
2026-07-10T20:38:34+02:00
3,776
https://github.com/flashinfer-ai/flashinfer/pull/3776
perf(moe): support caller-provided combine output (#3776)
perf(moe): support caller-provided combine output (#3776) ## Summary Allow `MoeAlltoAll.combine()` to write into an optional caller-provided output tensor. The existing allocating API remains unchanged, and the output-buffer path uses the same communication and combine kernels. Related vLLM integration: https://gith...
csrc/trtllm_moe_alltoall.cu
cuda
Apache-2.0
/* * SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & * AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the ...
/* * SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & * AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the ...
--- csrc/trtllm_moe_alltoall.cu +++ csrc/trtllm_moe_alltoall.cu @@ -273,12 +273,12 @@ return nvinfer1::DataType::kFLOAT; } -Tensor moeA2ACombineOp(TensorView payload, int64_t localNumTokens, TensorView workspace, - TensorView metainfo, int64_t runtimeMaxTokensPerRank, int64_t epRank, - ...
36
8
2
[]
[ "CPU", "GB200" ]
[]
Optimize this cuda kernel file from flashinfer (csrc/trtllm_moe_alltoall.cu). Goal: perf(moe): support caller-provided combine output Target hardware: CPU, GB200 Target models: unspecified Current file: ```cuda /* * SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & * AFFILIATES. All rights reserv...
## Summary Allow `MoeAlltoAll.combine()` to write into an optional caller-provided output tensor. The existing allocating API remains unchanged, and the output-buffer path uses the same communication and combine kernels. Related vLLM integration: https://github.com/vllm-project/vllm/pull/47156 ## Rationale vLLM alr...
[{"scope": "e2e", "hardware": "GB200", "model": null, "shape": "hidden=8192,top_k=22,num_experts=512", "batch_size": 8192, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 817.648, "optimized": 777.528, "stated_speedup": null, "speedup": 1.0516}, {"scope": "e2e", "hardware": "GB200", "model": n...
null
1.0392
flashinfer
59b1c4d7c6f2e2d246becd7a0e0d36ebd33dc820
2026-07-10T03:04:40+08:00
3,614
https://github.com/flashinfer-ai/flashinfer/pull/3614
fix: make the cutlass MoE gemm profiler MXFP8-aware (autotune crash on MXFP8xMXFP8) (#3614)
fix: make the cutlass MoE gemm profiler MXFP8-aware (autotune crash on MXFP8xMXFP8) (#3614) ## Description Fixes the original-report half of #3558: the autotuner tuning pass crashes for `cutlass_fused_moe` with MXFP8 activation scaling (CUDA illegal instruction / null TMA SF buffer on the reporter's SM121 build; `!us...
csrc/fused_moe/cutlass_backend/flashinfer_cutlass_fused_moe_binding.cu
cuda
Apache-2.0
/* * Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/fused_moe/cutlass_backend/flashinfer_cutlass_fused_moe_binding.cu +++ csrc/fused_moe/cutlass_backend/flashinfer_cutlass_fused_moe_binding.cu @@ -679,12 +679,12 @@ activation_dtype = isNvfp4Quant() ? dl_int64 : activation_dtype; int64_t const unpadded_hidden_size_profiler = hidden_size; // HACK n...
6
6
3
[]
[ "SM100", "SM120", "SM121", "SM80", "SM89" ]
[]
Optimize this cuda kernel file from flashinfer (csrc/fused_moe/cutlass_backend/flashinfer_cutlass_fused_moe_binding.cu). Goal: fix: make the cutlass MoE gemm profiler MXFP8-aware (autotune crash on MXFP8xMXFP8) Target hardware: SM100, SM120, SM121, SM80, SM89 Target models: unspecified Current file: ```cuda /* * Cop...
## Description Fixes the original-report half of #3558: the autotuner tuning pass crashes for `cutlass_fused_moe` with MXFP8 activation scaling (CUDA illegal instruction / null TMA SF buffer on the reporter's SM121 build; `!use_block_scaling` kernel assert on current main). **Root cause** (one level deeper than my sc...
[]
null
null
flashinfer
59b1c4d7c6f2e2d246becd7a0e0d36ebd33dc820
2026-07-10T03:04:40+08:00
3,614
https://github.com/flashinfer-ai/flashinfer/pull/3614
fix: make the cutlass MoE gemm profiler MXFP8-aware (autotune crash on MXFP8xMXFP8) (#3614)
fix: make the cutlass MoE gemm profiler MXFP8-aware (autotune crash on MXFP8xMXFP8) (#3614) ## Description Fixes the original-report half of #3558: the autotuner tuning pass crashes for `cutlass_fused_moe` with MXFP8 activation scaling (CUDA illegal instruction / null TMA SF buffer on the reporter's SM121 build; `!us...
csrc/nv_internal/tensorrt_llm/kernels/cutlass_kernels/include/moe_kernels.h
cpp
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/nv_internal/tensorrt_llm/kernels/cutlass_kernels/include/moe_kernels.h +++ csrc/nv_internal/tensorrt_llm/kernels/cutlass_kernels/include/moe_kernels.h @@ -15,6 +15,7 @@ */ #pragma once +#include <algorithm> #include <cstdint> #include "cutlass/gemm/gemm.h" @@ -635,7 +636,8 @@ } std::vector<cut...
32
4
3
[]
[ "SM100", "SM120", "SM121", "SM80", "SM89" ]
[]
Optimize this cpp kernel file from flashinfer (csrc/nv_internal/tensorrt_llm/kernels/cutlass_kernels/include/moe_kernels.h). Goal: fix: make the cutlass MoE gemm profiler MXFP8-aware (autotune crash on MXFP8xMXFP8) Target hardware: SM100, SM120, SM121, SM80, SM89 Target models: unspecified Current file: ```cpp /* * ...
## Description Fixes the original-report half of #3558: the autotuner tuning pass crashes for `cutlass_fused_moe` with MXFP8 activation scaling (CUDA illegal instruction / null TMA SF buffer on the reporter's SM121 build; `!use_block_scaling` kernel assert on current main). **Root cause** (one level deeper than my sc...
[]
null
null
flashinfer
d76162a78d5876188e82b81c1c96ccd6b2decd83
2026-07-08T09:32:34+08:00
3,866
https://github.com/flashinfer-ai/flashinfer/pull/3866
perf(gdn): optimize delta rule cp prefill for ultra low parallelism case (#3866)
perf(gdn): optimize delta rule cp prefill for ultra low parallelism case (#3866) ## 📌 Description This PR updated CP chunking heuristics and implemented a SIMT kernel for CP Fixup, target for ultralow parallelism performance. ## 🔍 Related Issues #3491 ## 🚀 Pull Request Checklist ### ✅ Pre-commit Checks - [x]...
flashinfer/gdn_kernels/delta_rule_dsl/varlen_helper.py
cute_dsl
Apache-2.0
import torch import cutlass import cutlass.cute as cute CP_CHUNK_LEN_GRANULARITY = 512 CP_HBM_PARALLELISM_THRESHOLD_NUMERATOR = 1 CP_HBM_PARALLELISM_THRESHOLD_DENOMINATOR = 2 CP_GDDR_PARALLELISM_THRESHOLD_NUMERATOR = 1 CP_GDDR_PARALLELISM_THRESHOLD_DENOMINATOR = 3 def chunk_bound_host(num_items: int, total: int, ch...
import math import torch import cutlass import cutlass.cute as cute BLK = 64 CP_CHUNK_LEN_GRANULARITY = 512 CP_DEFAULT_SHORT_FIXUP_TO_PREFILL_WORKLOAD_RATIO_NUMERATOR = 1 CP_DEFAULT_SHORT_FIXUP_TO_PREFILL_WORKLOAD_RATIO_DENOMINATOR = 1 CP_SM120_SHORT_FIXUP_TO_PREFILL_WORKLOAD_RATIO_NUMERATOR = 1 CP_SM120_SHORT_FIXUP...
--- flashinfer/gdn_kernels/delta_rule_dsl/varlen_helper.py +++ flashinfer/gdn_kernels/delta_rule_dsl/varlen_helper.py @@ -1,13 +1,29 @@ +import math + import torch import cutlass import cutlass.cute as cute +BLK = 64 CP_CHUNK_LEN_GRANULARITY = 512 +CP_DEFAULT_SHORT_FIXUP_TO_PREFILL_WORKLOAD_RATIO_NUMERATOR = 1 ...
64
19
3
[ "qwen" ]
[ "BLACKWELL", "H100", "HOPPER", "SM120", "SM90" ]
[ "4.90x", "4.18x", "3.26x", "2.27x", "1.81x", "1.40x", "1.94x", "1.59x", "1.91x", "2.06x" ]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/gdn_kernels/delta_rule_dsl/varlen_helper.py). Goal: perf(gdn): optimize delta rule cp prefill for ultra low parallelism case Target hardware: BLACKWELL, H100, HOPPER, SM120, SM90 Target models: qwen Current file: ```python import torch import cutlass impo...
## 📌 Description This PR updated CP chunking heuristics and implemented a SIMT kernel for CP Fixup, target for ultralow parallelism performance. ## 🔍 Related Issues #3491 ## 🚀 Pull Request Checklist ### ✅ Pre-commit Checks - [x] I have installed `pre-commit` by running `pip install pre-commit` (or used your p...
[{"scope": "kernel", "hardware": "NVIDIA H100 80GB HBM3 [Hopper (SM90)]", "model": "Qwen3.5-397B/122B", "shape": "Seqlen=65536,h_qk=2,h_v=8", "batch_size": 1, "metric": "latency", "unit": "ms", "higher_is_better": false, "baseline": 1.954, "optimized": 0.399, "stated_speedup": 4.9, "speedup": 4.8972}, {"scope": "kernel...
2.1827
null
flashinfer
2e5ef6bb695ddb69729c4d36b6906196dea32d7b
2026-07-07T13:19:27-07:00
3,766
https://github.com/flashinfer-ai/flashinfer/pull/3766
perf(kda): optimize recurrent decode kernels (#3766)
perf(kda): optimize recurrent decode kernels (#3766) ## Summary Improve recurrent KDA decode performance across both low- and high-batch multi-token workloads. - Distribute D=128 Q/K/V/G asynchronous copies across all four warps. - Double-buffer raw Q/K/V/G shared-memory staging for multi-token decode. - Prefetch to...
flashinfer/kda_kernels/recurrent_kda.py
cute_dsl
Apache-2.0
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
--- flashinfer/kda_kernels/recurrent_kda.py +++ flashinfer/kda_kernels/recurrent_kda.py @@ -234,12 +234,19 @@ val_layout = cute.make_layout((copy_elems,)) tiled_copy = cute.make_tiled_copy_tv(atom_async, thr_layout, val_layout) - # Gate the upper half of the block out of the issue. The split is - # wa...
317
54
1
[]
[]
[]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/kda_kernels/recurrent_kda.py). Goal: perf(kda): optimize recurrent decode kernels Target hardware: unspecified Target models: unspecified Current file: ```python """ Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (t...
## Summary Improve recurrent KDA decode performance across both low- and high-batch multi-token workloads. - Distribute D=128 Q/K/V/G asynchronous copies across all four warps. - Double-buffer raw Q/K/V/G shared-memory staging for multi-token decode. - Prefetch token `t+1` while token `t` is being computed. - Remove ...
[{"scope": "kernel", "hardware": null, "model": null, "shape": "head_dim=64", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 2.3712, "optimized": 2.3514, "stated_speedup": null, "speedup": 1.0084}, {"scope": "kernel", "hardware": null, "model": null, "shape": "head_dim=64", "...
1.0348
null
flashinfer
8fc7f079203cfa6242d1fe250ef7028b22c5efd2
2026-07-01T22:44:27+08:00
3,788
https://github.com/flashinfer-ai/flashinfer/pull/3788
perf: optimize sm90 cp delta rule (#3788)
perf: optimize sm90 cp delta rule (#3788) ## 📌 Description 1. Fused qk and inversion epilogue. 2. Removed unnecessary intermediate buffer zeroing. ## 🔍 Related Issues Similar optimization has been integrated in e9ad55ce884e5d87c15a3a0e853b11b42ff5d245 93050535021a9421781f7b5b85259527da4d762e and 171e5edbcc2ac1573...
flashinfer/gdn_kernels/delta_rule_dsl/delta_rule_sm90.py
cute_dsl
Apache-2.0
from enum import IntEnum import torch import cutlass import cutlass.cute as cute import cutlass.pipeline as pipeline from cutlass.cute.nvgpu import warp, warpgroup, cpasync from ...utils import get_device_sm_count, _get_cache_buf from .alpha import AlphaProcessor from .collective_store_tma import CollectiveStoreTma fr...
from enum import IntEnum import torch import cutlass import cutlass.cute as cute import cutlass.pipeline as pipeline from cutlass.cute.nvgpu import warp, warpgroup, cpasync from ...utils import get_device_sm_count, _get_cache_buf from .alpha import AlphaProcessor from .collective_store_tma import CollectiveStoreTma fr...
--- flashinfer/gdn_kernels/delta_rule_dsl/delta_rule_sm90.py +++ flashinfer/gdn_kernels/delta_rule_dsl/delta_rule_sm90.py @@ -320,7 +320,7 @@ tQKrQK[i] = tQKrQK[i] if pred else cutlass.Float32(0.0) tKKrKK[i] = tKKrKK[i] if pred else cutlass.Float32(0.0) if cutlass.const_expr(is_fi...
1
1
2
[ "qwen" ]
[ "H100", "HOPPER", "SM90" ]
[ "4.47x", "3.52x", "2.56x", "1.69x", "1.40x", "1.07x", "1.63x", "1.53x", "1.63x", "1.65x" ]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/gdn_kernels/delta_rule_dsl/delta_rule_sm90.py). Goal: perf: optimize sm90 cp delta rule Target hardware: H100, HOPPER, SM90 Target models: qwen Current file: ```python from enum import IntEnum import torch import cutlass import cutlass.cute as cute impor...
## 📌 Description 1. Fused qk and inversion epilogue. 2. Removed unnecessary intermediate buffer zeroing. ## 🔍 Related Issues Similar optimization has been integrated in e9ad55ce884e5d87c15a3a0e853b11b42ff5d245 93050535021a9421781f7b5b85259527da4d762e and 171e5edbcc2ac1573a14dc5ffea7f13590d646c8 ## 🚀 Pull Request...
[{"scope": "kernel", "hardware": "H100", "model": "Qwen3.5 family", "shape": "TP8 1x65536 h_qk=2 h_v=8", "batch_size": null, "metric": "latency", "unit": "ms", "higher_is_better": false, "baseline": 2.006, "optimized": 0.449, "stated_speedup": 4.47, "speedup": 4.4677}, {"scope": "kernel", "hardware": "H100", "model": "...
2.5668
1.1
flashinfer
2594b958fa0f2e24bc1a4dc15921571f0761744d
2026-06-29T17:28:29+08:00
3,751
https://github.com/flashinfer-ai/flashinfer/pull/3751
[feat] Optimize TRTLLMGEN MoE routing (#3751)
[feat] Optimize TRTLLMGEN MoE routing (#3751) <!-- .github/pull_request_template.md --> ## 📌 Description Optimize TRTLLM-Gen MoE routing to reduce register pressure and avoid heavy spilling in high-expert routing cases. - Add templated cluster routing kernels for 256/512/1024 thread block sizes while preserving th...
csrc/fused_moe/trtllm_backend/trtllm_fused_moe_routing_custom.cu
cuda
Apache-2.0
/* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/fused_moe/trtllm_backend/trtllm_fused_moe_routing_custom.cu +++ csrc/fused_moe/trtllm_backend/trtllm_fused_moe_routing_custom.cu @@ -28,6 +28,7 @@ #include <cstdlib> #include <string> +#include <type_traits> #include "flashinfer/trtllm/common/cudaUtils.h" #include "flashinfer/trtllm/fused_moe/RoutingCu...
234
26
2
[]
[]
[ "1.00x", "0.98x", "1.22x", "1.39x", "1.19x", "0.96x", "0.99x", "1.00x", "0.97x", "1.00x" ]
Optimize this cuda kernel file from flashinfer (csrc/fused_moe/trtllm_backend/trtllm_fused_moe_routing_custom.cu). Goal: [feat] Optimize TRTLLMGEN MoE routing Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All rights reserved. * * Li...
<!-- .github/pull_request_template.md --> ## 📌 Description Optimize TRTLLM-Gen MoE routing to reduce register pressure and avoid heavy spilling in high-expert routing cases. - Add templated cluster routing kernels for 256/512/1024 thread block sizes while preserving the original default kernel path. - Apply the u...
[{"scope": "kernel", "hardware": null, "model": null, "shape": "E=256,K=8,tokens=8", "batch_size": null, "metric": "latency", "unit": "ms", "higher_is_better": false, "baseline": 0.009216, "optimized": 0.009184, "stated_speedup": 1.0, "speedup": 1.0035}, {"scope": "kernel", "hardware": null, "model": null, "shape": "E=...
1.218
null
flashinfer
2594b958fa0f2e24bc1a4dc15921571f0761744d
2026-06-29T17:28:29+08:00
3,751
https://github.com/flashinfer-ai/flashinfer/pull/3751
[feat] Optimize TRTLLMGEN MoE routing (#3751)
[feat] Optimize TRTLLMGEN MoE routing (#3751) <!-- .github/pull_request_template.md --> ## 📌 Description Optimize TRTLLM-Gen MoE routing to reduce register pressure and avoid heavy spilling in high-expert routing cases. - Add templated cluster routing kernels for 256/512/1024 thread block sizes while preserving th...
include/flashinfer/trtllm/fused_moe/RoutingCustomPolicy.cuh
cuda
Apache-2.0
/* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- include/flashinfer/trtllm/fused_moe/RoutingCustomPolicy.cuh +++ include/flashinfer/trtllm/fused_moe/RoutingCustomPolicy.cuh @@ -697,17 +697,20 @@ /// None + Softmax (Renormalize): many model configs. template <> struct PolicyTraits<NoOpPreprocess, SoftmaxPostprocess> { - using Pairs = TierList<Tier<128, 4>, /...
59
26
2
[]
[]
[ "1.00x", "0.98x", "1.22x", "1.39x", "1.19x", "0.96x", "0.99x", "1.00x", "0.97x", "1.00x" ]
Optimize this cuda kernel file from flashinfer (include/flashinfer/trtllm/fused_moe/RoutingCustomPolicy.cuh). Goal: [feat] Optimize TRTLLMGEN MoE routing Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2022-2026, NVIDIA CORPORATION. All rights reserved. * * License...
<!-- .github/pull_request_template.md --> ## 📌 Description Optimize TRTLLM-Gen MoE routing to reduce register pressure and avoid heavy spilling in high-expert routing cases. - Add templated cluster routing kernels for 256/512/1024 thread block sizes while preserving the original default kernel path. - Apply the u...
[{"scope": "kernel", "hardware": null, "model": null, "shape": "E=256,K=8,tokens=8", "batch_size": null, "metric": "latency", "unit": "ms", "higher_is_better": false, "baseline": 0.009216, "optimized": 0.009184, "stated_speedup": 1.0, "speedup": 1.0035}, {"scope": "kernel", "hardware": null, "model": null, "shape": "E=...
1.218
null
flashinfer
22ad42062922b2f9c780eb8b013197f5b4df0fb7
2026-06-26T06:38:11+08:00
3,564
https://github.com/flashinfer-ai/flashinfer/pull/3564
perf(moe): Enhance CuteDSL NVF4 MOE Perf (#3564)
perf(moe): Enhance CuteDSL NVF4 MOE Perf (#3564) ## 📌 Description Cherry pick perf optimization changes from TRTLLM PR https://github.com/NVIDIA/TensorRT-LLM/pull/15092. ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we rev...
flashinfer/fused_moe/cute_dsl/blackwell/blockscaled_contiguous_grouped_gemm_finalize_fusion.py
cute_dsl
BSD-3-Clause
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the abov...
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the abov...
--- flashinfer/fused_moe/cute_dsl/blackwell/blockscaled_contiguous_grouped_gemm_finalize_fusion.py +++ flashinfer/fused_moe/cute_dsl/blackwell/blockscaled_contiguous_grouped_gemm_finalize_fusion.py @@ -39,15 +39,12 @@ from cutlass.cute.nvgpu import cpasync, tcgen05 from .utils import ( - atomic_add_func, bl...
237
171
4
[]
[ "BLACKWELL" ]
[]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/fused_moe/cute_dsl/blackwell/blockscaled_contiguous_grouped_gemm_finalize_fusion.py). Goal: perf(moe): Enhance CuteDSL NVF4 MOE Perf Target hardware: BLACKWELL Target models: unspecified Current file: ```python # Copyright (c) 2025 NVIDIA CORPORATION & AF...
## 📌 Description Cherry pick perf optimization changes from TRTLLM PR https://github.com/NVIDIA/TensorRT-LLM/pull/15092. ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the follow...
[]
null
null
flashinfer
22ad42062922b2f9c780eb8b013197f5b4df0fb7
2026-06-26T06:38:11+08:00
3,564
https://github.com/flashinfer-ai/flashinfer/pull/3564
perf(moe): Enhance CuteDSL NVF4 MOE Perf (#3564)
perf(moe): Enhance CuteDSL NVF4 MOE Perf (#3564) ## 📌 Description Cherry pick perf optimization changes from TRTLLM PR https://github.com/NVIDIA/TensorRT-LLM/pull/15092. ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we rev...
flashinfer/fused_moe/cute_dsl/blockscaled_contiguous_grouped_gemm_finalize_fusion.py
cute_dsl
Apache-2.0
# Copyright (c) 2025 by FlashInfer team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
# Copyright (c) 2025 by FlashInfer team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
--- flashinfer/fused_moe/cute_dsl/blockscaled_contiguous_grouped_gemm_finalize_fusion.py +++ flashinfer/fused_moe/cute_dsl/blockscaled_contiguous_grouped_gemm_finalize_fusion.py @@ -216,7 +216,6 @@ sf_vec_size=sf_vec_size, mma_tiler_mn=mma_tiler_mn, cluster_shape_mn=cluster_shape_...
12
10
4
[]
[]
[]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/fused_moe/cute_dsl/blockscaled_contiguous_grouped_gemm_finalize_fusion.py). Goal: perf(moe): Enhance CuteDSL NVF4 MOE Perf Target hardware: unspecified Target models: unspecified Current file: ```python # Copyright (c) 2025 by FlashInfer team. # # License...
## 📌 Description Cherry pick perf optimization changes from TRTLLM PR https://github.com/NVIDIA/TensorRT-LLM/pull/15092. ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the follow...
[]
null
null
flashinfer
28406af5b9134757acbd6bc44647fd00261d163f
2026-06-10T21:35:00-07:00
3,560
https://github.com/flashinfer-ai/flashinfer/pull/3560
perf(gemm): update mm_fp4 b12x SM120 NVFP4 dense GEMM kernel (#3560)
perf(gemm): update mm_fp4 b12x SM120 NVFP4 dense GEMM kernel (#3560) <!-- .github/pull_request_template.md --> ## 📌 Description ### Summary This PR refreshes the `b12x` dense FP4 GEMM kernel to match the latest upstream for better performance. **No public API change.** The `auto` routing heuristic (`_heuristic_fun...
flashinfer/cute_dsl/utils.py
cute_dsl
Apache-2.0
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
--- flashinfer/cute_dsl/utils.py +++ flashinfer/cute_dsl/utils.py @@ -585,8 +585,8 @@ assert sf_vec_size == 16 or sf_vec_size == 32, "sf_vec_size must be 16 or 32" - assert tile_shape_mnk[1] % (blk_mn // 2) == 0, ( - "tile_shape_mnk[1] must be divisible by 64" + assert tile_shape_mnk[1] % (blk_mn ...
2
2
3
[ "deepseek", "llama" ]
[ "RTX5080", "SM100", "SM103", "SM120", "SM121" ]
[ "1.003×", "1.019×", "1.003×", "0.991×", "1.021×", "1.060×", "1.010×", "1.000×", "1.024×", "1.021×" ]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/cute_dsl/utils.py). Goal: perf(gemm): update mm_fp4 b12x SM120 NVFP4 dense GEMM kernel Target hardware: RTX5080, SM100, SM103, SM120, SM121 Target models: deepseek, llama Current file: ```python """ Copyright (c) 2025 by FlashInfer team. Licensed under t...
<!-- .github/pull_request_template.md --> ## 📌 Description ### Summary This PR refreshes the `b12x` dense FP4 GEMM kernel to match the latest upstream for better performance. **No public API change.** The `auto` routing heuristic (`_heuristic_func_mm_fp4`) is **unchanged** — b12x is preferred only at SM120, not SM1...
[{"scope": "e2e", "hardware": "RTX 5080 (SM120)", "model": "DeepSeek-R1,Llama-3", "shape": null, "batch_size": null, "metric": "speedup", "unit": null, "higher_is_better": true, "baseline": null, "optimized": null, "stated_speedup": 1.003, "speedup": 1.003}, {"scope": "e2e", "hardware": "RTX 5080 (SM120)", "model": "De...
1
1.023
flashinfer
e00c306070f30b6af5da89ed877e8d2ab49c1565
2026-06-04T21:55:05+08:00
3,476
https://github.com/flashinfer-ai/flashinfer/pull/3476
Optimize MoE routing top-k reduction and non-power-of-two sorting (#3476)
Optimize MoE routing top-k reduction and non-power-of-two sorting (#3476) <!-- .github/pull_request_template.md --> ## 📌 Description Improves TRT-LLM MoE routing top-k performance by using a two-step fast warp reduction for 64-bit packed FP32 keys on SM100+, and replacing non-power-of-two odd-even transposition sor...
csrc/fused_moe/moeTopKFuncs.cuh
cuda
Apache-2.0
/* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requ...
/* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requ...
--- csrc/fused_moe/moeTopKFuncs.cuh +++ csrc/fused_moe/moeTopKFuncs.cuh @@ -73,11 +73,25 @@ __host__ __device__ operator TypeCmp() const noexcept { return compValIdx; } __device__ inline TypeCmp reduce(cg::thread_block_tile<kWARP_SIZE> const& warp) { - if constexpr (!kTLLM_GEN_HAS_FAST_REDUX || sizeof(TypeCm...
16
2
2
[]
[ "SM100" ]
[ "1.001x", "1.498x", "1.500x", "1.666x", "2.000x", "2.125x" ]
Optimize this cuda kernel file from flashinfer (csrc/fused_moe/moeTopKFuncs.cuh). Goal: Optimize MoE routing top-k reduction and non-power-of-two sorting Target hardware: SM100 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under th...
<!-- .github/pull_request_template.md --> ## 📌 Description Improves TRT-LLM MoE routing top-k performance by using a two-step fast warp reduction for 64-bit packed FP32 keys on SM100+, and replacing non-power-of-two odd-even transposition sorting with a padded Batcher odd-even merge network. The new sort path prese...
[{"scope": "kernel", "hardware": null, "model": null, "shape": "K=10,N=2048,T=512", "batch_size": 512, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 6.151, "optimized": 6.144, "stated_speedup": 1.001, "speedup": 1.0011}, {"scope": "kernel", "hardware": null, "model": null, "shape": "K=10,N=2...
1.5832
null
flashinfer
e00c306070f30b6af5da89ed877e8d2ab49c1565
2026-06-04T21:55:05+08:00
3,476
https://github.com/flashinfer-ai/flashinfer/pull/3476
Optimize MoE routing top-k reduction and non-power-of-two sorting (#3476)
Optimize MoE routing top-k reduction and non-power-of-two sorting (#3476) <!-- .github/pull_request_template.md --> ## 📌 Description Improves TRT-LLM MoE routing top-k performance by using a two-step fast warp reduction for 64-bit packed FP32 keys on SM100+, and replacing non-power-of-two odd-even transposition sor...
include/flashinfer/trtllm/fused_moe/RoutingKernelTopK.cuh
cuda
Apache-2.0
/* * Copyright (c) 2022-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2022-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- include/flashinfer/trtllm/fused_moe/RoutingKernelTopK.cuh +++ include/flashinfer/trtllm/fused_moe/RoutingKernelTopK.cuh @@ -77,18 +77,30 @@ __host__ __device__ operator TypeCmp() const noexcept { return compVal; } __device__ inline TypeCmp reduce(cg::thread_block_tile<WarpSize> const& warp) { - // Use fa...
92
24
2
[]
[ "SM100" ]
[ "1.001x", "1.498x", "1.500x", "1.666x", "2.000x", "2.125x" ]
Optimize this cuda kernel file from flashinfer (include/flashinfer/trtllm/fused_moe/RoutingKernelTopK.cuh). Goal: Optimize MoE routing top-k reduction and non-power-of-two sorting Target hardware: SM100 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2022-2025, NVIDIA CORPORATION. All rights res...
<!-- .github/pull_request_template.md --> ## 📌 Description Improves TRT-LLM MoE routing top-k performance by using a two-step fast warp reduction for 64-bit packed FP32 keys on SM100+, and replacing non-power-of-two odd-even transposition sorting with a padded Batcher odd-even merge network. The new sort path prese...
[{"scope": "kernel", "hardware": null, "model": null, "shape": "K=10,N=2048,T=512", "batch_size": 512, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 6.151, "optimized": 6.144, "stated_speedup": 1.001, "speedup": 1.0011}, {"scope": "kernel", "hardware": null, "model": null, "shape": "K=10,N=2...
1.5832
null
flashinfer
1d61b2ad4c683685c44f02085bff5a910b9fa815
2026-06-02T17:50:25-07:00
3,289
https://github.com/flashinfer-ai/flashinfer/pull/3289
Optimize mxfp8 quantization on sm100 (#3289)
Optimize mxfp8 quantization on sm100 (#3289) <!-- .github/pull_request_template.md --> ## 📌 Description Apply the optimizations from (per-token) fp4 quantization kernel to mxfp8 quantization kernel: - use block size 128 - enable 256bit when using sm100f ## 🔍 Related Issues <!-- Link any related issues here -->...
csrc/nv_internal/cpp/kernels/quantization.cu
cuda
Apache-2.0
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/nv_internal/cpp/kernels/quantization.cu +++ csrc/nv_internal/cpp/kernels/quantization.cu @@ -213,8 +213,8 @@ static constexpr int SF_VEC_SIZE = 32; // Grid, Block size. - // Each thread converts 8 values. - dim3 block(std::min(int(padded_n / CVT_FP16_TO_MXFP8_ELTS_PER_THREAD), 512)); + // Each threa...
3
2
3
[]
[ "SM100" ]
[]
Optimize this cuda kernel file from flashinfer (csrc/nv_internal/cpp/kernels/quantization.cu). Goal: Optimize mxfp8 quantization on sm100 Target hardware: SM100 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache Lic...
<!-- .github/pull_request_template.md --> ## 📌 Description Apply the optimizations from (per-token) fp4 quantization kernel to mxfp8 quantization kernel: - use block size 128 - enable 256bit when using sm100f ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for ...
[]
null
null
flashinfer
1d61b2ad4c683685c44f02085bff5a910b9fa815
2026-06-02T17:50:25-07:00
3,289
https://github.com/flashinfer-ai/flashinfer/pull/3289
Optimize mxfp8 quantization on sm100 (#3289)
Optimize mxfp8 quantization on sm100 (#3289) <!-- .github/pull_request_template.md --> ## 📌 Description Apply the optimizations from (per-token) fp4 quantization kernel to mxfp8 quantization kernel: - use block size 128 - enable 256bit when using sm100f ## 🔍 Related Issues <!-- Link any related issues here -->...
csrc/nv_internal/tensorrt_llm/kernels/quantization.cuh
cuda
Apache-2.0
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/nv_internal/tensorrt_llm/kernels/quantization.cuh +++ csrc/nv_internal/tensorrt_llm/kernels/quantization.cuh @@ -55,8 +55,10 @@ defined(__CUDACC_VER_MINOR__) && \ ((__CUDACC_VER_MAJOR__ == 12 && __CUDACC_VER_MINOR__ >= 9) || (__CUDACC_VER_MAJOR__ >...
9
4
3
[]
[ "SM100" ]
[]
Optimize this cuda kernel file from flashinfer (csrc/nv_internal/tensorrt_llm/kernels/quantization.cuh). Goal: Optimize mxfp8 quantization on sm100 Target hardware: SM100 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the ...
<!-- .github/pull_request_template.md --> ## 📌 Description Apply the optimizations from (per-token) fp4 quantization kernel to mxfp8 quantization kernel: - use block size 128 - enable 256bit when using sm100f ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for ...
[]
null
null
flashinfer
1d61b2ad4c683685c44f02085bff5a910b9fa815
2026-06-02T17:50:25-07:00
3,289
https://github.com/flashinfer-ai/flashinfer/pull/3289
Optimize mxfp8 quantization on sm100 (#3289)
Optimize mxfp8 quantization on sm100 (#3289) <!-- .github/pull_request_template.md --> ## 📌 Description Apply the optimizations from (per-token) fp4 quantization kernel to mxfp8 quantization kernel: - use block size 128 - enable 256bit when using sm100f ## 🔍 Related Issues <!-- Link any related issues here -->...
csrc/nv_internal/tensorrt_llm/kernels/quantization_utils.cuh
cuda
Apache-2.0
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/nv_internal/tensorrt_llm/kernels/quantization_utils.cuh +++ csrc/nv_internal/tensorrt_llm/kernels/quantization_utils.cuh @@ -235,6 +235,26 @@ return u.val; } +// Convert 8 float2 values into 16 e4m3 values (represented as one uint4). +inline __device__ uint4 fp32_vec_to_e4m3(float2 (&array)[8]) { + unio...
31
7
3
[]
[ "SM100" ]
[]
Optimize this cuda kernel file from flashinfer (csrc/nv_internal/tensorrt_llm/kernels/quantization_utils.cuh). Goal: Optimize mxfp8 quantization on sm100 Target hardware: SM100 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed unde...
<!-- .github/pull_request_template.md --> ## 📌 Description Apply the optimizations from (per-token) fp4 quantization kernel to mxfp8 quantization kernel: - use block size 128 - enable 256bit when using sm100f ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for ...
[]
null
null
flashinfer
d53f10682cfdc13c12d3463b2559355b9eb1671d
2026-05-26T10:24:42-07:00
3,385
https://github.com/flashinfer-ai/flashinfer/pull/3385
feat: MNNVL Allreduce quant fusion and performance optimization (#3385)
feat: MNNVL Allreduce quant fusion and performance optimization (#3385) <!-- .github/pull_request_template.md --> ## 📌 Description - Use named barrier and cluster barrier instead of a sync. - Avoid loading local buffer again in oneshot, use template-based fash path for world size <= 8. - Adjust grid dispatch policy...
csrc/trtllm_mnnvl_allreduce.cu
cuda
Apache-2.0
#include "flashinfer/comm/trtllm_mnnvl_allreduce.cuh" #include "tvm_ffi_utils.h" using namespace flashinfer::trtllm_mnnvl_allreduce; using tvm::ffi::Optional; #define DISPATCH_FLOATING_TYPES_FOR_MNNVL_ALLREDUCE(dtype, c_type, ...) \ [&] { ...
#include "flashinfer/comm/trtllm_mnnvl_allreduce.cuh" #include "tvm_ffi_utils.h" using namespace flashinfer::trtllm_mnnvl_allreduce; using flashinfer::QuantizationSFLayout; using tvm::ffi::Optional; #define DISPATCH_FLOATING_TYPES_FOR_MNNVL_ALLREDUCE(dtype, c_type, ...) \ [&] { ...
--- csrc/trtllm_mnnvl_allreduce.cu +++ csrc/trtllm_mnnvl_allreduce.cu @@ -3,6 +3,7 @@ using namespace flashinfer::trtllm_mnnvl_allreduce; +using flashinfer::QuantizationSFLayout; using tvm::ffi::Optional; #define DISPATCH_FLOATING_TYPES_FOR_MNNVL_ALLREDUCE(dtype, c_type, ...) \ @@ -30,9 +31,12 @@ ...
80
6
5
[]
[ "BLACKWELL", "HOPPER" ]
[]
Optimize this cuda kernel file from flashinfer (csrc/trtllm_mnnvl_allreduce.cu). Goal: feat: MNNVL Allreduce quant fusion and performance optimization Target hardware: BLACKWELL, HOPPER Target models: unspecified Current file: ```cuda #include "flashinfer/comm/trtllm_mnnvl_allreduce.cuh" #include "tvm_ffi_utils.h" u...
<!-- .github/pull_request_template.md --> ## 📌 Description - Use named barrier and cluster barrier instead of a sync. - Avoid loading local buffer again in oneshot, use template-based fash path for world size <= 8. - Adjust grid dispatch policy to use more SMs at the cost of single SM occupancy for small batch sizes....
[{"scope": "kernel", "hardware": null, "model": null, "shape": "M <= 8", "batch_size": null, "metric": "latency", "unit": "%", "higher_is_better": false, "baseline": null, "optimized": null, "stated_speedup": 1.0624, "speedup": 1.0624}, {"scope": "kernel", "hardware": null, "model": null, "shape": "M <= 8", "batch_size...
1.0525
null
flashinfer
202af00dff85c1d5b50d15eab59d936365042af3
2026-05-07T20:58:39-07:00
3,237
https://github.com/flashinfer-ai/flashinfer/pull/3237
perf: optimize per-token nvfp4 quantization kernel. (#3237)
perf: optimize per-token nvfp4 quantization kernel. (#3237) <!-- .github/pull_request_template.md --> ## 📌 Description Optimize the performance of the per-token nvfp4 quantization kernel introduced by #3027. 1. default block size to 128. 2. default to fast math path. rename `TE_EXACT_FP4` to `TRTLLM_DISABLE_FP4_QU...
csrc/nv_internal/cpp/common/envUtils.cpp
cpp
Apache-2.0
/* * SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights * reserved. SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the Lic...
/* * SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights * reserved. SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the Lic...
--- csrc/nv_internal/cpp/common/envUtils.cpp +++ csrc/nv_internal/cpp/common/envUtils.cpp @@ -354,6 +354,14 @@ return kBlock; } -bool getEnvEplbForceGdrcopy() { return getBoolEnv("TRTLLM_EPLB_FORCE_GDRCOPY"); } +bool getEnvEplbForceGdrcopy() { + static bool const forceGdrcopy = getBoolEnv("TRTLLM_EPLB_FORCE_GDRC...
9
1
6
[]
[]
[]
Optimize this cpp kernel file from flashinfer (csrc/nv_internal/cpp/common/envUtils.cpp). Goal: perf: optimize per-token nvfp4 quantization kernel. Target hardware: unspecified Target models: unspecified Current file: ```cpp /* * SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All ri...
<!-- .github/pull_request_template.md --> ## 📌 Description Optimize the performance of the per-token nvfp4 quantization kernel introduced by #3027. 1. default block size to 128. 2. default to fast math path. rename `TE_EXACT_FP4` to `TRTLLM_DISABLE_FP4_QUANT_FAST_MATH` and controlled by environmental variable. 3. ...
[]
null
null
flashinfer
202af00dff85c1d5b50d15eab59d936365042af3
2026-05-07T20:58:39-07:00
3,237
https://github.com/flashinfer-ai/flashinfer/pull/3237
perf: optimize per-token nvfp4 quantization kernel. (#3237)
perf: optimize per-token nvfp4 quantization kernel. (#3237) <!-- .github/pull_request_template.md --> ## 📌 Description Optimize the performance of the per-token nvfp4 quantization kernel introduced by #3027. 1. default block size to 128. 2. default to fast math path. rename `TE_EXACT_FP4` to `TRTLLM_DISABLE_FP4_QU...
csrc/nv_internal/cpp/kernels/quantization.cu
cuda
Apache-2.0
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/nv_internal/cpp/kernels/quantization.cu +++ csrc/nv_internal/cpp/kernels/quantization.cu @@ -236,17 +236,18 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// // Per-token Nvfp4 kernel -#define DISPATCH_NVP4_QUANT_AND_PER_TOKEN_SCALE_KERNEL(SF_LAYOUT) ...
37
28
6
[]
[]
[]
Optimize this cuda kernel file from flashinfer (csrc/nv_internal/cpp/kernels/quantization.cu). Goal: perf: optimize per-token nvfp4 quantization kernel. Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed...
<!-- .github/pull_request_template.md --> ## 📌 Description Optimize the performance of the per-token nvfp4 quantization kernel introduced by #3027. 1. default block size to 128. 2. default to fast math path. rename `TE_EXACT_FP4` to `TRTLLM_DISABLE_FP4_QUANT_FAST_MATH` and controlled by environmental variable. 3. ...
[]
null
null
flashinfer
202af00dff85c1d5b50d15eab59d936365042af3
2026-05-07T20:58:39-07:00
3,237
https://github.com/flashinfer-ai/flashinfer/pull/3237
perf: optimize per-token nvfp4 quantization kernel. (#3237)
perf: optimize per-token nvfp4 quantization kernel. (#3237) <!-- .github/pull_request_template.md --> ## 📌 Description Optimize the performance of the per-token nvfp4 quantization kernel introduced by #3027. 1. default block size to 128. 2. default to fast math path. rename `TE_EXACT_FP4` to `TRTLLM_DISABLE_FP4_QU...
csrc/nv_internal/tensorrt_llm/common/envUtils.h
cpp
Apache-2.0
/* * SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights * reserved. SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the Lic...
/* * SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights * reserved. SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the Lic...
--- csrc/nv_internal/tensorrt_llm/common/envUtils.h +++ csrc/nv_internal/tensorrt_llm/common/envUtils.h @@ -101,4 +101,7 @@ // Block size (threads per block) for MoE A2A Combine kernels (default 256 if unset or invalid) int getEnvMoeA2ACombineBlockSize(); +// Disable the fast fp4 quantization math and align with th...
3
0
6
[]
[]
[]
Optimize this cpp kernel file from flashinfer (csrc/nv_internal/tensorrt_llm/common/envUtils.h). Goal: perf: optimize per-token nvfp4 quantization kernel. Target hardware: unspecified Target models: unspecified Current file: ```cpp /* * SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES....
<!-- .github/pull_request_template.md --> ## 📌 Description Optimize the performance of the per-token nvfp4 quantization kernel introduced by #3027. 1. default block size to 128. 2. default to fast math path. rename `TE_EXACT_FP4` to `TRTLLM_DISABLE_FP4_QUANT_FAST_MATH` and controlled by environmental variable. 3. ...
[]
null
null
flashinfer
202af00dff85c1d5b50d15eab59d936365042af3
2026-05-07T20:58:39-07:00
3,237
https://github.com/flashinfer-ai/flashinfer/pull/3237
perf: optimize per-token nvfp4 quantization kernel. (#3237)
perf: optimize per-token nvfp4 quantization kernel. (#3237) <!-- .github/pull_request_template.md --> ## 📌 Description Optimize the performance of the per-token nvfp4 quantization kernel introduced by #3027. 1. default block size to 128. 2. default to fast math path. rename `TE_EXACT_FP4` to `TRTLLM_DISABLE_FP4_QU...
csrc/nv_internal/tensorrt_llm/kernels/quantization.cuh
cuda
Apache-2.0
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/nv_internal/tensorrt_llm/kernels/quantization.cuh +++ csrc/nv_internal/tensorrt_llm/kernels/quantization.cuh @@ -686,49 +686,55 @@ __global__ void block_scale_interleave_kernel(int numbatches, int numRows, int numCols, uint8_t const* SFIn, uint8_t* SFOutput); -...
70
60
6
[]
[]
[]
Optimize this cuda kernel file from flashinfer (csrc/nv_internal/tensorrt_llm/kernels/quantization.cuh). Goal: perf: optimize per-token nvfp4 quantization kernel. Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * ...
<!-- .github/pull_request_template.md --> ## 📌 Description Optimize the performance of the per-token nvfp4 quantization kernel introduced by #3027. 1. default block size to 128. 2. default to fast math path. rename `TE_EXACT_FP4` to `TRTLLM_DISABLE_FP4_QUANT_FAST_MATH` and controlled by environmental variable. 3. ...
[]
null
null
flashinfer
202af00dff85c1d5b50d15eab59d936365042af3
2026-05-07T20:58:39-07:00
3,237
https://github.com/flashinfer-ai/flashinfer/pull/3237
perf: optimize per-token nvfp4 quantization kernel. (#3237)
perf: optimize per-token nvfp4 quantization kernel. (#3237) <!-- .github/pull_request_template.md --> ## 📌 Description Optimize the performance of the per-token nvfp4 quantization kernel introduced by #3027. 1. default block size to 128. 2. default to fast math path. rename `TE_EXACT_FP4` to `TRTLLM_DISABLE_FP4_QU...
csrc/nv_internal/tensorrt_llm/kernels/quantization.h
cpp
Apache-2.0
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/nv_internal/tensorrt_llm/kernels/quantization.h +++ csrc/nv_internal/tensorrt_llm/kernels/quantization.h @@ -76,7 +76,7 @@ void invokeNvfp4QuantAndPerTokenScale(uint32_t m, uint32_t n, T const* input, float globalScaleInv, int32_t* expanded_idx_to_permuted_idx, uint8_t* ...
1
1
6
[]
[]
[]
Optimize this cpp kernel file from flashinfer (csrc/nv_internal/tensorrt_llm/kernels/quantization.h). Goal: perf: optimize per-token nvfp4 quantization kernel. Target hardware: unspecified Target models: unspecified Current file: ```cpp /* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Li...
<!-- .github/pull_request_template.md --> ## 📌 Description Optimize the performance of the per-token nvfp4 quantization kernel introduced by #3027. 1. default block size to 128. 2. default to fast math path. rename `TE_EXACT_FP4` to `TRTLLM_DISABLE_FP4_QUANT_FAST_MATH` and controlled by environmental variable. 3. ...
[]
null
null
flashinfer
202af00dff85c1d5b50d15eab59d936365042af3
2026-05-07T20:58:39-07:00
3,237
https://github.com/flashinfer-ai/flashinfer/pull/3237
perf: optimize per-token nvfp4 quantization kernel. (#3237)
perf: optimize per-token nvfp4 quantization kernel. (#3237) <!-- .github/pull_request_template.md --> ## 📌 Description Optimize the performance of the per-token nvfp4 quantization kernel introduced by #3027. 1. default block size to 128. 2. default to fast math path. rename `TE_EXACT_FP4` to `TRTLLM_DISABLE_FP4_QU...
csrc/nv_internal/tensorrt_llm/kernels/quantization_utils.cuh
cuda
Apache-2.0
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/nv_internal/tensorrt_llm/kernels/quantization_utils.cuh +++ csrc/nv_internal/tensorrt_llm/kernels/quantization_utils.cuh @@ -290,7 +290,7 @@ // Quantizes the provided PackedVec into the uint32_t or uint64_t output template <class Type, int SF_VEC_SIZE, int CVT_ELTS_PER_THREAD, bool UE8M0_SF, - boo...
88
36
6
[]
[]
[]
Optimize this cuda kernel file from flashinfer (csrc/nv_internal/tensorrt_llm/kernels/quantization_utils.cuh). Goal: perf: optimize per-token nvfp4 quantization kernel. Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved...
<!-- .github/pull_request_template.md --> ## 📌 Description Optimize the performance of the per-token nvfp4 quantization kernel introduced by #3027. 1. default block size to 128. 2. default to fast math path. rename `TE_EXACT_FP4` to `TRTLLM_DISABLE_FP4_QUANT_FAST_MATH` and controlled by environmental variable. 3. ...
[]
null
null
flashinfer
2fe28ca941911e79f517af618c2ad52ee377cd79
2026-05-07T17:51:51-07:00
3,239
https://github.com/flashinfer-ai/flashinfer/pull/3239
perf: Update moe gemm (#3239)
perf: Update moe gemm (#3239) <!-- .github/pull_request_template.md --> ## 📌 Description Update the trtllm-gen cubin to improve mxfp4 moe, DeepSeek-V3 MoE, and mxfp8 gemm performance. ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer...
csrc/trtllm_batched_gemm_runner.cu
cuda
Apache-2.0
/* * Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/trtllm_batched_gemm_runner.cu +++ csrc/trtllm_batched_gemm_runner.cu @@ -91,9 +91,11 @@ auto const configs = bmm.getBatchedGemmConfigs(); mPassingConfigIndices.clear(); + auto sm_version = getSMVersion(); for (size_t i = 0; i < bmm.getNumBatchedGemmConfigs(); ++i) { - auto const options = conf...
10
2
4
[ "deepseek" ]
[]
[]
Optimize this cuda kernel file from flashinfer (csrc/trtllm_batched_gemm_runner.cu). Goal: perf: Update moe gemm Target hardware: unspecified Target models: deepseek Current file: ```cuda /* * Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the...
<!-- .github/pull_request_template.md --> ## 📌 Description Update the trtllm-gen cubin to improve mxfp4 moe, DeepSeek-V3 MoE, and mxfp8 gemm performance. ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull re...
[]
null
null
flashinfer
2fe28ca941911e79f517af618c2ad52ee377cd79
2026-05-07T17:51:51-07:00
3,239
https://github.com/flashinfer-ai/flashinfer/pull/3239
perf: Update moe gemm (#3239)
perf: Update moe gemm (#3239) <!-- .github/pull_request_template.md --> ## 📌 Description Update the trtllm-gen cubin to improve mxfp4 moe, DeepSeek-V3 MoE, and mxfp8 gemm performance. ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer...
csrc/trtllm_gemm_runner.cu
cuda
Apache-2.0
/* * Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/trtllm_gemm_runner.cu +++ csrc/trtllm_gemm_runner.cu @@ -44,21 +44,21 @@ int64_t select_kernel_fp8(int32_t M, int32_t N, int32_t K, const gemm::gemm::GemmInterface& interface) { static constexpr const char* KERNEL_NAME_HIGH_N_K_RATIO = - "gemm_Bfloat16_E4m3E4m3_Fp32_t128x8x1...
8
8
4
[ "deepseek" ]
[]
[]
Optimize this cuda kernel file from flashinfer (csrc/trtllm_gemm_runner.cu). Goal: perf: Update moe gemm Target hardware: unspecified Target models: deepseek Current file: ```cuda /* * Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "Licens...
<!-- .github/pull_request_template.md --> ## 📌 Description Update the trtllm-gen cubin to improve mxfp4 moe, DeepSeek-V3 MoE, and mxfp8 gemm performance. ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull re...
[]
null
null
flashinfer
2fe28ca941911e79f517af618c2ad52ee377cd79
2026-05-07T17:51:51-07:00
3,239
https://github.com/flashinfer-ai/flashinfer/pull/3239
perf: Update moe gemm (#3239)
perf: Update moe gemm (#3239) <!-- .github/pull_request_template.md --> ## 📌 Description Update the trtllm-gen cubin to improve mxfp4 moe, DeepSeek-V3 MoE, and mxfp8 gemm performance. ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer...
csrc/trtllm_low_latency_gemm_runner.cu
cuda
Apache-2.0
/* * Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/trtllm_low_latency_gemm_runner.cu +++ csrc/trtllm_low_latency_gemm_runner.cu @@ -63,28 +63,28 @@ */ int64_t select_kernel(int32_t m, int32_t n, int32_t k, const gemm::gemm::GemmInterface& interface) { static constexpr const char* KERNEL_MMAN_8_TILEK_128 = - "gemm_Bfloat16_E4m3E4m3_Fp32_t128x8x128_s7...
8
8
4
[ "deepseek" ]
[]
[]
Optimize this cuda kernel file from flashinfer (csrc/trtllm_low_latency_gemm_runner.cu). Goal: perf: Update moe gemm Target hardware: unspecified Target models: deepseek Current file: ```cuda /* * Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 ...
<!-- .github/pull_request_template.md --> ## 📌 Description Update the trtllm-gen cubin to improve mxfp4 moe, DeepSeek-V3 MoE, and mxfp8 gemm performance. ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull re...
[]
null
null
flashinfer
8d1b69b2b4b73a04895dacc7486bec25416e93c4
2026-05-06T21:49:53-07:00
3,129
https://github.com/flashinfer-ai/flashinfer/pull/3129
feat: Enable FP8 (E4M3/E5M2) in concat_mla_k for optimize long-context prefill performance and refactor type dispatch for BF16/FP16 (#3129)
feat: Enable FP8 (E4M3/E5M2) in concat_mla_k for optimize long-context prefill performance and refactor type dispatch for BF16/FP16 (#3129) ## Summary Enable FP8 (E4M3/E5M2) support in `concat_mla_k`, fixing a crash that blocks FP8 chunked prefill for all MLA models (DeepSeek-V2/V3/R1) on long-context workloads. ## ...
csrc/concat_mla.cu
cuda
Apache-2.0
/* * Copyright (c) 2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
/* * Copyright (c) 2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
--- csrc/concat_mla.cu +++ csrc/concat_mla.cu @@ -84,7 +84,7 @@ ffi::CUDADeviceGuard device_guard(k.device().device_id); const cudaStream_t stream = get_stream(k.device()); - bool success = DISPATCH_DLPACK_DTYPE_TO_CTYPE_FP16(k.dtype(), c_type, [&] { + bool success = DISPATCH_DLPACK_DTYPE_TO_CTYPE_FP16_FP8(k....
1
1
5
[ "deepseek" ]
[ "GB300" ]
[ "1.35x" ]
Optimize this cuda kernel file from flashinfer (csrc/concat_mla.cu). Goal: feat: Enable FP8 (E4M3/E5M2) in concat_mla_k for optimize long-context prefill performance and refactor type dispatch for BF16/FP16 Target hardware: GB300 Target models: deepseek Current file: ```cuda /* * Copyright (c) 2025 by FlashInfer tea...
## Summary Enable FP8 (E4M3/E5M2) support in `concat_mla_k`, fixing a crash that blocks FP8 chunked prefill for all MLA models (DeepSeek-V2/V3/R1) on long-context workloads. ## Motivation For long-context inference (ISL >= 4K) in vLLM, chunked prefill + FP8 quantization (`use_prefill_query_quantization: true`) is cr...
[{"scope": "e2e", "hardware": "GB300", "model": "DeepSeek-R1-0528-FP4", "shape": "ISL=128K", "batch_size": 16, "metric": "Median TTFT", "unit": "s", "higher_is_better": false, "baseline": 42.0, "optimized": 30.1, "stated_speedup": null, "speedup": 1.3953}, {"scope": "e2e", "hardware": "GB300", "model": "DeepSeek-R1-052...
null
1.3681
flashinfer
8d1b69b2b4b73a04895dacc7486bec25416e93c4
2026-05-06T21:49:53-07:00
3,129
https://github.com/flashinfer-ai/flashinfer/pull/3129
feat: Enable FP8 (E4M3/E5M2) in concat_mla_k for optimize long-context prefill performance and refactor type dispatch for BF16/FP16 (#3129)
feat: Enable FP8 (E4M3/E5M2) in concat_mla_k for optimize long-context prefill performance and refactor type dispatch for BF16/FP16 (#3129) ## Summary Enable FP8 (E4M3/E5M2) support in `concat_mla_k`, fixing a crash that blocks FP8 chunked prefill for all MLA models (DeepSeek-V2/V3/R1) on long-context workloads. ## ...
csrc/tvm_ffi_utils.h
cpp
Apache-2.0
/* * Copyright (c) 2023 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
/* * Copyright (c) 2023 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
--- csrc/tvm_ffi_utils.h +++ csrc/tvm_ffi_utils.h @@ -166,6 +166,20 @@ } \ }() +#define DISPATCH_DLPACK_DTYPE_TO_CTYPE_FP16_FP8(dlpack_dtype, c_type, ...) \ + [&]() -> bool { ...
14
0
5
[ "deepseek" ]
[ "GB300" ]
[ "1.35x" ]
Optimize this cpp kernel file from flashinfer (csrc/tvm_ffi_utils.h). Goal: feat: Enable FP8 (E4M3/E5M2) in concat_mla_k for optimize long-context prefill performance and refactor type dispatch for BF16/FP16 Target hardware: GB300 Target models: deepseek Current file: ```cpp /* * Copyright (c) 2023 by FlashInfer tea...
## Summary Enable FP8 (E4M3/E5M2) support in `concat_mla_k`, fixing a crash that blocks FP8 chunked prefill for all MLA models (DeepSeek-V2/V3/R1) on long-context workloads. ## Motivation For long-context inference (ISL >= 4K) in vLLM, chunked prefill + FP8 quantization (`use_prefill_query_quantization: true`) is cr...
[{"scope": "e2e", "hardware": "GB300", "model": "DeepSeek-R1-0528-FP4", "shape": "ISL=128K", "batch_size": 16, "metric": "Median TTFT", "unit": "s", "higher_is_better": false, "baseline": 42.0, "optimized": 30.1, "stated_speedup": null, "speedup": 1.3953}, {"scope": "e2e", "hardware": "GB300", "model": "DeepSeek-R1-052...
null
1.3681
flashinfer
8d1b69b2b4b73a04895dacc7486bec25416e93c4
2026-05-06T21:49:53-07:00
3,129
https://github.com/flashinfer-ai/flashinfer/pull/3129
feat: Enable FP8 (E4M3/E5M2) in concat_mla_k for optimize long-context prefill performance and refactor type dispatch for BF16/FP16 (#3129)
feat: Enable FP8 (E4M3/E5M2) in concat_mla_k for optimize long-context prefill performance and refactor type dispatch for BF16/FP16 (#3129) ## Summary Enable FP8 (E4M3/E5M2) support in `concat_mla_k`, fixing a crash that blocks FP8 chunked prefill for all MLA models (DeepSeek-V2/V3/R1) on long-context workloads. ## ...
include/flashinfer/concat_mla.cuh
cuda
Apache-2.0
/* * Copyright (c) 2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
/* * Copyright (c) 2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
--- include/flashinfer/concat_mla.cuh +++ include/flashinfer/concat_mla.cuh @@ -18,6 +18,7 @@ #include <cuda_bf16.h> #include <cuda_fp16.h> +#include <cuda_fp8.h> #include <cuda_runtime.h> #include "utils.cuh" @@ -33,6 +34,91 @@ constexpr int MLA_HEAD_CHUNK_SIZE = 16; constexpr int MLA_NUM_HEAD_CHUNKS = MLA_N...
115
35
5
[ "deepseek" ]
[ "GB300" ]
[ "1.35x" ]
Optimize this cuda kernel file from flashinfer (include/flashinfer/concat_mla.cuh). Goal: feat: Enable FP8 (E4M3/E5M2) in concat_mla_k for optimize long-context prefill performance and refactor type dispatch for BF16/FP16 Target hardware: GB300 Target models: deepseek Current file: ```cuda /* * Copyright (c) 2025 by...
## Summary Enable FP8 (E4M3/E5M2) support in `concat_mla_k`, fixing a crash that blocks FP8 chunked prefill for all MLA models (DeepSeek-V2/V3/R1) on long-context workloads. ## Motivation For long-context inference (ISL >= 4K) in vLLM, chunked prefill + FP8 quantization (`use_prefill_query_quantization: true`) is cr...
[{"scope": "e2e", "hardware": "GB300", "model": "DeepSeek-R1-0528-FP4", "shape": "ISL=128K", "batch_size": 16, "metric": "Median TTFT", "unit": "s", "higher_is_better": false, "baseline": 42.0, "optimized": 30.1, "stated_speedup": null, "speedup": 1.3953}, {"scope": "e2e", "hardware": "GB300", "model": "DeepSeek-R1-052...
null
1.3681
flashinfer
8d1b69b2b4b73a04895dacc7486bec25416e93c4
2026-05-06T21:49:53-07:00
3,129
https://github.com/flashinfer-ai/flashinfer/pull/3129
feat: Enable FP8 (E4M3/E5M2) in concat_mla_k for optimize long-context prefill performance and refactor type dispatch for BF16/FP16 (#3129)
feat: Enable FP8 (E4M3/E5M2) in concat_mla_k for optimize long-context prefill performance and refactor type dispatch for BF16/FP16 (#3129) ## Summary Enable FP8 (E4M3/E5M2) support in `concat_mla_k`, fixing a crash that blocks FP8 chunked prefill for all MLA models (DeepSeek-V2/V3/R1) on long-context workloads. ## ...
include/flashinfer/utils.cuh
cuda
Apache-2.0
/* * Copyright (c) 2023 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
/* * Copyright (c) 2023 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
--- include/flashinfer/utils.cuh +++ include/flashinfer/utils.cuh @@ -447,6 +447,22 @@ } /*! + * \brief Non-atomic global load for short (2 bytes) with cache streaming hint + */ +__forceinline__ __device__ short ld_na_global_s16(const short* addr) { + short val; + asm volatile("ld.global.cs.b16 %0, [%1];" : "=h"(...
16
0
5
[ "deepseek" ]
[ "GB300" ]
[ "1.35x" ]
Optimize this cuda kernel file from flashinfer (include/flashinfer/utils.cuh). Goal: feat: Enable FP8 (E4M3/E5M2) in concat_mla_k for optimize long-context prefill performance and refactor type dispatch for BF16/FP16 Target hardware: GB300 Target models: deepseek Current file: ```cuda /* * Copyright (c) 2023 by Flas...
## Summary Enable FP8 (E4M3/E5M2) support in `concat_mla_k`, fixing a crash that blocks FP8 chunked prefill for all MLA models (DeepSeek-V2/V3/R1) on long-context workloads. ## Motivation For long-context inference (ISL >= 4K) in vLLM, chunked prefill + FP8 quantization (`use_prefill_query_quantization: true`) is cr...
[{"scope": "e2e", "hardware": "GB300", "model": "DeepSeek-R1-0528-FP4", "shape": "ISL=128K", "batch_size": 16, "metric": "Median TTFT", "unit": "s", "higher_is_better": false, "baseline": 42.0, "optimized": 30.1, "stated_speedup": null, "speedup": 1.3953}, {"scope": "e2e", "hardware": "GB300", "model": "DeepSeek-R1-052...
null
1.3681
flashinfer
f684dd537a3609f0261f00d555321c8cbc7fc9b5
2026-05-06T20:22:06-07:00
3,193
https://github.com/flashinfer-ai/flashinfer/pull/3193
perf(moe): optimize SM120 b12x MoE short decode (#3193)
perf(moe): optimize SM120 b12x MoE short decode (#3193) Synchronize the SM120 b12x MoE implementation from the upstream b12x kernels, including the short-decode dispatch and micro-kernel fixes. ## 📌 Description Synchronizes the SM120 B12x MoE implementation with the upstream b12x kernel changes. This PR updates ...
flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_dispatch.py
cute_dsl
Apache-2.0
"""SM120/SM121 MoE dispatch layer — workspace, compilation, and launch. Ported from b12x's integration/tp_moe.py. Supports micro (tiny decode), static (decode), and dynamic (prefill) backends with token-count-based selection. """ from __future__ import annotations import os from dataclasses import dataclass from typ...
"""SM120/SM121 MoE dispatch layer — workspace, compilation, and launch. Ported from b12x's integration/tp_moe.py. Supports micro (tiny decode), static (decode), and dynamic (prefill) backends with token-count-based selection. """ from __future__ import annotations import os from dataclasses import dataclass from typ...
--- flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_dispatch.py +++ flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_dispatch.py @@ -557,6 +557,8 @@ input_scales_are_reciprocal: bool = False, fast_math: bool = True, share_input_across_experts: bool = False, + share_expert_scales: bool = False, + ...
33
18
2
[]
[ "SM120" ]
[]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_dispatch.py). Goal: perf(moe): optimize SM120 b12x MoE short decode Target hardware: SM120 Target models: unspecified Current file: ```python """SM120/SM121 MoE dispatch layer — workspace, compilation, and launch. P...
Synchronize the SM120 b12x MoE implementation from the upstream b12x kernels, including the short-decode dispatch and micro-kernel fixes. ## 📌 Description Synchronizes the SM120 B12x MoE implementation with the upstream b12x kernel changes. This PR updates the short-decode path for B12x fused MoE, including: ...
[]
null
null
flashinfer
f684dd537a3609f0261f00d555321c8cbc7fc9b5
2026-05-06T20:22:06-07:00
3,193
https://github.com/flashinfer-ai/flashinfer/pull/3193
perf(moe): optimize SM120 b12x MoE short decode (#3193)
perf(moe): optimize SM120 b12x MoE short decode (#3193) Synchronize the SM120 b12x MoE implementation from the upstream b12x kernels, including the short-decode dispatch and micro-kernel fixes. ## 📌 Description Synchronizes the SM120 B12x MoE implementation with the upstream b12x kernel changes. This PR updates ...
flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_micro_kernel.py
cute_dsl
Apache-2.0
""" MoEMicroKernel — micro-scheduled routed NVFP4 MoE kernel for SM120/SM121 (Blackwell). Ported from the b12x kernel library to FlashInfer. This is the micro control-plane fusion step for decode workloads: keep the proven FC1/FC2 compute body, but pull the route/pack frontend into the same resident kernel, using pre...
""" MoEMicroKernel — micro-scheduled routed NVFP4 MoE kernel for SM120/SM121 (Blackwell). Ported from the b12x kernel library to FlashInfer. This is the micro control-plane fusion step for decode workloads: keep the proven FC1/FC2 compute body, but pull the route/pack frontend into the same resident kernel, using pre...
--- flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_micro_kernel.py +++ flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_micro_kernel.py @@ -33,8 +33,8 @@ What changes relative to the static kernel: - topk_ids contains LOCAL expert IDs (pre-compacted by Triton pre-pass) - global expert IDs looked up via weigh...
78
48
2
[]
[ "SM120" ]
[]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_micro_kernel.py). Goal: perf(moe): optimize SM120 b12x MoE short decode Target hardware: SM120 Target models: unspecified Current file: ```python """ MoEMicroKernel — micro-scheduled routed NVFP4 MoE kernel for SM120...
Synchronize the SM120 b12x MoE implementation from the upstream b12x kernels, including the short-decode dispatch and micro-kernel fixes. ## 📌 Description Synchronizes the SM120 B12x MoE implementation with the upstream b12x kernel changes. This PR updates the short-decode path for B12x fused MoE, including: ...
[]
null
null
flashinfer
2bb1f857f0467f47b7ed5c0fc2e104a710ae89fa
2026-05-06T06:11:01-04:00
3,227
https://github.com/flashinfer-ai/flashinfer/pull/3227
fix: fused MoE autotuning correctness issues by filtering clusterDimZ (#3227)
fix: fused MoE autotuning correctness issues by filtering clusterDimZ (#3227) ## 📌 Description There has been correctness issues observed using fused MoE autotuning. Investigating shows tactics using `clusterDimZ >= 1` produces incorrect outputs. See https://github.com/flashinfer-ai/flashinfer/issues/3197 This PR ch...
csrc/trtllm_batched_gemm_runner.cu
cuda
Apache-2.0
/* * Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/trtllm_batched_gemm_runner.cu +++ csrc/trtllm_batched_gemm_runner.cu @@ -121,6 +121,9 @@ } if (mOptions.transposeMmaOutput && options.mEpilogueTileM == mOptions.epilogueTileM) { + // Skip cubins with clusterZ > 1 due to correctness issues described in + // https://github.com/flash...
3
0
2
[]
[]
[]
Optimize this cuda kernel file from flashinfer (csrc/trtllm_batched_gemm_runner.cu). Goal: fix: fused MoE autotuning correctness issues by filtering clusterDimZ Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. * * ...
## 📌 Description There has been correctness issues observed using fused MoE autotuning. Investigating shows tactics using `clusterDimZ >= 1` produces incorrect outputs. See https://github.com/flashinfer-ai/flashinfer/issues/3197 This PR changes the following: - only allow tactics with `clusterDimZ == 1` - add test th...
[]
null
null
flashinfer
955ddc9599288e7fcb9b26d2cb3960e6451959d5
2026-05-06T01:46:39-04:00
2,841
https://github.com/flashinfer-ai/flashinfer/pull/2841
[Perf] Add FMHAv2 to flashinfer_benchmark.py and eliminate unnecessary H2D (#2841)
[Perf] Add FMHAv2 to flashinfer_benchmark.py and eliminate unnecessary H2D (#2841) ## 📌 Description This PR wires `trtllm_fmha_v2_prefill` into the `flashinfer_benchmark` harness and fixes several CUDA-graph-incompatible allocations on the FMHAv2 prefill hot path. ### Benchmark integration - Add `trtllm-fmha-v2` a...
csrc/fmha_v2_jit_binding.cu
cuda
Apache-2.0
/* * Copyright (c) 2023-2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
/* * Copyright (c) 2023-2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
--- csrc/fmha_v2_jit_binding.cu +++ csrc/fmha_v2_jit_binding.cu @@ -32,8 +32,8 @@ int max_q_len, int max_kv_len, int batch_size, const std::string& mask_mode_str, float scale_softmax, float scale_bmm1, float scale_bmm2, int window_left, int chunked_attention_size, b...
2
2
7
[]
[ "AMPERE", "BLACKWELL", "HOPPER", "SM120", "SM80", "SM90" ]
[]
Optimize this cuda kernel file from flashinfer (csrc/fmha_v2_jit_binding.cu). Goal: [Perf] Add FMHAv2 to flashinfer_benchmark.py and eliminate unnecessary H2D Target hardware: AMPERE, BLACKWELL, HOPPER, SM120, SM80, SM90 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2023-2025 by FlashInfer team...
## 📌 Description This PR wires `trtllm_fmha_v2_prefill` into the `flashinfer_benchmark` harness and fixes several CUDA-graph-incompatible allocations on the FMHAv2 prefill hot path. ### Benchmark integration - Add `trtllm-fmha-v2` as a backend option for `BatchPrefillWithPagedKVCacheWrapper` and `BatchPrefillWithRa...
[]
null
null
flashinfer
955ddc9599288e7fcb9b26d2cb3960e6451959d5
2026-05-06T01:46:39-04:00
2,841
https://github.com/flashinfer-ai/flashinfer/pull/2841
[Perf] Add FMHAv2 to flashinfer_benchmark.py and eliminate unnecessary H2D (#2841)
[Perf] Add FMHAv2 to flashinfer_benchmark.py and eliminate unnecessary H2D (#2841) ## 📌 Description This PR wires `trtllm_fmha_v2_prefill` into the `flashinfer_benchmark` harness and fixes several CUDA-graph-incompatible allocations on the FMHAv2 prefill hot path. ### Benchmark integration - Add `trtllm-fmha-v2` a...
csrc/fmha_v2_run.cu
cuda
Apache-2.0
/* * Copyright (c) 2023-2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
/* * Copyright (c) 2023-2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
--- csrc/fmha_v2_run.cu +++ csrc/fmha_v2_run.cu @@ -211,8 +211,6 @@ } set_alpha(params.scale_softmax, scale_softmax, scale_softmax_type); set_alpha(params.scale_bmm2, scale_bmm2, scale_type2); - // NOTE: scale_bmm2_d is now pre-populated from Python to avoid cudaMemcpy synchronization. - // The Python side c...
13
19
7
[]
[ "AMPERE", "BLACKWELL", "HOPPER", "SM120", "SM80", "SM90" ]
[]
Optimize this cuda kernel file from flashinfer (csrc/fmha_v2_run.cu). Goal: [Perf] Add FMHAv2 to flashinfer_benchmark.py and eliminate unnecessary H2D Target hardware: AMPERE, BLACKWELL, HOPPER, SM120, SM80, SM90 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2023-2025 by FlashInfer team. * * ...
## 📌 Description This PR wires `trtllm_fmha_v2_prefill` into the `flashinfer_benchmark` harness and fixes several CUDA-graph-incompatible allocations on the FMHAv2 prefill hot path. ### Benchmark integration - Add `trtllm-fmha-v2` as a backend option for `BatchPrefillWithPagedKVCacheWrapper` and `BatchPrefillWithRa...
[]
null
null
flashinfer
770609920b31b120f74453cf6baf93c4f2a48cc0
2026-05-01T20:19:24+04:00
2,914
https://github.com/flashinfer-ai/flashinfer/pull/2914
feat: Add cuBLASLt backend for `mm_bf16` and enable multi-tactic autotuning for FP8/MXFP8 runners (#2914)
feat: Add cuBLASLt backend for `mm_bf16` and enable multi-tactic autotuning for FP8/MXFP8 runners (#2914) ## Summary - **Add cuBLASLt backend for `mm_bf16`**: new `backend="cublaslt"` option (gated to SM100/SM103). Autotuning across all available cuBLASLt algorithms via `get_valid_tactics()`. - **Enable multi-tactic ...
csrc/bmm_fp8.cu
cuda
Apache-2.0
/* * Copyright (c) 2024 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
/* * Copyright (c) 2024 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
--- csrc/bmm_fp8.cu +++ csrc/bmm_fp8.cu @@ -49,7 +49,8 @@ auto stream = get_stream(A.device()); auto status = flashinfer::bmm_fp8::bmm_fp8_internal_cublaslt( - workspace_buffer.data_ptr(), workspace_buffer.numel(), + workspace_buffer.data_ptr(), + workspace_buffer.nu...
90
1
8
[]
[ "SM100", "SM103" ]
[]
Optimize this cuda kernel file from flashinfer (csrc/bmm_fp8.cu). Goal: feat: Add cuBLASLt backend for `mm_bf16` and enable multi-tactic autotuning for FP8/MXFP8 runners Target hardware: SM100, SM103 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2024 by FlashInfer team. * * Licensed under the...
## Summary - **Add cuBLASLt backend for `mm_bf16`**: new `backend="cublaslt"` option (gated to SM100/SM103). Autotuning across all available cuBLASLt algorithms via `get_valid_tactics()`. - **Enable multi-tactic autotuning for single-tactic GEMM runners**: `CublasFp8GemmRunner`, `CudnnFp8GemmRunner`, and `CudnnMxfp8G...
[]
null
null
flashinfer
770609920b31b120f74453cf6baf93c4f2a48cc0
2026-05-01T20:19:24+04:00
2,914
https://github.com/flashinfer-ai/flashinfer/pull/2914
feat: Add cuBLASLt backend for `mm_bf16` and enable multi-tactic autotuning for FP8/MXFP8 runners (#2914)
feat: Add cuBLASLt backend for `mm_bf16` and enable multi-tactic autotuning for FP8/MXFP8 runners (#2914) ## Summary - **Add cuBLASLt backend for `mm_bf16`**: new `backend="cublaslt"` option (gated to SM100/SM103). Autotuning across all available cuBLASLt algorithms via `get_valid_tactics()`. - **Enable multi-tactic ...
csrc/flashinfer_gemm_binding.cu
cuda
Apache-2.0
/* * Copyright (c) 2023 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
/* * Copyright (c) 2023 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
--- csrc/flashinfer_gemm_binding.cu +++ csrc/flashinfer_gemm_binding.cu @@ -19,9 +19,19 @@ void bmm_fp8(TensorView A, TensorView B, TensorView D, TensorView A_scale, TensorView B_scale, TensorView workspace_buffer, int64_t cublas_handle); +int64_t bmm_fp8_get_algos(TensorView A, TensorView B, TensorVie...
10
0
8
[]
[ "SM100", "SM103" ]
[]
Optimize this cuda kernel file from flashinfer (csrc/flashinfer_gemm_binding.cu). Goal: feat: Add cuBLASLt backend for `mm_bf16` and enable multi-tactic autotuning for FP8/MXFP8 runners Target hardware: SM100, SM103 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2023 by FlashInfer team. * * Li...
## Summary - **Add cuBLASLt backend for `mm_bf16`**: new `backend="cublaslt"` option (gated to SM100/SM103). Autotuning across all available cuBLASLt algorithms via `get_valid_tactics()`. - **Enable multi-tactic autotuning for single-tactic GEMM runners**: `CublasFp8GemmRunner`, `CudnnFp8GemmRunner`, and `CudnnMxfp8G...
[]
null
null
flashinfer
770609920b31b120f74453cf6baf93c4f2a48cc0
2026-05-01T20:19:24+04:00
2,914
https://github.com/flashinfer-ai/flashinfer/pull/2914
feat: Add cuBLASLt backend for `mm_bf16` and enable multi-tactic autotuning for FP8/MXFP8 runners (#2914)
feat: Add cuBLASLt backend for `mm_bf16` and enable multi-tactic autotuning for FP8/MXFP8 runners (#2914) ## Summary - **Add cuBLASLt backend for `mm_bf16`**: new `backend="cublaslt"` option (gated to SM100/SM103). Autotuning across all available cuBLASLt algorithms via `get_valid_tactics()`. - **Enable multi-tactic ...
include/flashinfer/gemm/bmm_fp8.cuh
cuda
Apache-2.0
/* * Copyright (c) 2024 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
/* * Copyright (c) 2024 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
--- include/flashinfer/gemm/bmm_fp8.cuh +++ include/flashinfer/gemm/bmm_fp8.cuh @@ -19,6 +19,8 @@ #include <cublasLt.h> #include <cuda_fp8.h> +#include <array> +#include <cstring> #include <iostream> #include <memory> #include <type_traits> @@ -137,6 +139,107 @@ } } +static constexpr int kMaxFp8Algorithms ...
103
0
8
[]
[ "SM100", "SM103" ]
[]
Optimize this cuda kernel file from flashinfer (include/flashinfer/gemm/bmm_fp8.cuh). Goal: feat: Add cuBLASLt backend for `mm_bf16` and enable multi-tactic autotuning for FP8/MXFP8 runners Target hardware: SM100, SM103 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2024 by FlashInfer team. * ...
## Summary - **Add cuBLASLt backend for `mm_bf16`**: new `backend="cublaslt"` option (gated to SM100/SM103). Autotuning across all available cuBLASLt algorithms via `get_valid_tactics()`. - **Enable multi-tactic autotuning for single-tactic GEMM runners**: `CublasFp8GemmRunner`, `CudnnFp8GemmRunner`, and `CudnnMxfp8G...
[]
null
null
flashinfer
cc682da57a11534a957f5a40b67533435e724b6c
2026-04-24T01:53:23-07:00
3,151
https://github.com/flashinfer-ai/flashinfer/pull/3151
perf: Add no-bias path for tinygemm_bf16 (#3151)
perf: Add no-bias path for tinygemm_bf16 (#3151) <!-- .github/pull_request_template.md --> ## 📌 Description <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> This PR updates tinygemm_bf16 to use a dedicated no-bias kernel path when `bias=None`, **avoiding the previous zero-bias ma...
csrc/tinygemm2.cu
cuda
Apache-2.0
/* * Copyright (c) 2025-2026, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2025-2026, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/tinygemm2.cu +++ csrc/tinygemm2.cu @@ -141,7 +141,7 @@ // ============================================================================ template <int WARP_TILE_M, int TILE_M, int TILE_N, int TILE_K, int STAGES, int STAGE_UNROLL, - bool USE_PDL = false> + bool USE_PDL = false, bool HAS_BIAS...
51
26
2
[]
[]
[]
Optimize this cuda kernel file from flashinfer (csrc/tinygemm2.cu). Goal: perf: Add no-bias path for tinygemm_bf16 Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2025-2026, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0...
<!-- .github/pull_request_template.md --> ## 📌 Description <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> This PR updates tinygemm_bf16 to use a dedicated no-bias kernel path when `bias=None`, **avoiding the previous zero-bias materialization in the Python wrapper**. It also add...
[]
null
null
flashinfer
d4544921ca2abee84077679988bfc91f69acd5e8
2026-04-24T00:26:57+08:00
3,084
https://github.com/flashinfer-ai/flashinfer/pull/3084
perf: optimize MXFP4xBF16 & INT4xFP8 CUTLASS MoE backend for SM90 (#3084)
perf: optimize MXFP4xBF16 & INT4xFP8 CUTLASS MoE backend for SM90 (#3084) ## Summary Port [TensorRT-LLM PR #12451](https://github.com/NVIDIA/TensorRT-LLM/pull/12451) to FlashInfer's `cutlass_fused_moe` SM90 path. Adds an LDSM + interleaved-LUT weight-load pipeline for 4-bit weights × 16/8-bit activations, plus the tw...
csrc/fused_moe/cutlass_backend/flashinfer_cutlass_fused_moe_binding.cu
cuda
Apache-2.0
/* * Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/fused_moe/cutlass_backend/flashinfer_cutlass_fused_moe_binding.cu +++ csrc/fused_moe/cutlass_backend/flashinfer_cutlass_fused_moe_binding.cu @@ -29,6 +29,7 @@ #include "moe_gemm_kernels.h" #include "tensorrt_llm/common/workspace.h" #include "tensorrt_llm/kernels/cutlass_kernels/fp8_blockscale_gemm/fp8_block...
45
0
7
[]
[ "H200", "SM90" ]
[ "2.66×", "3.02×", "3.11×" ]
Optimize this cuda kernel file from flashinfer (csrc/fused_moe/cutlass_backend/flashinfer_cutlass_fused_moe_binding.cu). Goal: perf: optimize MXFP4xBF16 & INT4xFP8 CUTLASS MoE backend for SM90 Target hardware: H200, SM90 Target models: unspecified Current file: ```cuda /* * Copyright (c) 2022-2024, NVIDIA CORPORATIO...
## Summary Port [TensorRT-LLM PR #12451](https://github.com/NVIDIA/TensorRT-LLM/pull/12451) to FlashInfer's `cutlass_fused_moe` SM90 path. Adds an LDSM + interleaved-LUT weight-load pipeline for 4-bit weights × 16/8-bit activations, plus the two preprocessing helpers the new kernel layout requires. ## Changes ### Ke...
[{"scope": "e2e", "hardware": "H200", "model": null, "shape": "hidden=4096,intermediate=2048,experts=256,topk=6", "batch_size": 4, "metric": "latency", "unit": "ms", "higher_is_better": false, "baseline": 0.513, "optimized": 0.193, "stated_speedup": 2.66, "speedup": 2.658}, {"scope": "e2e", "hardware": "H200", "model":...
null
3.0207
flashinfer
d4544921ca2abee84077679988bfc91f69acd5e8
2026-04-24T00:26:57+08:00
3,084
https://github.com/flashinfer-ai/flashinfer/pull/3084
perf: optimize MXFP4xBF16 & INT4xFP8 CUTLASS MoE backend for SM90 (#3084)
perf: optimize MXFP4xBF16 & INT4xFP8 CUTLASS MoE backend for SM90 (#3084) ## Summary Port [TensorRT-LLM PR #12451](https://github.com/NVIDIA/TensorRT-LLM/pull/12451) to FlashInfer's `cutlass_fused_moe` SM90 path. Adds an LDSM + interleaved-LUT weight-load pipeline for 4-bit weights × 16/8-bit activations, plus the tw...
csrc/nv_internal/tensorrt_llm/cutlass_extensions/include/cutlass_extensions/detail/collective/mixed_input_utils.hpp
cpp
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/nv_internal/tensorrt_llm/cutlass_extensions/include/cutlass_extensions/detail/collective/mixed_input_utils.hpp +++ csrc/nv_internal/tensorrt_llm/cutlass_extensions/include/cutlass_extensions/detail/collective/mixed_input_utils.hpp @@ -29,6 +29,8 @@ typedef uint32_t __nv_fp4x8_storage_t; typedef uint32_t __...
331
34
7
[]
[ "H200", "SM90" ]
[ "2.66×", "3.02×", "3.11×" ]
Optimize this cpp kernel file from flashinfer (csrc/nv_internal/tensorrt_llm/cutlass_extensions/include/cutlass_extensions/detail/collective/mixed_input_utils.hpp). Goal: perf: optimize MXFP4xBF16 & INT4xFP8 CUTLASS MoE backend for SM90 Target hardware: H200, SM90 Target models: unspecified Current file: ```cpp /* *...
## Summary Port [TensorRT-LLM PR #12451](https://github.com/NVIDIA/TensorRT-LLM/pull/12451) to FlashInfer's `cutlass_fused_moe` SM90 path. Adds an LDSM + interleaved-LUT weight-load pipeline for 4-bit weights × 16/8-bit activations, plus the two preprocessing helpers the new kernel layout requires. ## Changes ### Ke...
[{"scope": "e2e", "hardware": "H200", "model": null, "shape": "hidden=4096,intermediate=2048,experts=256,topk=6", "batch_size": 4, "metric": "latency", "unit": "ms", "higher_is_better": false, "baseline": 0.513, "optimized": 0.193, "stated_speedup": 2.66, "speedup": 2.658}, {"scope": "e2e", "hardware": "H200", "model":...
null
3.0207
flashinfer
d4544921ca2abee84077679988bfc91f69acd5e8
2026-04-24T00:26:57+08:00
3,084
https://github.com/flashinfer-ai/flashinfer/pull/3084
perf: optimize MXFP4xBF16 & INT4xFP8 CUTLASS MoE backend for SM90 (#3084)
perf: optimize MXFP4xBF16 & INT4xFP8 CUTLASS MoE backend for SM90 (#3084) ## Summary Port [TensorRT-LLM PR #12451](https://github.com/NVIDIA/TensorRT-LLM/pull/12451) to FlashInfer's `cutlass_fused_moe` SM90 path. Adds an LDSM + interleaved-LUT weight-load pipeline for 4-bit weights × 16/8-bit activations, plus the tw...
csrc/nv_internal/tensorrt_llm/cutlass_extensions/include/cutlass_extensions/gemm/collective/sm90_mma_array_tma_gmma_rs_warpspecialized_mixed_input_.hpp
cpp
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/nv_internal/tensorrt_llm/cutlass_extensions/include/cutlass_extensions/gemm/collective/sm90_mma_array_tma_gmma_rs_warpspecialized_mixed_input_.hpp +++ csrc/nv_internal/tensorrt_llm/cutlass_extensions/include/cutlass_extensions/gemm/collective/sm90_mma_array_tma_gmma_rs_warpspecialized_mixed_input_.hpp @@ -246,...
291
162
7
[]
[ "H200", "SM90" ]
[ "2.66×", "3.02×", "3.11×" ]
Optimize this cpp kernel file from flashinfer (csrc/nv_internal/tensorrt_llm/cutlass_extensions/include/cutlass_extensions/gemm/collective/sm90_mma_array_tma_gmma_rs_warpspecialized_mixed_input_.hpp). Goal: perf: optimize MXFP4xBF16 & INT4xFP8 CUTLASS MoE backend for SM90 Target hardware: H200, SM90 Target models: uns...
## Summary Port [TensorRT-LLM PR #12451](https://github.com/NVIDIA/TensorRT-LLM/pull/12451) to FlashInfer's `cutlass_fused_moe` SM90 path. Adds an LDSM + interleaved-LUT weight-load pipeline for 4-bit weights × 16/8-bit activations, plus the two preprocessing helpers the new kernel layout requires. ## Changes ### Ke...
[{"scope": "e2e", "hardware": "H200", "model": null, "shape": "hidden=4096,intermediate=2048,experts=256,topk=6", "batch_size": 4, "metric": "latency", "unit": "ms", "higher_is_better": false, "baseline": 0.513, "optimized": 0.193, "stated_speedup": 2.66, "speedup": 2.658}, {"scope": "e2e", "hardware": "H200", "model":...
null
3.0207
flashinfer
d4544921ca2abee84077679988bfc91f69acd5e8
2026-04-24T00:26:57+08:00
3,084
https://github.com/flashinfer-ai/flashinfer/pull/3084
perf: optimize MXFP4xBF16 & INT4xFP8 CUTLASS MoE backend for SM90 (#3084)
perf: optimize MXFP4xBF16 & INT4xFP8 CUTLASS MoE backend for SM90 (#3084) ## Summary Port [TensorRT-LLM PR #12451](https://github.com/NVIDIA/TensorRT-LLM/pull/12451) to FlashInfer's `cutlass_fused_moe` SM90 path. Adds an LDSM + interleaved-LUT weight-load pipeline for 4-bit weights × 16/8-bit activations, plus the tw...
csrc/nv_internal/tensorrt_llm/kernels/cutlass_kernels/cutlass_heuristic.cpp
cpp
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/nv_internal/tensorrt_llm/kernels/cutlass_kernels/cutlass_heuristic.cpp +++ csrc/nv_internal/tensorrt_llm/kernels/cutlass_kernels/cutlass_heuristic.cpp @@ -389,9 +389,16 @@ (config & CutlassGemmConfig::WEIGHT_ONLY) && (config & CutlassGemmConfig::GROUPED_GEMM); if (has_w4afp8) { bool const ...
8
1
7
[]
[ "H200", "SM90" ]
[ "2.66×", "3.02×", "3.11×" ]
Optimize this cpp kernel file from flashinfer (csrc/nv_internal/tensorrt_llm/kernels/cutlass_kernels/cutlass_heuristic.cpp). Goal: perf: optimize MXFP4xBF16 & INT4xFP8 CUTLASS MoE backend for SM90 Target hardware: H200, SM90 Target models: unspecified Current file: ```cpp /* * Copyright (c) 2020-2023, NVIDIA CORPORA...
## Summary Port [TensorRT-LLM PR #12451](https://github.com/NVIDIA/TensorRT-LLM/pull/12451) to FlashInfer's `cutlass_fused_moe` SM90 path. Adds an LDSM + interleaved-LUT weight-load pipeline for 4-bit weights × 16/8-bit activations, plus the two preprocessing helpers the new kernel layout requires. ## Changes ### Ke...
[{"scope": "e2e", "hardware": "H200", "model": null, "shape": "hidden=4096,intermediate=2048,experts=256,topk=6", "batch_size": 4, "metric": "latency", "unit": "ms", "higher_is_better": false, "baseline": 0.513, "optimized": 0.193, "stated_speedup": 2.66, "speedup": 2.658}, {"scope": "e2e", "hardware": "H200", "model":...
null
3.0207
flashinfer
57c37bf2c4fcebd6f1a70cc6f62a68e20b530d60
2026-04-14T07:20:41+03:00
2,882
https://github.com/flashinfer-ai/flashinfer/pull/2882
perf: Fix silent bug with FP8 per tensor non-gated MoE (#2882)
perf: Fix silent bug with FP8 per tensor non-gated MoE (#2882) <!-- .github/pull_request_template.md --> ## 📌 Description This PR fixed a **silent bug** that forces fallback tactic with _TRTLLM MoE FP8 and non-gated models_ (Nemotron). ``` [Autotuner]: Failed to get valid tactics for ... Error occurred: FP8 per-ten...
csrc/trtllm_fused_moe_kernel_launcher.cu
cuda
Apache-2.0
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribut...
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribut...
--- csrc/trtllm_fused_moe_kernel_launcher.cu +++ csrc/trtllm_fused_moe_kernel_launcher.cu @@ -2268,12 +2268,6 @@ } else if ((quantization_type == Fp8QuantizationType::PerTensorFp8 || quantization_type == Fp8QuantizationType::NoneFp8) && dtype_weights == btg::Dtype::E4m3) { - // FP8 pe...
0
6
1
[ "deepseek", "nemotron" ]
[ "GB200" ]
[]
Optimize this cuda kernel file from flashinfer (csrc/trtllm_fused_moe_kernel_launcher.cu). Goal: perf: Fix silent bug with FP8 per tensor non-gated MoE Target hardware: GB200 Target models: deepseek, nemotron Current file: ```cuda /* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not us...
<!-- .github/pull_request_template.md --> ## 📌 Description This PR fixed a **silent bug** that forces fallback tactic with _TRTLLM MoE FP8 and non-gated models_ (Nemotron). ``` [Autotuner]: Failed to get valid tactics for ... Error occurred: FP8 per-tensor currently supports gated activations only, got act_type=6 ``...
[]
null
null
flashinfer
c0adda7d866084326d8e4d81e173767a76634d85
2026-04-10T08:46:31-07:00
3,026
https://github.com/flashinfer-ai/flashinfer/pull/3026
perf: Port TRT-LLM SM120/SM121 FP4 CUTLASS GEMM optimizations. Add PDL (#3026)
perf: Port TRT-LLM SM120/SM121 FP4 CUTLASS GEMM optimizations. Add PDL (#3026) <!-- .github/pull_request_template.md --> ## 📌 Description <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ### Summary - Port TRT-LLM's SM120 CUTLASS FP4 GEMM template parameters for better kernel pe...
include/flashinfer/gemm/fp4_gemm_template_sm120.h
cpp
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- include/flashinfer/gemm/fp4_gemm_template_sm120.h +++ include/flashinfer/gemm/fp4_gemm_template_sm120.h @@ -185,8 +185,8 @@ std::string(cutlass::cutlassGetStatusString(initStatus))); } - // Disable PDL since GDC flag is not set - auto runStatus = gemm.run(args, workspace, stream...
23
23
1
[]
[ "RTX5090", "SM100", "SM120", "SM121" ]
[ "1.38x", "1.24x", "1.18x", "1.05x", "1.39x", "1.08x", "1.42x", "1.01x", "1.43x", "1.13x" ]
Optimize this cpp kernel file from flashinfer (include/flashinfer/gemm/fp4_gemm_template_sm120.h). Goal: perf: Port TRT-LLM SM120/SM121 FP4 CUTLASS GEMM optimizations. Add PDL Target hardware: RTX5090, SM100, SM120, SM121 Target models: unspecified Current file: ```cpp /* * Copyright (c) 2020-2023, NVIDIA CORPORATIO...
<!-- .github/pull_request_template.md --> ## 📌 Description <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ### Summary - Port TRT-LLM's SM120 CUTLASS FP4 GEMM template parameters for better kernel performance - [TRT-LLM reference file: nvfp4_nvfp4_gemm_template_sm120.h](https:...
[]
null
null
flashinfer
ee3ca012e6be1a3361b23e218b649c74a6ee3b98
2026-04-04T01:39:31+02:00
2,927
https://github.com/flashinfer-ai/flashinfer/pull/2927
feat: SM121 (GB10) tile filtering and autotuner robustness (#2927)
feat: SM121 (GB10) tile filtering and autotuner robustness (#2927) ## Summary - **Unified SMEM tile filter** — extracted `tile_fits_smem(sm, m, n, k_elem, config, stages=2)` helper that encodes the per-architecture SMEM limit (102,400 B for SM 8.6/8.9/12.x, per CUDA Programming Guide) and is shared by both the SM12x ...
csrc/nv_internal/tensorrt_llm/kernels/cutlass_kernels/cutlass_heuristic.cpp
cpp
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/nv_internal/tensorrt_llm/kernels/cutlass_kernels/cutlass_heuristic.cpp +++ csrc/nv_internal/tensorrt_llm/kernels/cutlass_kernels/cutlass_heuristic.cpp @@ -61,6 +61,7 @@ case CutlassTileConfig::CtaShape64x128x64_WarpShape64x32x64: return TileShape{64, 128}; case CutlassTileConfig::CtaShape128x6...
21
43
3
[ "mamba", "nemotron" ]
[ "AMPERE", "BLACKWELL", "GB200", "SM100", "SM12", "SM120", "SM121" ]
[ "2×" ]
Optimize this cpp kernel file from flashinfer (csrc/nv_internal/tensorrt_llm/kernels/cutlass_kernels/cutlass_heuristic.cpp). Goal: feat: SM121 (GB10) tile filtering and autotuner robustness Target hardware: AMPERE, BLACKWELL, GB200, SM100, SM12, SM120, SM121 Target models: mamba, nemotron Current file: ```cpp /* * C...
## Summary - **Unified SMEM tile filter** — extracted `tile_fits_smem(sm, m, n, k_elem, config, stages=2)` helper that encodes the per-architecture SMEM limit (102,400 B for SM 8.6/8.9/12.x, per CUDA Programming Guide) and is shared by both the SM12x TMA WS path and the Ampere mainloop path. - **SM12x FP4 tile filteri...
[]
null
null
flashinfer
5758837a8594c15aaae14e4e638fa4e634632c53
2026-04-04T07:00:26+08:00
2,956
https://github.com/flashinfer-ai/flashinfer/pull/2956
fix: [Fmha] revert blackwell ultra optimization that causes deadlocks. (#2956)
fix: [Fmha] revert blackwell ultra optimization that causes deadlocks. (#2956) <!-- .github/pull_request_template.md --> ## 📌 Description <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Th...
include/flashinfer/trtllm/fmha/kernelParams.h
cpp
BSD
/*************************************************************************************************** * Copyright (c) 2011-2024, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are not permit- * ted. * * THIS SOFTWARE IS PROVIDED BY THE...
/*************************************************************************************************** * Copyright (c) 2011-2024, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are not permit- * ted. * * THIS SOFTWARE IS PROVIDED BY THE...
--- include/flashinfer/trtllm/fmha/kernelParams.h +++ include/flashinfer/trtllm/fmha/kernelParams.h @@ -416,7 +416,8 @@ // strides are read from the tensor and passed to the TMA descriptor. template <class FmhaOptions> static auto makeTmaShapeStrideKv(FmhaOptions const& options, KernelParams const& params,...
63
31
2
[]
[ "BLACKWELL" ]
[]
Optimize this cpp kernel file from flashinfer (include/flashinfer/trtllm/fmha/kernelParams.h). Goal: fix: [Fmha] revert blackwell ultra optimization that causes deadlocks. Target hardware: BLACKWELL Target models: unspecified Current file: ```cpp /**********************************************************************...
<!-- .github/pull_request_template.md --> ## 📌 Description <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, plea...
[]
null
null
flashinfer
d476c61c3f8bcbbca30755b330a0c10b141dede3
2026-04-01T12:08:51-07:00
2,904
https://github.com/flashinfer-ai/flashinfer/pull/2904
perf: Optimize CuTe-DSL fp4 and fp8 quantization kernels (#2904)
perf: Optimize CuTe-DSL fp4 and fp8 quantization kernels (#2904) <!-- .github/pull_request_template.md --> ## 📌 Description **Summary** - Adopt dual-path kernel architecture (linear flat + swizzled row-based) for MXFP4 and NVFP4 CuTe-DSL quantization kernels. - Architecture chanes to MXFP8 quantization for better p...
flashinfer/cute_dsl/fp4_common.py
cute_dsl
Apache-2.0
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
--- flashinfer/cute_dsl/fp4_common.py +++ flashinfer/cute_dsl/fp4_common.py @@ -190,6 +190,23 @@ ], "st.global.u64 [$0], $1;", "l,l", + has_side_effects=True, + is_align_stack=False, + asm_dialect=llvm.AsmDialect.AD_ATT, + ) + + +@dsl_user_op +def st_global_u32(base_pt...
17
0
6
[]
[ "B200" ]
[ "5x", "1.42x", "1.37x", "1.41x", "1.39x", "1.34x", "1.32x" ]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/cute_dsl/fp4_common.py). Goal: perf: Optimize CuTe-DSL fp4 and fp8 quantization kernels Target hardware: B200 Target models: unspecified Current file: ```python """ Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (th...
<!-- .github/pull_request_template.md --> ## 📌 Description **Summary** - Adopt dual-path kernel architecture (linear flat + swizzled row-based) for MXFP4 and NVFP4 CuTe-DSL quantization kernels. - Architecture chanes to MXFP8 quantization for better perf. - Expand benchmark scripts and test coverage across all three...
[{"scope": "kernel", "hardware": "B200", "model": null, "shape": "Linear", "batch_size": null, "metric": "performance", "unit": null, "higher_is_better": true, "baseline": null, "optimized": null, "stated_speedup": 1.42, "speedup": 1.42}, {"scope": "kernel", "hardware": "B200", "model": null, "shape": "Swizzled", "batc...
1.38
null
flashinfer
d476c61c3f8bcbbca30755b330a0c10b141dede3
2026-04-01T12:08:51-07:00
2,904
https://github.com/flashinfer-ai/flashinfer/pull/2904
perf: Optimize CuTe-DSL fp4 and fp8 quantization kernels (#2904)
perf: Optimize CuTe-DSL fp4 and fp8 quantization kernels (#2904) <!-- .github/pull_request_template.md --> ## 📌 Description **Summary** - Adopt dual-path kernel architecture (linear flat + swizzled row-based) for MXFP4 and NVFP4 CuTe-DSL quantization kernels. - Architecture chanes to MXFP8 quantization for better p...
flashinfer/quantization/kernels/mxfp8_quantize.py
cute_dsl
Apache-2.0
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
--- flashinfer/quantization/kernels/mxfp8_quantize.py +++ flashinfer/quantization/kernels/mxfp8_quantize.py @@ -50,17 +50,24 @@ ELTS_PER_THREAD, THREADS_PER_SF, SF_BLOCKS_PER_WARP, + ELTS_PER_THREAD_SMALL, + THREADS_PER_SF_SMALL, + SF_BLOCKS_PER_WARP_SMALL, + MXFP8_2T_SF_THRESHOLD, ROW_T...
311
130
6
[]
[ "B200" ]
[ "5x", "1.42x", "1.37x", "1.41x", "1.39x", "1.34x", "1.32x" ]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/quantization/kernels/mxfp8_quantize.py). Goal: perf: Optimize CuTe-DSL fp4 and fp8 quantization kernels Target hardware: B200 Target models: unspecified Current file: ```python """ Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License,...
<!-- .github/pull_request_template.md --> ## 📌 Description **Summary** - Adopt dual-path kernel architecture (linear flat + swizzled row-based) for MXFP4 and NVFP4 CuTe-DSL quantization kernels. - Architecture chanes to MXFP8 quantization for better perf. - Expand benchmark scripts and test coverage across all three...
[{"scope": "kernel", "hardware": "B200", "model": null, "shape": "Linear", "batch_size": null, "metric": "performance", "unit": null, "higher_is_better": true, "baseline": null, "optimized": null, "stated_speedup": 1.42, "speedup": 1.42}, {"scope": "kernel", "hardware": "B200", "model": null, "shape": "Swizzled", "batc...
1.38
null
flashinfer
d476c61c3f8bcbbca30755b330a0c10b141dede3
2026-04-01T12:08:51-07:00
2,904
https://github.com/flashinfer-ai/flashinfer/pull/2904
perf: Optimize CuTe-DSL fp4 and fp8 quantization kernels (#2904)
perf: Optimize CuTe-DSL fp4 and fp8 quantization kernels (#2904) <!-- .github/pull_request_template.md --> ## 📌 Description **Summary** - Adopt dual-path kernel architecture (linear flat + swizzled row-based) for MXFP4 and NVFP4 CuTe-DSL quantization kernels. - Architecture chanes to MXFP8 quantization for better p...
flashinfer/quantization/kernels/nvfp4_quantize.py
cute_dsl
Apache-2.0
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
--- flashinfer/quantization/kernels/nvfp4_quantize.py +++ flashinfer/quantization/kernels/nvfp4_quantize.py @@ -19,10 +19,15 @@ NVFP4 quantization kernel using CuTe-DSL. Supports multiple scale factor layouts: swizzled 128x4, swizzled 8x4, and linear. +Dual-path optimization following the MXFP4 pattern: +- Linear l...
417
221
6
[]
[ "B200" ]
[ "5x", "1.42x", "1.37x", "1.41x", "1.39x", "1.34x", "1.32x" ]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/quantization/kernels/nvfp4_quantize.py). Goal: perf: Optimize CuTe-DSL fp4 and fp8 quantization kernels Target hardware: B200 Target models: unspecified Current file: ```python """ Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License,...
<!-- .github/pull_request_template.md --> ## 📌 Description **Summary** - Adopt dual-path kernel architecture (linear flat + swizzled row-based) for MXFP4 and NVFP4 CuTe-DSL quantization kernels. - Architecture chanes to MXFP8 quantization for better perf. - Expand benchmark scripts and test coverage across all three...
[{"scope": "kernel", "hardware": "B200", "model": null, "shape": "Linear", "batch_size": null, "metric": "performance", "unit": null, "higher_is_better": true, "baseline": null, "optimized": null, "stated_speedup": 1.42, "speedup": 1.42}, {"scope": "kernel", "hardware": "B200", "model": null, "shape": "Swizzled", "batc...
1.38
null
flashinfer
d476c61c3f8bcbbca30755b330a0c10b141dede3
2026-04-01T12:08:51-07:00
2,904
https://github.com/flashinfer-ai/flashinfer/pull/2904
perf: Optimize CuTe-DSL fp4 and fp8 quantization kernels (#2904)
perf: Optimize CuTe-DSL fp4 and fp8 quantization kernels (#2904) <!-- .github/pull_request_template.md --> ## 📌 Description **Summary** - Adopt dual-path kernel architecture (linear flat + swizzled row-based) for MXFP4 and NVFP4 CuTe-DSL quantization kernels. - Architecture chanes to MXFP8 quantization for better p...
flashinfer/quantization/quantization_cute_dsl_utils.py
cute_dsl
Apache-2.0
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
--- flashinfer/quantization/quantization_cute_dsl_utils.py +++ flashinfer/quantization/quantization_cute_dsl_utils.py @@ -39,9 +39,19 @@ # Thread organization constants WARP_SIZE = 32 -ELTS_PER_THREAD = 8 # Each thread handles 8 FP16 elements (128 bits) -THREADS_PER_SF = SF_VEC_SIZE // ELTS_PER_THREAD # 32 / 8 = ...
43
13
6
[]
[ "B200" ]
[ "5x", "1.42x", "1.37x", "1.41x", "1.39x", "1.34x", "1.32x" ]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/quantization/quantization_cute_dsl_utils.py). Goal: perf: Optimize CuTe-DSL fp4 and fp8 quantization kernels Target hardware: B200 Target models: unspecified Current file: ```python """ Copyright (c) 2025 by FlashInfer team. Licensed under the Apache Lic...
<!-- .github/pull_request_template.md --> ## 📌 Description **Summary** - Adopt dual-path kernel architecture (linear flat + swizzled row-based) for MXFP4 and NVFP4 CuTe-DSL quantization kernels. - Architecture chanes to MXFP8 quantization for better perf. - Expand benchmark scripts and test coverage across all three...
[{"scope": "kernel", "hardware": "B200", "model": null, "shape": "Linear", "batch_size": null, "metric": "performance", "unit": null, "higher_is_better": true, "baseline": null, "optimized": null, "stated_speedup": 1.42, "speedup": 1.42}, {"scope": "kernel", "hardware": "B200", "model": null, "shape": "Swizzled", "batc...
1.38
null
flashinfer
e679e45383d2621681a06c39670448be59a817c9
2026-03-20T21:38:48+02:00
2,821
https://github.com/flashinfer-ai/flashinfer/pull/2821
fix: Autotuner _find_nearest_profile non-power-of-2 num_tokens, create launchers for all supported tileN in trtllm fused MoE (#2821)
fix: Autotuner _find_nearest_profile non-power-of-2 num_tokens, create launchers for all supported tileN in trtllm fused MoE (#2821) ## 📌 Description It fixes two autotuner related bugs: 1. Revert back the autotuner fix that was reverted in https://github.com/flashinfer-ai/flashinfer/pull/2697 2. Fix the issue that ...
csrc/trtllm_fused_moe_kernel_launcher.cu
cuda
Apache-2.0
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribut...
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribut...
--- csrc/trtllm_fused_moe_kernel_launcher.cu +++ csrc/trtllm_fused_moe_kernel_launcher.cu @@ -91,12 +91,26 @@ std::set<int32_t> computeSelectedTileN(std::vector<int32_t> const& supported_tile_nums, int64_t const num_tokens, int64_t const top_k, ...
88
63
2
[ "nemotron" ]
[ "SM100" ]
[]
Optimize this cuda kernel file from flashinfer (csrc/trtllm_fused_moe_kernel_launcher.cu). Goal: fix: Autotuner _find_nearest_profile non-power-of-2 num_tokens, create launchers for all supported tileN in trtllm fused MoE Target hardware: SM100 Target models: nemotron Current file: ```cuda /* * Licensed under the Ap...
## 📌 Description It fixes two autotuner related bugs: 1. Revert back the autotuner fix that was reverted in https://github.com/flashinfer-ai/flashinfer/pull/2697 2. Fix the issue that https://github.com/flashinfer-ai/flashinfer/pull/2697 revealed, which is trtllm fused MoE kernel launcher crash when it receives tileN...
[]
null
null
flashinfer
f7322d91610cf20b30f1c60422fb038dcc3858d5
2026-03-17T15:08:21-07:00
2,777
https://github.com/flashinfer-ai/flashinfer/pull/2777
perf: Performance tune cute dsl RMSNorm variants (#2777)
perf: Performance tune cute dsl RMSNorm variants (#2777) <!-- .github/pull_request_template.md --> ## 📌 Description <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> Rewrites all CuTe-DSL RMSNorm kernel variants (`rmsnorm`, `gemma_rmsnorm`, `fused_add_rmsnorm`, `gemma_fused_add_rm...
flashinfer/norm/utils.py
cute_dsl
Apache-2.0
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
--- flashinfer/norm/utils.py +++ flashinfer/norm/utils.py @@ -25,6 +25,7 @@ - Type conversion utilities """ +import functools import math import operator from typing import Callable @@ -183,6 +184,124 @@ ) +@dsl_user_op +def cvt_and_store_8xf32_to_e4m3_hw( + v0: Float32, + v1: Float32, + v2: Fl...
323
0
3
[ "gemma" ]
[ "B200", "H200", "SM90" ]
[]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/norm/utils.py). Goal: perf: Performance tune cute dsl RMSNorm variants Target hardware: B200, H200, SM90 Target models: gemma Current file: ```python """ Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"...
<!-- .github/pull_request_template.md --> ## 📌 Description <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> Rewrites all CuTe-DSL RMSNorm kernel variants (`rmsnorm`, `gemma_rmsnorm`, `fused_add_rmsnorm`, `gemma_fused_add_rmsnorm`, `rmsnorm_quant`, `fused_add_rmsnorm_quant`, `qk_rm...
[]
null
null
flashinfer
4f422f5b4783d73041d9dda8fecc6a17c9d21603
2026-03-03T11:18:05+02:00
2,667
https://github.com/flashinfer-ai/flashinfer/pull/2667
perf: Update trtllm-gen batched GEMM kernels - faster, more NVFP4 tile dims, MXFP8 with relu2 act (#2667)
perf: Update trtllm-gen batched GEMM kernels - faster, more NVFP4 tile dims, MXFP8 with relu2 act (#2667) ## 📌 Description Updates the trtllm-gen batched GEMM kernel hashes and `include/flashinfer/trtllm/batched_gemm/trtllmGen_bmm_export` directory for: * Faster batched GEMM kernels * Additional NVFP4 tile dims kern...
csrc/trtllm_batched_gemm_runner.cu
cuda
Apache-2.0
/* * Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/trtllm_batched_gemm_runner.cu +++ csrc/trtllm_batched_gemm_runner.cu @@ -258,8 +258,9 @@ // FIXME once we start using all-reduce in the epilogue of the bmm this can be moved elsewhere bmm.runInitBeforeWorldSync(config, gemmData, static_cast<void*>(stream)); - auto const err = bmm.run(config, workspace...
3
2
2
[]
[]
[]
Optimize this cuda kernel file from flashinfer (csrc/trtllm_batched_gemm_runner.cu). Goal: perf: Update trtllm-gen batched GEMM kernels - faster, more NVFP4 tile dims, MXFP8 with relu2 act Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2020-2025, NVIDIA CORPORATION. ...
## 📌 Description Updates the trtllm-gen batched GEMM kernel hashes and `include/flashinfer/trtllm/batched_gemm/trtllmGen_bmm_export` directory for: * Faster batched GEMM kernels * Additional NVFP4 tile dims kernels * Additional MXFP8 with Relu^2 non-gated activation kernels ## 🔍 Related Issues <!-- Link any relate...
[]
null
null
flashinfer
1589ebb405b437dab5a3b0ca3b77097da0959071
2026-02-26T11:08:00-08:00
2,588
https://github.com/flashinfer-ai/flashinfer/pull/2588
Perf: Optimize GDN decode pretranspose kernel for all batch sizes (#2588)
Perf: Optimize GDN decode pretranspose kernel for all batch sizes (#2588) Two optimizations: 1. Early gate reads: Move gate GMEM reads (r_A_log, r_a, r_dt_bias, r_b) to immediately before the barrier, hiding memory latency during sync. 2. Always use 8-CTA architecture: Remove batch size conditional that switched to ...
flashinfer/gdn_decode.py
cute_dsl
Apache-2.0
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
--- flashinfer/gdn_decode.py +++ flashinfer/gdn_decode.py @@ -186,47 +186,48 @@ i_h = i_hv // (HV // H) i_t = 0 + smem = cutlass.utils.SmemAllocator() + + # =================================================================== + # Allocate shared memory (using passed-in layout) + # ===============...
40
42
1
[]
[]
[]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/gdn_decode.py). Goal: Perf: Optimize GDN decode pretranspose kernel for all batch sizes Target hardware: unspecified Target models: unspecified Current file: ```python """ Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version ...
Two optimizations: 1. Early gate reads: Move gate GMEM reads (r_A_log, r_a, r_dt_bias, r_b) to immediately before the barrier, hiding memory latency during sync. 2. Always use 8-CTA architecture: Remove batch size conditional that switched to big_batch (1 CTA) for B > 32. The 8-CTA small_batch kernel performs better ...
[{"scope": "kernel", "hardware": null, "model": null, "shape": "q_heads=16,k_heads=16,v_heads=32,head_size=128", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 3.74, "optimized": 3.74, "stated_speedup": null, "speedup": 1.0}, {"scope": "kernel", "hardware": null, "model": nul...
1.0019
null
flashinfer
58128d1218979256e7fd487473758dd906f6f853
2026-02-24T01:30:22+09:00
2,609
https://github.com/flashinfer-ai/flashinfer/pull/2609
docs: resolve TODO by documenting log2f vs logf performance rationale in sampling (#2609)
docs: resolve TODO by documenting log2f vs logf performance rationale in sampling (#2609) ## Summary Resolved the TODO comment in `sampling.cuh` regarding `log2f` vs `logf` performance comparison. ## Changes - Removed `// TODO: compare the speed of log2 and log` - Added documentation explaining why `log2f` is preferr...
include/flashinfer/sampling.cuh
cuda
Apache-2.0
/* * Copyright (c) 2024 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
/* * Copyright (c) 2024 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
--- include/flashinfer/sampling.cuh +++ include/flashinfer/sampling.cuh @@ -664,9 +664,11 @@ // and including 1.0. kSCALE is used to exclude 1.0, s.t. // 1.18e-38 <= x * kSCALE <= 1.0f - epsilon // => -4.47 <= -log(-log(...)) <= 15.9 + // log2f maps to a single PTX LG2 instru...
3
1
1
[]
[]
[]
Optimize this cuda kernel file from flashinfer (include/flashinfer/sampling.cuh). Goal: docs: resolve TODO by documenting log2f vs logf performance rationale in sampling Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2024 by FlashInfer team. * * Licensed under the ...
## Summary Resolved the TODO comment in `sampling.cuh` regarding `log2f` vs `logf` performance comparison. ## Changes - Removed `// TODO: compare the speed of log2 and log` - Added documentation explaining why `log2f` is preferred: - `log2f` maps to a single PTX `LG2` instruction on NVIDIA GPUs - `logf` internally...
[]
null
null
flashinfer
30bf78e1a05d18aaebd484aa6f3c1db8e4c0b1b4
2026-02-10T06:38:50+08:00
2,509
https://github.com/flashinfer-ai/flashinfer/pull/2509
perf: cache cudaGetDeviceProperties in gdn_prefill to avoid per-call overhead (#2509)
perf: cache cudaGetDeviceProperties in gdn_prefill to avoid per-call overhead (#2509) ## Summary - Cache `device_properties.major` and `device_properties.multiProcessorCount` using `static thread_local` variables in `gdn_prefill_launcher()` and `gdn_prefill()` respectively, instead of calling `cudaGetDeviceProperties`...
csrc/gdn_prefill_launcher.cu
cuda
Apache-2.0
/* * Copyright (c) 2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
/* * Copyright (c) 2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
--- csrc/gdn_prefill_launcher.cu +++ csrc/gdn_prefill_launcher.cu @@ -42,11 +42,11 @@ DISPATCH_DLPACK_DTYPE_TO_CTYPE_FP16(dtype, DType, [&] { int dev_id; cudaGetDevice(&dev_id); - cudaDeviceProp device_properties; - cudaGetDeviceProperties(&device_properties, dev_id); + int device_major; + cuda...
7
8
1
[]
[ "CPU" ]
[]
Optimize this cuda kernel file from flashinfer (csrc/gdn_prefill_launcher.cu). Goal: perf: cache cudaGetDeviceProperties in gdn_prefill to avoid per-call overhead Target hardware: CPU Target models: unspecified Current file: ```cuda /* * Copyright (c) 2025 by FlashInfer team. * * Licensed under the Apache License,...
## Summary - Cache `device_properties.major` and `device_properties.multiProcessorCount` using `static thread_local` variables in `gdn_prefill_launcher()` and `gdn_prefill()` respectively, instead of calling `cudaGetDeviceProperties` on every invocation. - Each `cudaGetDeviceProperties` call adds ~1ms of synchronou...
[]
null
null
flashinfer
99562e5eeaa26b08ba5e514bfe22d84404390ca6
2026-02-06T16:01:50-08:00
2,398
https://github.com/flashinfer-ai/flashinfer/pull/2398
feat: cuteDSL fp4 moe for better DSR1 performance. (#2398)
feat: cuteDSL fp4 moe for better DSR1 performance. (#2398) <!-- .github/pull_request_template.md --> ## 📌 Description cuteDSL fp4 moe from TRTLLM with fusion. issue #2259 The collective fusion performance improvement collected from TRTLLM [PR 8880](https://github.com/NVIDIA/TensorRT-LLM/pull/8880), [PR 9288](https:...
flashinfer/cute_dsl/utils.py
cute_dsl
Apache-2.0
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
--- flashinfer/cute_dsl/utils.py +++ flashinfer/cute_dsl/utils.py @@ -17,13 +17,18 @@ import ctypes import functools import importlib.util -from typing import Union +from typing import Union, Tuple import cutlass import cutlass._mlir.dialects.cute as _cute_ir import torch from cutlass._mlir import ir from cut...
174
1
6
[ "deepseek" ]
[ "BLACKWELL" ]
[ "1.53x", "0.83x", "1.40x", "0.83x", "1.35x", "0.88x", "1.36x", "0.94x", "1.35x", "1.02x" ]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/cute_dsl/utils.py). Goal: feat: cuteDSL fp4 moe for better DSR1 performance. Target hardware: BLACKWELL Target models: deepseek Current file: ```python """ Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "Licens...
<!-- .github/pull_request_template.md --> ## 📌 Description cuteDSL fp4 moe from TRTLLM with fusion. issue #2259 The collective fusion performance improvement collected from TRTLLM [PR 8880](https://github.com/NVIDIA/TensorRT-LLM/pull/8880), [PR 9288](https://github.com/NVIDIA/TensorRT-LLM/pull/9288), [PR 9618](htt...
[{"scope": "kernel", "hardware": null, "model": "DeepSeek-V3", "shape": null, "batch_size": 1, "metric": "latency", "unit": "ms", "higher_is_better": false, "baseline": 0.098, "optimized": 0.064, "stated_speedup": 1.53, "speedup": 1.5312}, {"scope": "kernel", "hardware": null, "model": "DeepSeek-V3", "shape": null, "ba...
1.245
null
flashinfer
99562e5eeaa26b08ba5e514bfe22d84404390ca6
2026-02-06T16:01:50-08:00
2,398
https://github.com/flashinfer-ai/flashinfer/pull/2398
feat: cuteDSL fp4 moe for better DSR1 performance. (#2398)
feat: cuteDSL fp4 moe for better DSR1 performance. (#2398) <!-- .github/pull_request_template.md --> ## 📌 Description cuteDSL fp4 moe from TRTLLM with fusion. issue #2259 The collective fusion performance improvement collected from TRTLLM [PR 8880](https://github.com/NVIDIA/TensorRT-LLM/pull/8880), [PR 9288](https:...
flashinfer/gemm/kernels/grouped_gemm_masked_blackwell.py
cute_dsl
BSD-3-Clause
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the abov...
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the abov...
--- flashinfer/gemm/kernels/grouped_gemm_masked_blackwell.py +++ flashinfer/gemm/kernels/grouped_gemm_masked_blackwell.py @@ -61,6 +61,7 @@ get_cutlass_dtype, cutlass_to_torch_dtype, get_num_sm, + get_max_active_clusters, make_ptr, ) from typing import Callable, List @@ -2621,10 +2622,9 @@ ...
3
3
6
[ "deepseek" ]
[ "BLACKWELL" ]
[ "1.53x", "0.83x", "1.40x", "0.83x", "1.35x", "0.88x", "1.36x", "0.94x", "1.35x", "1.02x" ]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/gemm/kernels/grouped_gemm_masked_blackwell.py). Goal: feat: cuteDSL fp4 moe for better DSR1 performance. Target hardware: BLACKWELL Target models: deepseek Current file: ```python # Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. ...
<!-- .github/pull_request_template.md --> ## 📌 Description cuteDSL fp4 moe from TRTLLM with fusion. issue #2259 The collective fusion performance improvement collected from TRTLLM [PR 8880](https://github.com/NVIDIA/TensorRT-LLM/pull/8880), [PR 9288](https://github.com/NVIDIA/TensorRT-LLM/pull/9288), [PR 9618](htt...
[{"scope": "kernel", "hardware": null, "model": "DeepSeek-V3", "shape": null, "batch_size": 1, "metric": "latency", "unit": "ms", "higher_is_better": false, "baseline": 0.098, "optimized": 0.064, "stated_speedup": 1.53, "speedup": 1.5312}, {"scope": "kernel", "hardware": null, "model": "DeepSeek-V3", "shape": null, "ba...
1.245
null
flashinfer
57ef44b9d7ada00cb50ca26310f9c3a3bfbc0dd2
2026-02-06T14:55:45+08:00
2,460
https://github.com/flashinfer-ai/flashinfer/pull/2460
perf: add fp4 GEMM tile configs and streamK scheduler for SM120 (#2460)
perf: add fp4 GEMM tile configs and streamK scheduler for SM120 (#2460) <!-- .github/pull_request_template.md --> ## 📌 Description Add SM120 FP4 GEMM tile configs and enable streamK scheduler for configs that can be selected by autotuner. Take the problem size m=32, n=5120, k=25600 as an example. After adding these...
include/flashinfer/gemm/cutlass_gemm_configs.h
cpp
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- include/flashinfer/gemm/cutlass_gemm_configs.h +++ include/flashinfer/gemm/cutlass_gemm_configs.h @@ -348,6 +348,7 @@ bool enableCudaKernel = false; int sm_version = 80; // Use 80 as a catch all for <90 bool is_tma_warp_specialized = false; + bool use_stream_k = false; // SM120: false = DP scheduler (de...
10
2
4
[]
[ "SM120" ]
[]
Optimize this cpp kernel file from flashinfer (include/flashinfer/gemm/cutlass_gemm_configs.h). Goal: perf: add fp4 GEMM tile configs and streamK scheduler for SM120 Target hardware: SM120 Target models: unspecified Current file: ```cpp /* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Li...
<!-- .github/pull_request_template.md --> ## 📌 Description Add SM120 FP4 GEMM tile configs and enable streamK scheduler for configs that can be selected by autotuner. Take the problem size m=32, n=5120, k=25600 as an example. After adding these configs, the latency of mm_fp4 kernel reduced from 0.124ms to 0.069ms on...
[{"scope": "kernel", "hardware": "RTX PRO 6000", "model": null, "shape": "m=32,n=5120,k=25600", "batch_size": null, "metric": "latency", "unit": "ms", "higher_is_better": false, "baseline": 0.124, "optimized": 0.069, "stated_speedup": null, "speedup": 1.7971}, {"scope": "kernel", "hardware": "RTX PRO 6000", "model": nu...
1.7993
null
flashinfer
57ef44b9d7ada00cb50ca26310f9c3a3bfbc0dd2
2026-02-06T14:55:45+08:00
2,460
https://github.com/flashinfer-ai/flashinfer/pull/2460
perf: add fp4 GEMM tile configs and streamK scheduler for SM120 (#2460)
perf: add fp4 GEMM tile configs and streamK scheduler for SM120 (#2460) <!-- .github/pull_request_template.md --> ## 📌 Description Add SM120 FP4 GEMM tile configs and enable streamK scheduler for configs that can be selected by autotuner. Take the problem size m=32, n=5120, k=25600 as an example. After adding these...
include/flashinfer/gemm/fp4_gemm_cutlass_template_sm120.h
cpp
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- include/flashinfer/gemm/fp4_gemm_cutlass_template_sm120.h +++ include/flashinfer/gemm/fp4_gemm_cutlass_template_sm120.h @@ -44,7 +44,8 @@ namespace gemm { using namespace cute; -template <typename T, typename CTA_M_, typename CTA_N_, typename CTA_K_> +// UseStreamK: false = DP scheduler (default), true = Stream...
61
28
4
[]
[ "SM120" ]
[]
Optimize this cpp kernel file from flashinfer (include/flashinfer/gemm/fp4_gemm_cutlass_template_sm120.h). Goal: perf: add fp4 GEMM tile configs and streamK scheduler for SM120 Target hardware: SM120 Target models: unspecified Current file: ```cpp /* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserve...
<!-- .github/pull_request_template.md --> ## 📌 Description Add SM120 FP4 GEMM tile configs and enable streamK scheduler for configs that can be selected by autotuner. Take the problem size m=32, n=5120, k=25600 as an example. After adding these configs, the latency of mm_fp4 kernel reduced from 0.124ms to 0.069ms on...
[{"scope": "kernel", "hardware": "RTX PRO 6000", "model": null, "shape": "m=32,n=5120,k=25600", "batch_size": null, "metric": "latency", "unit": "ms", "higher_is_better": false, "baseline": 0.124, "optimized": 0.069, "stated_speedup": null, "speedup": 1.7971}, {"scope": "kernel", "hardware": "RTX PRO 6000", "model": nu...
1.7993
null
flashinfer
57ef44b9d7ada00cb50ca26310f9c3a3bfbc0dd2
2026-02-06T14:55:45+08:00
2,460
https://github.com/flashinfer-ai/flashinfer/pull/2460
perf: add fp4 GEMM tile configs and streamK scheduler for SM120 (#2460)
perf: add fp4 GEMM tile configs and streamK scheduler for SM120 (#2460) <!-- .github/pull_request_template.md --> ## 📌 Description Add SM120 FP4 GEMM tile configs and enable streamK scheduler for configs that can be selected by autotuner. Take the problem size m=32, n=5120, k=25600 as an example. After adding these...
include/flashinfer/gemm/fp4_gemm_template_sm120.h
cpp
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- include/flashinfer/gemm/fp4_gemm_template_sm120.h +++ include/flashinfer/gemm/fp4_gemm_template_sm120.h @@ -31,6 +31,7 @@ #include "cutlass/gemm/collective/collective_builder.hpp" #include "cutlass/gemm/device/gemm_universal_adapter.h" #include "cutlass/gemm/gemm.h" +#include "cutlass/gemm/kernel/tile_scheduler....
153
105
4
[]
[ "SM120" ]
[]
Optimize this cpp kernel file from flashinfer (include/flashinfer/gemm/fp4_gemm_template_sm120.h). Goal: perf: add fp4 GEMM tile configs and streamK scheduler for SM120 Target hardware: SM120 Target models: unspecified Current file: ```cpp /* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * *...
<!-- .github/pull_request_template.md --> ## 📌 Description Add SM120 FP4 GEMM tile configs and enable streamK scheduler for configs that can be selected by autotuner. Take the problem size m=32, n=5120, k=25600 as an example. After adding these configs, the latency of mm_fp4 kernel reduced from 0.124ms to 0.069ms on...
[{"scope": "kernel", "hardware": "RTX PRO 6000", "model": null, "shape": "m=32,n=5120,k=25600", "batch_size": null, "metric": "latency", "unit": "ms", "higher_is_better": false, "baseline": 0.124, "optimized": 0.069, "stated_speedup": null, "speedup": 1.7971}, {"scope": "kernel", "hardware": "RTX PRO 6000", "model": nu...
1.7993
null
flashinfer
5e5a8668bede32d86035dba98f460a278332e366
2026-02-03T04:42:54-08:00
2,405
https://github.com/flashinfer-ai/flashinfer/pull/2405
perf: improve gdn decode cute-dsl kernels (#2405)
perf: improve gdn decode cute-dsl kernels (#2405) <!-- .github/pull_request_template.md --> ## 📌 Description Follow up of #2370 , this PR improves the benchmark scripts and add comparison with baselines: * benchmark using cupti with l2 flush * compare with sglang's `fused_sigmoid_gating_delta_rule_update` function ...
flashinfer/gdn_decode.py
cute_dsl
Apache-2.0
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
""" Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
--- flashinfer/gdn_decode.py +++ flashinfer/gdn_decode.py @@ -90,10 +90,43 @@ # ============================================================================ # Global configuration for MTP (Multiple Token Processing) version # ============================================================================ -TILE_V_MTP = ...
438
343
1
[]
[ "B200" ]
[ "1.59x", "0.86x", "1.35x", "0.73x", "1.49x", "0.85x", "1.37x", "0.79x", "1.40x", "0.86x" ]
Optimize this cute_dsl kernel file from flashinfer (flashinfer/gdn_decode.py). Goal: perf: improve gdn decode cute-dsl kernels Target hardware: B200 Target models: unspecified Current file: ```python """ Copyright (c) 2025 by FlashInfer team. Licensed under the Apache License, Version 2.0 (the "License"); you may no...
<!-- .github/pull_request_template.md --> ## 📌 Description Follow up of #2370 , this PR improves the benchmark scripts and add comparison with baselines: * benchmark using cupti with l2 flush * compare with sglang's `fused_sigmoid_gating_delta_rule_update` function (with tile size optimization mentioned by @ vadikly...
[{"scope": "kernel", "hardware": "B200", "model": null, "shape": "q_heads=16,k_heads=16,v_heads=32,head_size=128,dtype=bfloat16", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 5.95, "optimized": 3.74, "stated_speedup": null, "speedup": 1.5909}, {"scope": "kernel", "hardware"...
1.1332
null
flashinfer
c7761add6e6b7703ce5f12b03be387e78048f36b
2026-02-03T05:57:24+01:00
2,303
https://github.com/flashinfer-ai/flashinfer/pull/2303
[Perf][Feature] Add SM103-specific schedulers for NVFP4 CUTLASS kernels (#2303)
[Perf][Feature] Add SM103-specific schedulers for NVFP4 CUTLASS kernels (#2303) ## Summary This PR adds new template specializations for SM103 NVFP4 CUTLASS GEMM kernels using architecture-specific tile shapes, cluster shapes, and schedulers. ## Motivation SM103 specifications show a higher NVFP4-over-BF16 speedup ...
include/flashinfer/gemm/cutlass_gemm_configs.h
cpp
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- include/flashinfer/gemm/cutlass_gemm_configs.h +++ include/flashinfer/gemm/cutlass_gemm_configs.h @@ -133,6 +133,11 @@ CtaShape256x64x128B, CtaShape256x128x128B, CtaShape256x256x128B, + + // SM103 + CtaShape128x128x768B, + CtaShape128x192x768B, + CtaShape128x256x768B, }; enum class CutlassTileConfi...
28
2
4
[ "llama" ]
[ "B200", "SM100", "SM103" ]
[ "6×", "4×" ]
Optimize this cpp kernel file from flashinfer (include/flashinfer/gemm/cutlass_gemm_configs.h). Goal: [Perf][Feature] Add SM103-specific schedulers for NVFP4 CUTLASS kernels Target hardware: B200, SM100, SM103 Target models: llama Current file: ```cpp /* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights res...
## Summary This PR adds new template specializations for SM103 NVFP4 CUTLASS GEMM kernels using architecture-specific tile shapes, cluster shapes, and schedulers. ## Motivation SM103 specifications show a higher NVFP4-over-BF16 speedup ratio than B200 (6× vs. 4×), but current kernels remain far from this limit. Th...
[{"scope": "e2e", "hardware": "SM103", "model": "Llama-3.1-70B", "shape": "N=8192,K=28672", "batch_size": 8, "metric": "TFLOPS", "unit": "TFLOP/s", "higher_is_better": true, "baseline": 110.598008, "optimized": 124.005817, "stated_speedup": null, "speedup": 1.1212}, {"scope": "e2e", "hardware": "SM103", "model": "Llama...
null
1.0674
flashinfer
aa8af8534579653a8006be47a6517c103dfb761d
2026-01-23T17:23:57+08:00
2,343
https://github.com/flashinfer-ai/flashinfer/pull/2343
Optimize quantization function in large problem size (#2343)
Optimize quantization function in large problem size (#2343) <!-- .github/pull_request_template.md --> ## 📌 Description Optimize quantization function in large problem size by using TMA and warp specialized programming. <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ## 🔍 Relat...
csrc/nv_internal/cpp/kernels/quantization.cu
cuda
Apache-2.0
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- csrc/nv_internal/cpp/kernels/quantization.cu +++ csrc/nv_internal/cpp/kernels/quantization.cu @@ -14,6 +14,8 @@ * limitations under the License. */ +#include <cuda.h> +#include <cudaTypedefs.h> #include <float.h> #include "tensorrt_llm/common/assert.h" @@ -93,6 +95,7 @@ int32...
154
1
3
[]
[]
[]
Optimize this cuda kernel file from flashinfer (csrc/nv_internal/cpp/kernels/quantization.cu). Goal: Optimize quantization function in large problem size Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * License...
<!-- .github/pull_request_template.md --> ## 📌 Description Optimize quantization function in large problem size by using TMA and warp specialized programming. <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull ...
[]
null
null
flashinfer
18804cd51734cccf807356d017733bc757677f15
2026-01-21T22:28:56-08:00
2,387
https://github.com/flashinfer-ai/flashinfer/pull/2387
A Blackwell-optimized version of selective_state_update (mamba) (#2387)
A Blackwell-optimized version of selective_state_update (mamba) (#2387) <!-- .github/pull_request_template.md --> ## 📌 Description This contributes a `selective_state_update` kernel that has been manually optimized for sm100. <img width="3000" height="3000" alt="runtime_vs_batch_size_NVIDIA_B200" src="https://gith...
include/flashinfer/mamba/selective_state_update.cuh
cuda
Apache-2.0
/* * Copyright (c) 2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
/* * Copyright (c) 2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
--- include/flashinfer/mamba/selective_state_update.cuh +++ include/flashinfer/mamba/selective_state_update.cuh @@ -33,6 +33,8 @@ using namespace conversion; +constexpr unsigned warpSize = 32; + struct SelectiveStateUpdateParams { uint32_t batch{}, nheads{}, dim{}, dstate{}, ngroups{}, state_cache_size{}; i...
478
8
5
[ "mamba" ]
[ "BLACKWELL", "HOPPER", "SM100", "SM90" ]
[]
Optimize this cuda kernel file from flashinfer (include/flashinfer/mamba/selective_state_update.cuh). Goal: A Blackwell-optimized version of selective_state_update (mamba) Target hardware: BLACKWELL, HOPPER, SM100, SM90 Target models: mamba Current file: ```cuda /* * Copyright (c) 2025 by FlashInfer team. * * Lice...
<!-- .github/pull_request_template.md --> ## 📌 Description This contributes a `selective_state_update` kernel that has been manually optimized for sm100. <img width="3000" height="3000" alt="runtime_vs_batch_size_NVIDIA_B200" src="https://github.com/user-attachments/assets/2718d992-1066-4385-b120-d22eccd3a941" /> ...
[]
null
null
flashinfer
2bf87713dade8c6094ca3ff5e246e1ff72e97644
2026-01-13T22:44:35-08:00
2,327
https://github.com/flashinfer-ai/flashinfer/pull/2327
[perf] Improve gemm_fp8_nt_groupwise (cutlass backend) by 10-40% for batch sizes <= 32 (#2327)
[perf] Improve gemm_fp8_nt_groupwise (cutlass backend) by 10-40% for batch sizes <= 32 (#2327) <!-- .github/pull_request_template.md --> ## 📌 Description Improves gemm_fp8_nt_groupwise (cutlass backend) by 10-40% for batch sizes <= 32. These are shapes typical for DeepSeek V3 and Qwen 3 235B - q, k, v, and o_proj:...
csrc/gemm_groupwise_sm100.cu
cuda
Apache-2.0
/* * Copyright (c) 2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
/* * Copyright (c) 2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
--- csrc/gemm_groupwise_sm100.cu +++ csrc/gemm_groupwise_sm100.cu @@ -80,8 +80,17 @@ int MmaSM, typename DTypeIn, typename DTypeOut> cudaError_t CutlassGroupwiseScaledGEMMSM100(void* float_buffer, size_t float_buffer_size_in_bytes, DTypeIn* A_ptr, DTypeIn* B_ptr,...
38
10
2
[ "deepseek", "qwen" ]
[]
[]
Optimize this cuda kernel file from flashinfer (csrc/gemm_groupwise_sm100.cu). Goal: [perf] Improve gemm_fp8_nt_groupwise (cutlass backend) by 10-40% for batch sizes <= 32 Target hardware: unspecified Target models: deepseek, qwen Current file: ```cuda /* * Copyright (c) 2025 by FlashInfer team. * * Licensed under...
<!-- .github/pull_request_template.md --> ## 📌 Description Improves gemm_fp8_nt_groupwise (cutlass backend) by 10-40% for batch sizes <= 32. These are shapes typical for DeepSeek V3 and Qwen 3 235B - q, k, v, and o_proj: ``` +-------+-------+------+-----------+---------------+--------------+---------------+-------...
[{"scope": "kernel", "hardware": null, "model": "DeepSeek V3, Qwen 3 235B", "shape": "out=1536,in=7168", "batch_size": 8, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 24.58, "optimized": 20.48, "stated_speedup": 1.2, "speedup": 1.2002}, {"scope": "kernel", "hardware": null, "model": "DeepSe...
1.1997
null
flashinfer
2bf87713dade8c6094ca3ff5e246e1ff72e97644
2026-01-13T22:44:35-08:00
2,327
https://github.com/flashinfer-ai/flashinfer/pull/2327
[perf] Improve gemm_fp8_nt_groupwise (cutlass backend) by 10-40% for batch sizes <= 32 (#2327)
[perf] Improve gemm_fp8_nt_groupwise (cutlass backend) by 10-40% for batch sizes <= 32 (#2327) <!-- .github/pull_request_template.md --> ## 📌 Description Improves gemm_fp8_nt_groupwise (cutlass backend) by 10-40% for batch sizes <= 32. These are shapes typical for DeepSeek V3 and Qwen 3 235B - q, k, v, and o_proj:...
include/flashinfer/gemm/gemm_groupwise_sm100.cuh
cuda
Apache-2.0
/* * Copyright (c) 2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
/* * Copyright (c) 2025 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
--- include/flashinfer/gemm/gemm_groupwise_sm100.cuh +++ include/flashinfer/gemm/gemm_groupwise_sm100.cuh @@ -17,6 +17,7 @@ #define FLASHINFER_GEMM_GROUPWISE_SM100_CUH_ #include <type_traits> +#include <utility> #include "../allocator.h" #include "../cutlass_utils.cuh" @@ -32,7 +33,7 @@ int MmaSM, ty...
148
3
2
[ "deepseek", "qwen" ]
[]
[]
Optimize this cuda kernel file from flashinfer (include/flashinfer/gemm/gemm_groupwise_sm100.cuh). Goal: [perf] Improve gemm_fp8_nt_groupwise (cutlass backend) by 10-40% for batch sizes <= 32 Target hardware: unspecified Target models: deepseek, qwen Current file: ```cuda /* * Copyright (c) 2025 by FlashInfer team. ...
<!-- .github/pull_request_template.md --> ## 📌 Description Improves gemm_fp8_nt_groupwise (cutlass backend) by 10-40% for batch sizes <= 32. These are shapes typical for DeepSeek V3 and Qwen 3 235B - q, k, v, and o_proj: ``` +-------+-------+------+-----------+---------------+--------------+---------------+-------...
[{"scope": "kernel", "hardware": null, "model": "DeepSeek V3, Qwen 3 235B", "shape": "out=1536,in=7168", "batch_size": 8, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 24.58, "optimized": 20.48, "stated_speedup": 1.2, "speedup": 1.2002}, {"scope": "kernel", "hardware": null, "model": "DeepSe...
1.1997
null
flashinfer
4ccc133c216f3ceaf49fc94ba8ad5984feb0f039
2026-01-13T22:20:39+01:00
2,323
https://github.com/flashinfer-ai/flashinfer/pull/2323
[ML3] Optimized Router Gemm (#2323)
[ML3] Optimized Router Gemm (#2323)
csrc/dsv3_router_gemm.cu
cuda
Apache-2.0
#include "flashinfer/gemm/dsv3_router_gemm.cuh" #include "tvm_ffi_utils.h" namespace flashinfer::trtllm_dsv3_router_gemm { template <typename T, int kNumTokens, int kNumExperts, int kHiddenDim> void invokeRouterGemm(float* output, T const* mat_a, T const* mat_b, cudaStream_t stream, bool use_pdl ...
#include "flashinfer/gemm/dsv3_router_gemm.cuh" #include "tvm_ffi_utils.h" namespace flashinfer::trtllm_dsv3_router_gemm { // Note: Explicit template instantiations are not needed here because // LoopUnroller already forces instantiation of all required specializations. template <typename Tin, typename Tout, int kNum...
--- csrc/dsv3_router_gemm.cu +++ csrc/dsv3_router_gemm.cu @@ -2,10 +2,13 @@ #include "tvm_ffi_utils.h" namespace flashinfer::trtllm_dsv3_router_gemm { -template <typename T, int kNumTokens, int kNumExperts, int kHiddenDim> -void invokeRouterGemm(float* output, T const* mat_a, T const* mat_b, cudaStream_t stream, + ...
33
80
5
[ "deepseek" ]
[]
[]
Optimize this cuda kernel file from flashinfer (csrc/dsv3_router_gemm.cu). Goal: [ML3] Optimized Router Gemm Target hardware: unspecified Target models: deepseek Current file: ```cuda #include "flashinfer/gemm/dsv3_router_gemm.cuh" #include "tvm_ffi_utils.h" namespace flashinfer::trtllm_dsv3_router_gemm { template <...
<!-- .github/pull_request_template.md --> ## 📌 Description This PR extends #2019 by @nvmbreughe for use with Mistral Large 3, which has similar MoE routing to DSV3. The differences are: - The number of experts is 128 (DSV3: 256) - The output type is `bfloat16` (DSV3: `float32`) The code has been extended with a tem...
[{"scope": "kernel", "hardware": "B200", "model": "Mistral Large 3", "shape": "M=16,K=7168,N=128", "batch_size": 16, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 45.6, "optimized": 9.41, "stated_speedup": null, "speedup": 4.8459}]
4.8459
null
flashinfer
4ccc133c216f3ceaf49fc94ba8ad5984feb0f039
2026-01-13T22:20:39+01:00
2,323
https://github.com/flashinfer-ai/flashinfer/pull/2323
[ML3] Optimized Router Gemm (#2323)
[ML3] Optimized Router Gemm (#2323)
include/flashinfer/gemm/dsv3_router_gemm.cuh
cuda
Apache-2.0
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- include/flashinfer/gemm/dsv3_router_gemm.cuh +++ include/flashinfer/gemm/dsv3_router_gemm.cuh @@ -39,9 +39,10 @@ } } -template <typename T, int kBlockSize, int VPT, int kNumTokens, int kNumExperts, int kHiddenDim> -__global__ __launch_bounds__(128, 1) void router_gemm_kernel(float* out, T const* mat_a, - ...
5
4
5
[ "deepseek" ]
[]
[]
Optimize this cuda kernel file from flashinfer (include/flashinfer/gemm/dsv3_router_gemm.cuh). Goal: [ML3] Optimized Router Gemm Target hardware: unspecified Target models: deepseek Current file: ```cuda /* * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, ...
<!-- .github/pull_request_template.md --> ## 📌 Description This PR extends #2019 by @nvmbreughe for use with Mistral Large 3, which has similar MoE routing to DSV3. The differences are: - The number of experts is 128 (DSV3: 256) - The output type is `bfloat16` (DSV3: `float32`) The code has been extended with a tem...
[{"scope": "kernel", "hardware": "B200", "model": "Mistral Large 3", "shape": "M=16,K=7168,N=128", "batch_size": 16, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 45.6, "optimized": 9.41, "stated_speedup": null, "speedup": 4.8459}]
4.8459
null
flashinfer
e079eee48dec413adb66d4a142e3eb66f9f42b6f
2026-01-08T07:48:37+08:00
2,265
https://github.com/flashinfer-ai/flashinfer/pull/2265
[TRTLLM-Gen Fmha] add optimized trtllm-gen decode kernels for high throughput + speculative decoding (#2265)
[TRTLLM-Gen Fmha] add optimized trtllm-gen decode kernels for high throughput + speculative decoding (#2265) <!-- .github/pull_request_template.md --> ## 📌 Description This MR adds the optimized decode attention kernels for high throughput (large batch size) + speculative decoding (seqlen_q > 1). See below for spe...
csrc/trtllm_fmha_kernel_launcher.cu
cuda
Apache-2.0
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribut...
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribut...
--- csrc/trtllm_fmha_kernel_launcher.cu +++ csrc/trtllm_fmha_kernel_launcher.cu @@ -159,8 +159,11 @@ runner_params.cumSeqLensQPtr = cum_seq_lens_q; runner_params.cumSeqLensKvPtr = cum_seq_lens_kv; } else { - // ForGen - runner_params.mMaskType = TrtllmGenAttentionMaskType::Dense; + // Generation. ...
5
2
5
[ "qwen", "gpt-oss" ]
[]
[]
Optimize this cuda kernel file from flashinfer (csrc/trtllm_fmha_kernel_launcher.cu). Goal: [TRTLLM-Gen Fmha] add optimized trtllm-gen decode kernels for high throughput + speculative decoding Target hardware: unspecified Target models: qwen, gpt-oss Current file: ```cuda /* * Licensed under the Apache License, Vers...
<!-- .github/pull_request_template.md --> ## 📌 Description This MR adds the optimized decode attention kernels for high throughput (large batch size) + speculative decoding (seqlen_q > 1). See below for speedups (collected by `benchmarks/flashinfer_benchmark.py`). The seqlenKv is 16K for all cases. | test case ...
[]
null
null
flashinfer
e079eee48dec413adb66d4a142e3eb66f9f42b6f
2026-01-08T07:48:37+08:00
2,265
https://github.com/flashinfer-ai/flashinfer/pull/2265
[TRTLLM-Gen Fmha] add optimized trtllm-gen decode kernels for high throughput + speculative decoding (#2265)
[TRTLLM-Gen Fmha] add optimized trtllm-gen decode kernels for high throughput + speculative decoding (#2265) <!-- .github/pull_request_template.md --> ## 📌 Description This MR adds the optimized decode attention kernels for high throughput (large batch size) + speculative decoding (seqlen_q > 1). See below for spe...
include/flashinfer/trtllm/fmha/fmhaKernels.cuh
cuda
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
--- include/flashinfer/trtllm/fmha/fmhaKernels.cuh +++ include/flashinfer/trtllm/fmha/fmhaKernels.cuh @@ -19,6 +19,7 @@ #include <cuda.h> #include <cstdint> +#include <cuda/std/cfloat> #include <iterator> #include <memory> #include <mutex> @@ -51,6 +52,16 @@ } // namespace flashinfer::trtllm_cubin_loader usin...
394
176
5
[ "qwen", "gpt-oss" ]
[]
[]
Optimize this cuda kernel file from flashinfer (include/flashinfer/trtllm/fmha/fmhaKernels.cuh). Goal: [TRTLLM-Gen Fmha] add optimized trtllm-gen decode kernels for high throughput + speculative decoding Target hardware: unspecified Target models: qwen, gpt-oss Current file: ```cuda /* * Copyright (c) 2020-2023, NVI...
<!-- .github/pull_request_template.md --> ## 📌 Description This MR adds the optimized decode attention kernels for high throughput (large batch size) + speculative decoding (seqlen_q > 1). See below for speedups (collected by `benchmarks/flashinfer_benchmark.py`). The seqlenKv is 16K for all cases. | test case ...
[]
null
null
flashinfer
e079eee48dec413adb66d4a142e3eb66f9f42b6f
2026-01-08T07:48:37+08:00
2,265
https://github.com/flashinfer-ai/flashinfer/pull/2265
[TRTLLM-Gen Fmha] add optimized trtllm-gen decode kernels for high throughput + speculative decoding (#2265)
[TRTLLM-Gen Fmha] add optimized trtllm-gen decode kernels for high throughput + speculative decoding (#2265) <!-- .github/pull_request_template.md --> ## 📌 Description This MR adds the optimized decode attention kernels for high throughput (large batch size) + speculative decoding (seqlen_q > 1). See below for spe...
include/flashinfer/trtllm/fmha/fmhaRunnerParams.h
cpp
Apache-2.0
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
--- include/flashinfer/trtllm/fmha/fmhaRunnerParams.h +++ include/flashinfer/trtllm/fmha/fmhaRunnerParams.h @@ -348,12 +348,16 @@ bool mForceGmemReduction; // The mask type. TrtllmGenAttentionMaskType mMaskType; + // The number of tokens per page. + int mNumTokensPerPage; // Reuse smemK for V or not (only...
6
0
5
[ "qwen", "gpt-oss" ]
[]
[]
Optimize this cpp kernel file from flashinfer (include/flashinfer/trtllm/fmha/fmhaRunnerParams.h). Goal: [TRTLLM-Gen Fmha] add optimized trtllm-gen decode kernels for high throughput + speculative decoding Target hardware: unspecified Target models: qwen, gpt-oss Current file: ```cpp /* * Copyright (c) 2020-2023, NV...
<!-- .github/pull_request_template.md --> ## 📌 Description This MR adds the optimized decode attention kernels for high throughput (large batch size) + speculative decoding (seqlen_q > 1). See below for speedups (collected by `benchmarks/flashinfer_benchmark.py`). The seqlenKv is 16K for all cases. | test case ...
[]
null
null
flashinfer
e079eee48dec413adb66d4a142e3eb66f9f42b6f
2026-01-08T07:48:37+08:00
2,265
https://github.com/flashinfer-ai/flashinfer/pull/2265
[TRTLLM-Gen Fmha] add optimized trtllm-gen decode kernels for high throughput + speculative decoding (#2265)
[TRTLLM-Gen Fmha] add optimized trtllm-gen decode kernels for high throughput + speculative decoding (#2265) <!-- .github/pull_request_template.md --> ## 📌 Description This MR adds the optimized decode attention kernels for high throughput (large batch size) + speculative decoding (seqlen_q > 1). See below for spe...
include/flashinfer/trtllm/fmha/kernelParams.h
cpp
BSD
/*************************************************************************************************** * Copyright (c) 2011-2024, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are not permit- * ted. * * THIS SOFTWARE IS PROVIDED BY THE...
/*************************************************************************************************** * Copyright (c) 2011-2024, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are not permit- * ted. * * THIS SOFTWARE IS PROVIDED BY THE...
--- include/flashinfer/trtllm/fmha/kernelParams.h +++ include/flashinfer/trtllm/fmha/kernelParams.h @@ -30,6 +30,36 @@ #include "../../utils.cuh" #include "../common.h" #include "fmhaRunnerParams.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +// +// CCCL...
64
13
5
[ "qwen", "gpt-oss" ]
[]
[]
Optimize this cpp kernel file from flashinfer (include/flashinfer/trtllm/fmha/kernelParams.h). Goal: [TRTLLM-Gen Fmha] add optimized trtllm-gen decode kernels for high throughput + speculative decoding Target hardware: unspecified Target models: qwen, gpt-oss Current file: ```cpp /************************************...
<!-- .github/pull_request_template.md --> ## 📌 Description This MR adds the optimized decode attention kernels for high throughput (large batch size) + speculative decoding (seqlen_q > 1). See below for speedups (collected by `benchmarks/flashinfer_benchmark.py`). The seqlenKv is 16K for all cases. | test case ...
[]
null
null
flashinfer
4de2a45a5d38da7487ec37b694c644d8906551a6
2025-12-27T15:53:00+08:00
2,268
https://github.com/flashinfer-ai/flashinfer/pull/2268
[performance]optimize for nvfp4 (#2268)
[performance]optimize for nvfp4 (#2268) <!-- .github/pull_request_template.md --> ## 📌 Description I find the nvfp4 implemantation could only 1.3-1.4x speedup compared to fp8 in deepseek-v3-0324 model . and as the fp4 pflops is twice that of fp8, I think there should be some points that could be optimization. now ...
include/flashinfer/comm/trtllm_allreduce_fusion.cuh
cuda
Apache-2.0
#include <cooperative_groups.h> #include <cuda.h> #include <cuda_bf16.h> #include <cuda_fp16.h> #if CUDA_VERSION >= 12080 #include <cuda_fp4.h> #endif #include <cuda/std/optional> #include <tuple> #include <type_traits> #include "../exception.h" #include "../fp4_layout.cuh" #include "../logging.h" #include "../utils...
#include <cooperative_groups.h> #include <cuda.h> #include <cuda_bf16.h> #include <cuda_fp16.h> #if CUDA_VERSION >= 12080 #include <cuda_fp4.h> #endif #include <cuda/std/optional> #include <tuple> #include <type_traits> #include "../exception.h" #include "../fp4_layout.cuh" #include "../logging.h" #include "../utils...
--- include/flashinfer/comm/trtllm_allreduce_fusion.cuh +++ include/flashinfer/comm/trtllm_allreduce_fusion.cuh @@ -529,6 +529,26 @@ uint32_t val3 = c3; return (val3 << 24) | (val2 << 16) | (val1 << 8) | val0; +} + +// Convert single float2 pair to e2m1 (2 float32 -> 2 e2m1, returns uint8_t) +// Optimization: a...
102
41
1
[ "deepseek" ]
[]
[ "1.4x" ]
Optimize this cuda kernel file from flashinfer (include/flashinfer/comm/trtllm_allreduce_fusion.cuh). Goal: [performance]optimize for nvfp4 Target hardware: unspecified Target models: deepseek Current file: ```cuda #include <cooperative_groups.h> #include <cuda.h> #include <cuda_bf16.h> #include <cuda_fp16.h> #if CU...
<!-- .github/pull_request_template.md --> ## 📌 Description I find the nvfp4 implemantation could only 1.3-1.4x speedup compared to fp8 in deepseek-v3-0324 model . and as the fp4 pflops is twice that of fp8, I think there should be some points that could be optimization. now after applying this pr, we can get an ext...
[{"scope": "e2e", "hardware": null, "model": "DeepSeek-V3-0324", "shape": null, "batch_size": 60, "metric": "throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 1192.91, "optimized": 1369.89, "stated_speedup": 1.148, "speedup": 1.1484}]
null
1.1484
flashinfer
3a301a102c6a2ba7b52030910899a405bad156b0
2025-12-18T21:45:15-08:00
2,215
https://github.com/flashinfer-ai/flashinfer/pull/2215
feat: further optimize top-k and add fused top-k page construction kernels for DSA (#2215)
feat: further optimize top-k and add fused top-k page construction kernels for DSA (#2215)
csrc/flashinfer_topk_binding.cu
cuda
Apache-2.0
/* * Copyright (c) 2024 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
/* * Copyright (c) 2024 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
--- csrc/flashinfer_topk_binding.cu +++ csrc/flashinfer_topk_binding.cu @@ -20,5 +20,25 @@ void radix_topk(TensorView input, TensorView output_indices, TensorView output_values, Optional<TensorView> maybe_row_states_buffer, int64_t top_k); +void radix_topk_page_table_transform(TensorView input, Tens...
20
0
5
[]
[]
[]
Optimize this cuda kernel file from flashinfer (csrc/flashinfer_topk_binding.cu). Goal: feat: further optimize top-k and add fused top-k page construction kernels for DSA Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2024 by FlashInfer team. * * Licensed under the...
<!-- .github/pull_request_template.md --> ## 📌 Description Follow up of #2119 , this PR implements `top_k_page_table_transform` and `top_k_ragged_transform` function required for dsa in sglang. (fp16/bf16/fp32 are supported), as requested in #2221 . This PR also adds the more top-k algorithm to choose from: 1. filt...
[{"scope": "kernel", "hardware": "B200", "model": null, "shape": "seq_len=4096,k=2048", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 8.06, "optimized": 8.03, "stated_speedup": 1.0, "speedup": 1.0037}, {"scope": "kernel", "hardware": "B200", "model": null, "shape": "seq_len=...
0.7785
null
flashinfer
3a301a102c6a2ba7b52030910899a405bad156b0
2025-12-18T21:45:15-08:00
2,215
https://github.com/flashinfer-ai/flashinfer/pull/2215
feat: further optimize top-k and add fused top-k page construction kernels for DSA (#2215)
feat: further optimize top-k and add fused top-k page construction kernels for DSA (#2215)
csrc/topk.cu
cuda
Apache-2.0
/* * Copyright (c) 2024 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
/* * Copyright (c) 2024 by FlashInfer team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
--- csrc/topk.cu +++ csrc/topk.cu @@ -14,6 +14,7 @@ * limitations under the License. */ #include <flashinfer/sampling.cuh> +#include <flashinfer/topk.cuh> #include "tvm_ffi_utils.h" @@ -46,15 +47,105 @@ static_cast<sampling::RadixRowState*>(maybe_row_states_buffer.value().data_ptr()); } + // Us...
96
5
5
[]
[]
[]
Optimize this cuda kernel file from flashinfer (csrc/topk.cu). Goal: feat: further optimize top-k and add fused top-k page construction kernels for DSA Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2024 by FlashInfer team. * * Licensed under the Apache License, Ve...
<!-- .github/pull_request_template.md --> ## 📌 Description Follow up of #2119 , this PR implements `top_k_page_table_transform` and `top_k_ragged_transform` function required for dsa in sglang. (fp16/bf16/fp32 are supported), as requested in #2221 . This PR also adds the more top-k algorithm to choose from: 1. filt...
[{"scope": "kernel", "hardware": "B200", "model": null, "shape": "seq_len=4096,k=2048", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 8.06, "optimized": 8.03, "stated_speedup": 1.0, "speedup": 1.0037}, {"scope": "kernel", "hardware": "B200", "model": null, "shape": "seq_len=...
0.7785
null