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
⌀
vllm
580864d81eb03d9fb1383e1782636ff6a9425fa2
2026-03-09T17:50:36+01:00
34,917
https://github.com/vllm-project/vllm/pull/34917
[Attention][Perf][Kernel] Replace torch.cat with vectorized CUDA kernel MLA query concat - DeepSeek-V3.2 (#34917)
[Attention][Perf][Kernel] Replace torch.cat with vectorized CUDA kernel MLA query concat - DeepSeek-V3.2 (#34917) Signed-off-by: LopezCastroRoberto <rocastro@redhat.com> Signed-off-by: Roberto L. Castro <38211239+LopezCastroRoberto@users.noreply.github.com>
csrc/cache.h
cpp
Apache-2.0
#pragma once #include <torch/all.h> #include <c10/util/Optional.h> #include <map> #include <vector> void swap_blocks(torch::Tensor& src, torch::Tensor& dst, int64_t block_size_in_bytes, const torch::Tensor& block_mapping); void reshape_and_cache(torch::Tensor& key, torch::Tensor& v...
#pragma once #include <torch/all.h> #include <c10/util/Optional.h> #include <map> #include <vector> void swap_blocks(torch::Tensor& src, torch::Tensor& dst, int64_t block_size_in_bytes, const torch::Tensor& block_mapping); void reshape_and_cache(torch::Tensor& key, torch::Tensor& v...
--- csrc/cache.h +++ csrc/cache.h @@ -74,6 +74,12 @@ int64_t quant_block_size, // quantization block size const std::string& scale_fmt); +// Concatenate query nope and rope for MLA/DSA attention +void concat_mla_q( + torch::Tensor& ql_nope, // [num_tokens, num_heads, nope_dim] + torch::Tensor& q_...
6
0
5
[ "deepseek" ]
[]
[]
Optimize this cpp kernel file from vllm (csrc/cache.h). Goal: [Attention][Perf][Kernel] Replace torch.cat with vectorized CUDA kernel MLA query concat - DeepSeek-V3.2 Target hardware: unspecified Target models: deepseek Current file: ```cpp #pragma once #include <torch/all.h> #include <c10/util/Optional.h> #include...
PR #35105 needs to be merged first ## Perf eval on B300 Speedup improves with the number of tokens, peaking at `~11.8×` w.r.t. `torch.cat`. ``` --- Non-contiguous nope inputs (transposed BMM output) --- concat_mla_q-transposed: num_tokens torch.cat (Latency (us)) concat_mla_q (v8) (Latency (us)) 1 8.0...
[{"scope": "kernel", "hardware": "B300", "model": "DeepSeek-V3.2", "shape": "transposed BMM output", "batch_size": 8, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 5.05539, "optimized": 1.892126, "stated_speedup": null, "speedup": 2.6718}, {"scope": "kernel", "hardware": "B300", "model": "De...
8.2664
1.0454
vllm
580864d81eb03d9fb1383e1782636ff6a9425fa2
2026-03-09T17:50:36+01:00
34,917
https://github.com/vllm-project/vllm/pull/34917
[Attention][Perf][Kernel] Replace torch.cat with vectorized CUDA kernel MLA query concat - DeepSeek-V3.2 (#34917)
[Attention][Perf][Kernel] Replace torch.cat with vectorized CUDA kernel MLA query concat - DeepSeek-V3.2 (#34917) Signed-off-by: LopezCastroRoberto <rocastro@redhat.com> Signed-off-by: Roberto L. Castro <38211239+LopezCastroRoberto@users.noreply.github.com>
csrc/cache_kernels.cu
cuda
Apache-2.0
#include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <c10/cuda/CUDAException.h> #include <c10/util/Optional.h> #include "cuda_utils.h" #include "cuda_compat.h" #include "dispatch_utils.h" #include "quantization/vectorization_utils.cuh" #ifdef USE_ROCM #include "quantiza...
#include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <c10/cuda/CUDAException.h> #include <c10/util/Optional.h> #include "cuda_utils.h" #include "cuda_compat.h" #include "dispatch_utils.h" #include "quantization/vectorization_utils.cuh" #include "concat_mla_q.cuh" #ifdef U...
--- csrc/cache_kernels.cu +++ csrc/cache_kernels.cu @@ -8,6 +8,7 @@ #include "cuda_compat.h" #include "dispatch_utils.h" #include "quantization/vectorization_utils.cuh" +#include "concat_mla_q.cuh" #ifdef USE_ROCM #include "quantization/w8a8/fp8/amd/quant_utils.cuh" @@ -1358,3 +1359,43 @@ CALL_CP_GATHER_I...
41
0
5
[ "deepseek" ]
[]
[]
Optimize this cuda kernel file from vllm (csrc/cache_kernels.cu). Goal: [Attention][Perf][Kernel] Replace torch.cat with vectorized CUDA kernel MLA query concat - DeepSeek-V3.2 Target hardware: unspecified Target models: deepseek Current file: ```cuda #include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include...
PR #35105 needs to be merged first ## Perf eval on B300 Speedup improves with the number of tokens, peaking at `~11.8×` w.r.t. `torch.cat`. ``` --- Non-contiguous nope inputs (transposed BMM output) --- concat_mla_q-transposed: num_tokens torch.cat (Latency (us)) concat_mla_q (v8) (Latency (us)) 1 8.0...
[{"scope": "kernel", "hardware": "B300", "model": "DeepSeek-V3.2", "shape": "transposed BMM output", "batch_size": 8, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 5.05539, "optimized": 1.892126, "stated_speedup": null, "speedup": 2.6718}, {"scope": "kernel", "hardware": "B300", "model": "De...
8.2664
1.0454
vllm
580864d81eb03d9fb1383e1782636ff6a9425fa2
2026-03-09T17:50:36+01:00
34,917
https://github.com/vllm-project/vllm/pull/34917
[Attention][Perf][Kernel] Replace torch.cat with vectorized CUDA kernel MLA query concat - DeepSeek-V3.2 (#34917)
[Attention][Perf][Kernel] Replace torch.cat with vectorized CUDA kernel MLA query concat - DeepSeek-V3.2 (#34917) Signed-off-by: LopezCastroRoberto <rocastro@redhat.com> Signed-off-by: Roberto L. Castro <38211239+LopezCastroRoberto@users.noreply.github.com>
csrc/cuda_vec_utils.cuh
cuda
Apache-2.0
// SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright contributors to the vLLM project #pragma once #include <c10/util/BFloat16.h> #include <c10/util/Half.h> #include <cassert> #ifdef USE_ROCM #include <hip/hip_runtime.h> #else #include <cuda_bf16.h> #include <cuda_fp16.h> #include <cud...
// SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright contributors to the vLLM project #pragma once #include <c10/util/BFloat16.h> #include <c10/util/Half.h> #include <cassert> #ifdef USE_ROCM #include <hip/hip_runtime.h> #else #include <cuda_bf16.h> #include <cuda_fp16.h> #include <cud...
--- csrc/cuda_vec_utils.cuh +++ csrc/cuda_vec_utils.cuh @@ -196,7 +196,6 @@ return val; #else assert(false && "ld256_cs requires SM100+ with CUDA 12.9+"); - return {}; #endif } @@ -211,23 +210,51 @@ #endif } -// 32-bit cache-streaming (.cs) load / store — SM100+ only. +// 32-bit load / store. +__device...
38
11
5
[ "deepseek" ]
[]
[]
Optimize this cuda kernel file from vllm (csrc/cuda_vec_utils.cuh). Goal: [Attention][Perf][Kernel] Replace torch.cat with vectorized CUDA kernel MLA query concat - DeepSeek-V3.2 Target hardware: unspecified Target models: deepseek Current file: ```cuda // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText...
PR #35105 needs to be merged first ## Perf eval on B300 Speedup improves with the number of tokens, peaking at `~11.8×` w.r.t. `torch.cat`. ``` --- Non-contiguous nope inputs (transposed BMM output) --- concat_mla_q-transposed: num_tokens torch.cat (Latency (us)) concat_mla_q (v8) (Latency (us)) 1 8.0...
[{"scope": "kernel", "hardware": "B300", "model": "DeepSeek-V3.2", "shape": "transposed BMM output", "batch_size": 8, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 5.05539, "optimized": 1.892126, "stated_speedup": null, "speedup": 2.6718}, {"scope": "kernel", "hardware": "B300", "model": "De...
8.2664
1.0454
vllm
580864d81eb03d9fb1383e1782636ff6a9425fa2
2026-03-09T17:50:36+01:00
34,917
https://github.com/vllm-project/vllm/pull/34917
[Attention][Perf][Kernel] Replace torch.cat with vectorized CUDA kernel MLA query concat - DeepSeek-V3.2 (#34917)
[Attention][Perf][Kernel] Replace torch.cat with vectorized CUDA kernel MLA query concat - DeepSeek-V3.2 (#34917) Signed-off-by: LopezCastroRoberto <rocastro@redhat.com> Signed-off-by: Roberto L. Castro <38211239+LopezCastroRoberto@users.noreply.github.com>
csrc/torch_bindings.cpp
cpp
Apache-2.0
#include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> #include <torch/version.h> // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only /...
#include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> #include <torch/version.h> // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only /...
--- csrc/torch_bindings.cpp +++ csrc/torch_bindings.cpp @@ -803,6 +803,10 @@ &indexer_k_quant_and_cache); cache_ops.def( + "concat_mla_q(Tensor ql_nope, Tensor q_pe, Tensor! q_out) -> ()"); + cache_ops.impl("concat_mla_q", torch::kCUDA, &concat_mla_q); + + cache_ops.def( "cp_gather_...
4
0
5
[ "deepseek" ]
[]
[]
Optimize this cpp kernel file from vllm (csrc/torch_bindings.cpp). Goal: [Attention][Perf][Kernel] Replace torch.cat with vectorized CUDA kernel MLA query concat - DeepSeek-V3.2 Target hardware: unspecified Target models: deepseek Current file: ```cpp #include "cache.h" #include "cuda_utils.h" #include "ops.h" #inclu...
PR #35105 needs to be merged first ## Perf eval on B300 Speedup improves with the number of tokens, peaking at `~11.8×` w.r.t. `torch.cat`. ``` --- Non-contiguous nope inputs (transposed BMM output) --- concat_mla_q-transposed: num_tokens torch.cat (Latency (us)) concat_mla_q (v8) (Latency (us)) 1 8.0...
[{"scope": "kernel", "hardware": "B300", "model": "DeepSeek-V3.2", "shape": "transposed BMM output", "batch_size": 8, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 5.05539, "optimized": 1.892126, "stated_speedup": null, "speedup": 2.6718}, {"scope": "kernel", "hardware": "B300", "model": "De...
8.2664
1.0454
vllm
2b28b9b269e18cfe42c7e945d1da8d1c40989efa
2026-03-09T17:46:57+01:00
35,290
https://github.com/vllm-project/vllm/pull/35290
[Attention][Perf] Optimize cp_gather_and_upconvert_fp8_kv_cache - DeepSeek-v3.2 (#35290)
[Attention][Perf] Optimize cp_gather_and_upconvert_fp8_kv_cache - DeepSeek-v3.2 (#35290) Signed-off-by: LopezCastroRoberto <rocastro@redhat.com> Co-authored-by: Claude <noreply@anthropic.com>
csrc/cache_kernels.cu
cuda
Apache-2.0
#include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <c10/cuda/CUDAException.h> #include <c10/util/Optional.h> #include "cuda_utils.h" #include "cuda_compat.h" #include "dispatch_utils.h" #include "quantization/vectorization_utils.cuh" #ifdef USE_ROCM #include "quantiza...
#include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <c10/cuda/CUDAException.h> #include <c10/util/Optional.h> #include "cuda_utils.h" #include "cuda_compat.h" #include "dispatch_utils.h" #include "quantization/vectorization_utils.cuh" #ifdef USE_ROCM #include "quantiza...
--- csrc/cache_kernels.cu +++ csrc/cache_kernels.cu @@ -995,75 +995,67 @@ // Similar to cp_gather_cache but specifically for FP8->BF16 conversion __global__ void cp_gather_and_upconvert_fp8_kv_cache( const uint8_t* __restrict__ src_cache, // [NUM_BLOCKS, BLOCK_SIZE, 656] - __nv_bfloat16* __restrict__ dst, ...
70
77
1
[ "deepseek" ]
[]
[]
Optimize this cuda kernel file from vllm (csrc/cache_kernels.cu). Goal: [Attention][Perf] Optimize cp_gather_and_upconvert_fp8_kv_cache - DeepSeek-v3.2 Target hardware: unspecified Target models: deepseek Current file: ```cuda #include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #...
``` ====================================================================== CP_GATHER_AND_UPCONVERT_FP8_KV_CACHE BENCHMARKS ====================================================================== Cache entry: 656 bytes (512 FP8 + 16 scales + 128 RoPE) Output row: 576 BF16 = 1152 bytes Per token: 1808 bytes (read + wri...
[{"scope": "kernel", "hardware": null, "model": null, "shape": "cache_entry=656_bytes,output_row=1152_bytes,block_size=64", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 123.42836, "optimized": 3.763423, "stated_speedup": null, "speedup": 32.7968}, {"scope": "kernel", "hardw...
12.45
1.4499
vllm
8e7820131ee8d0295e6a533d745f6ca8085baec9
2026-03-04T20:56:49-08:00
35,890
https://github.com/vllm-project/vllm/pull/35890
[Perf] Use dummy M for weight prepacking on x86 (#35890)
[Perf] Use dummy M for weight prepacking on x86 (#35890) Signed-off-by: Li, Tianmu <tianmu.li@intel.com>
csrc/cpu/dnnl_helper.cpp
cpp
Apache-2.0
#include <list> #include <optional> #include "common/memory_desc.hpp" #include "common/memory.hpp" #include "cpu/utils.hpp" #include "cpu/dnnl_helper.h" static dnnl::engine& default_engine() { static dnnl::engine engine(dnnl::engine::kind::cpu, 0); return engine; } static dnnl::stream& default_stream() { stat...
#include <list> #include <optional> #include "common/memory_desc.hpp" #include "common/memory.hpp" #include "cpu/utils.hpp" #include "cpu/dnnl_helper.h" static dnnl::engine& default_engine() { static dnnl::engine engine(dnnl::engine::kind::cpu, 0); return engine; } static dnnl::stream& default_stream() { stat...
--- csrc/cpu/dnnl_helper.cpp +++ csrc/cpu/dnnl_helper.cpp @@ -237,13 +237,10 @@ }; dnnl::memory::desc original_b_md({b_k_size_, b_n_size_}, b_type_, {b_k_stride_, b_n_stride_}); -#ifdef __aarch64__ + // dummy M size for prepacking weights // Prepacking weights improves pe...
12
17
1
[]
[ "CPU" ]
[]
Optimize this cpp kernel file from vllm (csrc/cpu/dnnl_helper.cpp). Goal: [Perf] Use dummy M for weight prepacking on x86 Target hardware: CPU Target models: unspecified Current file: ```cpp #include <list> #include <optional> #include "common/memory_desc.hpp" #include "common/memory.hpp" #include "cpu/utils.hpp" #...
## Purpose On x86 systems without AMX, onednn weight prepacking without known M dimension results in ab layout instead of optimized blocked layouts. The PR uses existing dummy M method for ARM platforms to ensure proper weight prepacking. ## Test Plan Platform: 2S EPYC 9755, DDR5-6400 Server: ``` export VLLM_CPU_KVCACH...
[]
null
null
vllm
7faba503c403bc8c562888df3a841b6df104d042
2026-03-04T20:47:17+02:00
35,397
https://github.com/vllm-project/vllm/pull/35397
[Kernel][Mamba] Optimize Mamba2 SSD prefill Triton kernels (#35397)
[Kernel][Mamba] Optimize Mamba2 SSD prefill Triton kernels (#35397) Signed-off-by: Tomer Asida <57313761+tomeras91@users.noreply.github.com>
vllm/model_executor/layers/mamba/ops/mamba_ssm.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright (c) 2024, Tri Dao, Albert Gu. # Adapted from https://github.com/state-spaces/mamba/blob/v2.2.4/mamba_ssm/ops/triton/selective_state_update.py import torch from packaging import version from vllm imp...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright (c) 2024, Tri Dao, Albert Gu. # Adapted from https://github.com/state-spaces/mamba/blob/v2.2.4/mamba_ssm/ops/triton/selective_state_update.py import torch from packaging import version from vllm imp...
--- vllm/model_executor/layers/mamba/ops/mamba_ssm.py +++ vllm/model_executor/layers/mamba/ops/mamba_ssm.py @@ -8,6 +8,7 @@ from packaging import version from vllm import _custom_ops as ops +from vllm.model_executor.layers.mamba.ops.triton_helpers import fast_exp from vllm.triton_utils import HAS_TRITON, tl, trito...
3
2
5
[ "mamba" ]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/mamba/ops/mamba_ssm.py). Goal: [Kernel][Mamba] Optimize Mamba2 SSD prefill Triton kernels Target hardware: unspecified Target models: mamba Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contribut...
## Purpose Optimize Mamba2 SSD prefill Triton kernels through three changes, and clean up dead code. ### 1. Extended autotune search space Added new Triton configs to `_chunk_scan_fwd_kernel`, `_chunk_state_fwd_kernel`, and `_chunk_cumsum_fwd_kernel`, covering: - Higher warp counts (num_warps=8) for better memory lat...
[{"scope": "e2e", "hardware": "B200", "model": "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16", "shape": "ISL=50000,OSL=2048", "batch_size": 64, "metric": "Total token throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 55461, "optimized": 55941, "stated_speedup": null, "speedup": 1.0087}, {"scope": "e2e",...
1.0778
1.0091
vllm
7faba503c403bc8c562888df3a841b6df104d042
2026-03-04T20:47:17+02:00
35,397
https://github.com/vllm-project/vllm/pull/35397
[Kernel][Mamba] Optimize Mamba2 SSD prefill Triton kernels (#35397)
[Kernel][Mamba] Optimize Mamba2 SSD prefill Triton kernels (#35397) Signed-off-by: Tomer Asida <57313761+tomeras91@users.noreply.github.com>
vllm/model_executor/layers/mamba/ops/ssd_chunk_scan.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright (c) 2024, Tri Dao, Albert Gu. # Adapted from https://github.com/state-spaces/mamba/blob/v2.2.4/mamba_ssm/ops/triton/ssd_chunk_scan.py # ruff: noqa: E501,SIM102 from packaging import version from vl...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright (c) 2024, Tri Dao, Albert Gu. # Adapted from https://github.com/state-spaces/mamba/blob/v2.2.4/mamba_ssm/ops/triton/ssd_chunk_scan.py # ruff: noqa: E501,SIM102 from packaging import version from vl...
--- vllm/model_executor/layers/mamba/ops/ssd_chunk_scan.py +++ vllm/model_executor/layers/mamba/ops/ssd_chunk_scan.py @@ -8,6 +8,7 @@ from packaging import version +from vllm.model_executor.layers.mamba.ops.triton_helpers import fast_exp from vllm.triton_utils import tl, triton TRITON_22 = version.parse(triton...
73
2
5
[ "mamba" ]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/mamba/ops/ssd_chunk_scan.py). Goal: [Kernel][Mamba] Optimize Mamba2 SSD prefill Triton kernels Target hardware: unspecified Target models: mamba Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright cont...
## Purpose Optimize Mamba2 SSD prefill Triton kernels through three changes, and clean up dead code. ### 1. Extended autotune search space Added new Triton configs to `_chunk_scan_fwd_kernel`, `_chunk_state_fwd_kernel`, and `_chunk_cumsum_fwd_kernel`, covering: - Higher warp counts (num_warps=8) for better memory lat...
[{"scope": "e2e", "hardware": "B200", "model": "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16", "shape": "ISL=50000,OSL=2048", "batch_size": 64, "metric": "Total token throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 55461, "optimized": 55941, "stated_speedup": null, "speedup": 1.0087}, {"scope": "e2e",...
1.0778
1.0091
vllm
7faba503c403bc8c562888df3a841b6df104d042
2026-03-04T20:47:17+02:00
35,397
https://github.com/vllm-project/vllm/pull/35397
[Kernel][Mamba] Optimize Mamba2 SSD prefill Triton kernels (#35397)
[Kernel][Mamba] Optimize Mamba2 SSD prefill Triton kernels (#35397) Signed-off-by: Tomer Asida <57313761+tomeras91@users.noreply.github.com>
vllm/model_executor/layers/mamba/ops/ssd_chunk_state.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright (c) 2024, Tri Dao, Albert Gu. # Adapted from https://github.com/state-spaces/mamba/blob/v2.2.4/mamba_ssm/ops/triton/ssd_chunk_state.py # ruff: noqa: E501 import torch from vllm.triton_utils import ...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright (c) 2024, Tri Dao, Albert Gu. # Adapted from https://github.com/state-spaces/mamba/blob/v2.2.4/mamba_ssm/ops/triton/ssd_chunk_state.py # ruff: noqa: E501 import torch from vllm.model_executor.layer...
--- vllm/model_executor/layers/mamba/ops/ssd_chunk_state.py +++ vllm/model_executor/layers/mamba/ops/ssd_chunk_state.py @@ -8,6 +8,7 @@ import torch +from vllm.model_executor.layers.mamba.ops.triton_helpers import fast_exp from vllm.triton_utils import tl, triton from .mamba_ssm import softplus @@ -116,6 +117,...
30
319
5
[ "mamba" ]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/mamba/ops/ssd_chunk_state.py). Goal: [Kernel][Mamba] Optimize Mamba2 SSD prefill Triton kernels Target hardware: unspecified Target models: mamba Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright con...
## Purpose Optimize Mamba2 SSD prefill Triton kernels through three changes, and clean up dead code. ### 1. Extended autotune search space Added new Triton configs to `_chunk_scan_fwd_kernel`, `_chunk_state_fwd_kernel`, and `_chunk_cumsum_fwd_kernel`, covering: - Higher warp counts (num_warps=8) for better memory lat...
[{"scope": "e2e", "hardware": "B200", "model": "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16", "shape": "ISL=50000,OSL=2048", "batch_size": 64, "metric": "Total token throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 55461, "optimized": 55941, "stated_speedup": null, "speedup": 1.0087}, {"scope": "e2e",...
1.0778
1.0091
vllm
7faba503c403bc8c562888df3a841b6df104d042
2026-03-04T20:47:17+02:00
35,397
https://github.com/vllm-project/vllm/pull/35397
[Kernel][Mamba] Optimize Mamba2 SSD prefill Triton kernels (#35397)
[Kernel][Mamba] Optimize Mamba2 SSD prefill Triton kernels (#35397) Signed-off-by: Tomer Asida <57313761+tomeras91@users.noreply.github.com>
vllm/model_executor/layers/mamba/ops/ssd_state_passing.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright (c) 2024, Tri Dao, Albert Gu. # Adapted from https://github.com/state-spaces/mamba/blob/v2.2.4/mamba_ssm/ops/triton/ssd_state_passing.py # ruff: noqa: E501 import torch from vllm.triton_utils impor...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright (c) 2024, Tri Dao, Albert Gu. # Adapted from https://github.com/state-spaces/mamba/blob/v2.2.4/mamba_ssm/ops/triton/ssd_state_passing.py # ruff: noqa: E501 import torch from vllm.model_executor.lay...
--- vllm/model_executor/layers/mamba/ops/ssd_state_passing.py +++ vllm/model_executor/layers/mamba/ops/ssd_state_passing.py @@ -8,6 +8,7 @@ import torch +from vllm.model_executor.layers.mamba.ops.triton_helpers import fast_exp from vllm.triton_utils import tl, triton @@ -29,12 +30,9 @@ out_ptr, dA_c...
29
40
5
[ "mamba" ]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/mamba/ops/ssd_state_passing.py). Goal: [Kernel][Mamba] Optimize Mamba2 SSD prefill Triton kernels Target hardware: unspecified Target models: mamba Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright c...
## Purpose Optimize Mamba2 SSD prefill Triton kernels through three changes, and clean up dead code. ### 1. Extended autotune search space Added new Triton configs to `_chunk_scan_fwd_kernel`, `_chunk_state_fwd_kernel`, and `_chunk_cumsum_fwd_kernel`, covering: - Higher warp counts (num_warps=8) for better memory lat...
[{"scope": "e2e", "hardware": "B200", "model": "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16", "shape": "ISL=50000,OSL=2048", "batch_size": 64, "metric": "Total token throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 55461, "optimized": 55941, "stated_speedup": null, "speedup": 1.0087}, {"scope": "e2e",...
1.0778
1.0091
vllm
16d2ad1d384e8b3d89434ae60508b26d0ce6ac99
2026-03-04T17:49:47+08:00
30,681
https://github.com/vllm-project/vllm/pull/30681
[Hardware] Replace `torch.cuda.empty_cache` with `torch.accelerator.empty_cache` (#30681)
[Hardware] Replace `torch.cuda.empty_cache` with `torch.accelerator.empty_cache` (#30681) Signed-off-by: Kunshang Ji <kunshang.ji@intel.com> Signed-off-by: Kunshang Ji <jikunshang95@gmail.com> Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
vllm/model_executor/layers/quantization/utils/fp8_utils.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from https://github.com/sgl-project/sglang/pull/2575 import functools import json import os from collections.abc import Callable, Sequence from typing import Any import torch import vllm.envs as envs ...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from https://github.com/sgl-project/sglang/pull/2575 import functools import json import os from collections.abc import Callable, Sequence from typing import Any import torch import vllm.envs as envs ...
--- vllm/model_executor/layers/quantization/utils/fp8_utils.py +++ vllm/model_executor/layers/quantization/utils/fp8_utils.py @@ -1407,7 +1407,7 @@ import torch.nn.functional as F weight = F.pad(weight, (0, num_pad), "constant", 0)[..., :-num_pad] - torch.cuda.empty_cache() + torch.acc...
1
1
3
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/quantization/utils/fp8_utils.py). Goal: [Hardware] Replace `torch.cuda.empty_cache` with `torch.accelerator.empty_cache` Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-F...
<!-- markdownlint-disable --> ## Purpose vLLM is a framework support multi hardware backend. while there are some torch.cuda hard call. this is unfriendly to non-cuda compatible device. fortunately, there is a new set of `torch.accelerator` API which can dispatch based on platform. I will try to create a series of PR ...
[]
null
null
vllm
38c498b8e3aaec95049f384edfc56ca12cbe1839
2026-02-27T02:51:28+02:00
35,121
https://github.com/vllm-project/vllm/pull/35121
[Performance] Cublas Bf16 Gate with Fp32 Output (#35121)
[Performance] Cublas Bf16 Gate with Fp32 Output (#35121) Signed-off-by: Roi Koren <roik@nvidia.com>
csrc/moe/moe_ops.h
cpp
Apache-2.0
#pragma once #include <torch/all.h> void topk_softmax(torch::Tensor& topk_weights, torch::Tensor& topk_indices, torch::Tensor& token_expert_indices, torch::Tensor& gating_output, bool renormalize, std::optional<torch::Tensor> bias); void topk_sigmoid(torch::Tenso...
#pragma once #include <torch/all.h> void topk_softmax(torch::Tensor& topk_weights, torch::Tensor& topk_indices, torch::Tensor& token_expert_indices, torch::Tensor& gating_output, bool renormalize, std::optional<torch::Tensor> bias); void topk_sigmoid(torch::Tenso...
--- csrc/moe/moe_ops.h +++ csrc/moe/moe_ops.h @@ -58,6 +58,10 @@ torch::Tensor& output_tensor); #ifndef USE_ROCM +// cuBLAS bf16 x bf16 -> fp32 router GEMM (fallback for non-SM90 / batch > 16) +torch::Tensor router_gemm_bf16_fp32(torch::Tensor const& input, + tor...
4
0
3
[]
[]
[]
Optimize this cpp kernel file from vllm (csrc/moe/moe_ops.h). Goal: [Performance] Cublas Bf16 Gate with Fp32 Output Target hardware: unspecified Target models: unspecified Current file: ```cpp #pragma once #include <torch/all.h> void topk_softmax(torch::Tensor& topk_weights, torch::Tensor& topk_indices, ...
## Purpose Introduces `GateLinear`, a specialized MoE gate linear layer with three-tier GEMM dispatch for router logits: 1. **Tier 1 — DSV3 specialized kernel** (SM90+, batch ≤ 16, supported dims): highest throughput for small batches 2. **Tier 2 — cuBLAS bf16×bf16→fp32** (SM90+, bf16 weights, fp32 out_dtype): fp32-a...
[{"scope": "kernel", "hardware": "H100", "model": "DeepSeek-V3", "shape": "hidden=7168,experts=256", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 18.5, "optimized": 11.8, "stated_speedup": null, "speedup": 1.5678}, {"scope": "kernel", "hardware": "H100", "model": "DeepSeek-...
1.5339
null
vllm
38c498b8e3aaec95049f384edfc56ca12cbe1839
2026-02-27T02:51:28+02:00
35,121
https://github.com/vllm-project/vllm/pull/35121
[Performance] Cublas Bf16 Gate with Fp32 Output (#35121)
[Performance] Cublas Bf16 Gate with Fp32 Output (#35121) Signed-off-by: Roi Koren <roik@nvidia.com>
csrc/moe/torch_bindings.cpp
cpp
Apache-2.0
#include "core/registration.h" #include "moe_ops.h" TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, m) { // Apply topk softmax to the gating outputs. m.def( "topk_softmax(Tensor! topk_weights, Tensor! topk_indices, Tensor! " "token_expert_indices, Tensor gating_output, bool renormalize, Tensor? " "bia...
#include "core/registration.h" #include "moe_ops.h" TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, m) { // Apply topk softmax to the gating outputs. m.def( "topk_softmax(Tensor! topk_weights, Tensor! topk_indices, Tensor! " "token_expert_indices, Tensor gating_output, bool renormalize, Tensor? " "bia...
--- csrc/moe/torch_bindings.cpp +++ csrc/moe/torch_bindings.cpp @@ -125,6 +125,10 @@ "Tensor)"); m.impl("grouped_topk", torch::kCUDA, &grouped_topk); + // cuBLAS bf16 x bf16 -> fp32 router GEMM (fallback for non-SM90 / batch > 16) + m.def("router_gemm_bf16_fp32(Tensor input, Tensor weight) -> Tensor"); + ...
4
0
3
[]
[]
[]
Optimize this cpp kernel file from vllm (csrc/moe/torch_bindings.cpp). Goal: [Performance] Cublas Bf16 Gate with Fp32 Output Target hardware: unspecified Target models: unspecified Current file: ```cpp #include "core/registration.h" #include "moe_ops.h" TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, m) { // Apply topk...
## Purpose Introduces `GateLinear`, a specialized MoE gate linear layer with three-tier GEMM dispatch for router logits: 1. **Tier 1 — DSV3 specialized kernel** (SM90+, batch ≤ 16, supported dims): highest throughput for small batches 2. **Tier 2 — cuBLAS bf16×bf16→fp32** (SM90+, bf16 weights, fp32 out_dtype): fp32-a...
[{"scope": "kernel", "hardware": "H100", "model": "DeepSeek-V3", "shape": "hidden=7168,experts=256", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 18.5, "optimized": 11.8, "stated_speedup": null, "speedup": 1.5678}, {"scope": "kernel", "hardware": "H100", "model": "DeepSeek-...
1.5339
null
vllm
98217b09f9ce22429ce35badfa1d50e1f4fe4137
2026-02-26T22:29:01+01:00
35,422
https://github.com/vllm-project/vllm/pull/35422
[Performance] Extract KV cache update op from flashinfer forward (#35422)
[Performance] Extract KV cache update op from flashinfer forward (#35422) Signed-off-by: ElizaWszola <ewszola@redhat.com>
vllm/v1/attention/backends/flashinfer.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Attention layer with FlashInfer.""" from dataclasses import dataclass from typing import ClassVar import numpy as np import torch from flashinfer import ( BatchDecodeWithPagedKVCacheWrapper, BatchPref...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Attention layer with FlashInfer.""" from dataclasses import dataclass from typing import ClassVar import numpy as np import torch from flashinfer import ( BatchDecodeWithPagedKVCacheWrapper, BatchPref...
--- vllm/v1/attention/backends/flashinfer.py +++ vllm/v1/attention/backends/flashinfer.py @@ -380,6 +380,8 @@ if capability is not None and capability.major == 10: return "HND" return None + + forward_includes_kv_cache_update: bool = False @dataclass @@ -1330,32 +1332,15 @@ ...
38
26
1
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/v1/attention/backends/flashinfer.py). Goal: [Performance] Extract KV cache update op from flashinfer forward Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contri...
Extract KV cache update op from flashinfer similar to https://github.com/vllm-project/vllm/pull/25954 This PR is a part of https://github.com/vllm-project/vllm/issues/32335 #### Eval (`Qwen/Qwen3-30B-A3B-FP8`): main: |Tasks|Version| Filter |n-shot| Metric | |Value | |Stderr| |-----|------:|-------------...
[]
null
null
vllm
cd4367366814f1d1404e263e621a2b15c117eaf6
2026-02-25T14:25:24+08:00
34,424
https://github.com/vllm-project/vllm/pull/34424
[Perf] Optimize FP8 gemm of sm120. (#34424)
[Perf] Optimize FP8 gemm of sm120. (#34424) Signed-off-by: wenshuai <wenshuai@xiaomi.com>
csrc/quantization/w8a8/cutlass/c3x/scaled_mm_sm120_fp8_dispatch.cuh
cuda
Apache-2.0
#pragma once #include "scaled_mm.cuh" #include "cutlass_gemm_caller.cuh" /** * This file defines Gemm kernel configurations for SM120 (fp8) based on the * Gemm shape. */ namespace vllm { using c3x::cutlass_gemm_caller; template <typename InType, typename OutType, template <typename, typename, typename...
#pragma once #include "scaled_mm.cuh" #include "cutlass_gemm_caller.cuh" /** * This file defines Gemm kernel configurations for SM120 (fp8) based on the * Gemm shape. */ namespace vllm { using c3x::cutlass_gemm_caller; // Custom wrapper to allow specifying EpilogueTile for small M template <typename ElementAB_,...
--- csrc/quantization/w8a8/cutlass/c3x/scaled_mm_sm120_fp8_dispatch.cuh +++ csrc/quantization/w8a8/cutlass/c3x/scaled_mm_sm120_fp8_dispatch.cuh @@ -11,6 +11,68 @@ namespace vllm { using c3x::cutlass_gemm_caller; + +// Custom wrapper to allow specifying EpilogueTile for small M +template <typename ElementAB_, typena...
132
0
1
[]
[ "SM120" ]
[]
Optimize this cuda kernel file from vllm (csrc/quantization/w8a8/cutlass/c3x/scaled_mm_sm120_fp8_dispatch.cuh). Goal: [Perf] Optimize FP8 gemm of sm120. Target hardware: SM120 Target models: unspecified Current file: ```cuda #pragma once #include "scaled_mm.cuh" #include "cutlass_gemm_caller.cuh" /** * This file d...
## Purpose Optimize FP8 gemm of sm120 at any input shape. ## Test Plan benchmarks/kernels# python3 bench_fp8_gemm.py run bench_fp8_gemm.py and compare the results with the patch or not. ## Test Result **the current restut without the patch** ``` root@de-22309-vllm-0-15-1-5090-0211172246-79ccd9bbf9-6jfzz:/vllm/benchma...
[]
null
null
vllm
34ce0ffd1f3c7b5e2bcc6073dd1525f266133755
2026-02-24T20:55:39+05:30
34,434
https://github.com/vllm-project/vllm/pull/34434
[CPU][Perf] Accelerate Attention head for s390x using vector intrinsics (#34434)
[CPU][Perf] Accelerate Attention head for s390x using vector intrinsics (#34434) Signed-off-by: Rehan Khan <Rehan.Khan7@ibm.com> Co-authored-by: Li, Jiang <jiang1.li@intel.com>
csrc/cpu/cpu_attn.cpp
cpp
Apache-2.0
#include "cpu_attn_dispatch_generated.h" torch::Tensor get_scheduler_metadata( const int64_t num_req, const int64_t num_heads_q, const int64_t num_heads_kv, const int64_t head_dim, const torch::Tensor& seq_lens, at::ScalarType dtype, const torch::Tensor& query_start_loc, const bool casual, const in...
#include "cpu_attn_dispatch_generated.h" torch::Tensor get_scheduler_metadata( const int64_t num_req, const int64_t num_heads_q, const int64_t num_heads_kv, const int64_t head_dim, const torch::Tensor& seq_lens, at::ScalarType dtype, const torch::Tensor& query_start_loc, const bool casual, const in...
--- csrc/cpu/cpu_attn.cpp +++ csrc/cpu/cpu_attn.cpp @@ -16,6 +16,8 @@ isa = cpu_attention::ISA::VEC16; } else if (isa_hint == "neon") { isa = cpu_attention::ISA::NEON; + } else if (isa_hint == "vxe") { + isa = cpu_attention::ISA::VXE; } else { TORCH_CHECK(false, "Unsupported CPU attention ISA h...
4
0
4
[]
[ "CPU" ]
[]
Optimize this cpp kernel file from vllm (csrc/cpu/cpu_attn.cpp). Goal: [CPU][Perf] Accelerate Attention head for s390x using vector intrinsics Target hardware: CPU Target models: unspecified Current file: ```cpp #include "cpu_attn_dispatch_generated.h" torch::Tensor get_scheduler_metadata( const int64_t num_req,...
## Purpose Accelerate paged attention GEMMs (QK, PV) on s390x with vector intrinsics This PR accelerates `cpu_attention_with_kv_cache `on s390x by introducing VXE (Vector Extension Facility) optimized GEMM kernels for both QK and PV attention phases. The vectorized implementation significantly improves token generation...
[]
null
null
vllm
34ce0ffd1f3c7b5e2bcc6073dd1525f266133755
2026-02-24T20:55:39+05:30
34,434
https://github.com/vllm-project/vllm/pull/34434
[CPU][Perf] Accelerate Attention head for s390x using vector intrinsics (#34434)
[CPU][Perf] Accelerate Attention head for s390x using vector intrinsics (#34434) Signed-off-by: Rehan Khan <Rehan.Khan7@ibm.com> Co-authored-by: Li, Jiang <jiang1.li@intel.com>
csrc/cpu/cpu_attn_impl.hpp
cpp
Apache-2.0
#ifndef CPU_ATTN_HPP #define CPU_ATTN_HPP #include <type_traits> #include <cstddef> #if defined(__APPLE__) #include <sys/sysctl.h> #endif #include "cpu/cpu_arch_macros.h" #include "cpu/utils.hpp" namespace cpu_attention { enum class ISA { AMX, VEC, VEC16, NEON }; template <ISA isa, typename scalar_t, int64_t hea...
#ifndef CPU_ATTN_HPP #define CPU_ATTN_HPP #include <type_traits> #include <cstddef> #if defined(__APPLE__) #include <sys/sysctl.h> #endif #include "cpu/cpu_arch_macros.h" #include "cpu/utils.hpp" namespace cpu_attention { enum class ISA { AMX, VEC, VEC16, NEON, VXE }; template <ISA isa, typename scalar_t, int64_...
--- csrc/cpu/cpu_attn_impl.hpp +++ csrc/cpu/cpu_attn_impl.hpp @@ -12,7 +12,7 @@ #include "cpu/utils.hpp" namespace cpu_attention { -enum class ISA { AMX, VEC, VEC16, NEON }; +enum class ISA { AMX, VEC, VEC16, NEON, VXE }; template <ISA isa, typename scalar_t, int64_t head_dim> class AttentionImpl {};
1
1
4
[]
[ "CPU" ]
[]
Optimize this cpp kernel file from vllm (csrc/cpu/cpu_attn_impl.hpp). Goal: [CPU][Perf] Accelerate Attention head for s390x using vector intrinsics Target hardware: CPU Target models: unspecified Current file: ```cpp #ifndef CPU_ATTN_HPP #define CPU_ATTN_HPP #include <type_traits> #include <cstddef> #if defined(__A...
## Purpose Accelerate paged attention GEMMs (QK, PV) on s390x with vector intrinsics This PR accelerates `cpu_attention_with_kv_cache `on s390x by introducing VXE (Vector Extension Facility) optimized GEMM kernels for both QK and PV attention phases. The vectorized implementation significantly improves token generation...
[]
null
null
vllm
22a97e66134a26c74b9dae73d9446c4e32718269
2026-02-23T19:01:28-05:00
34,846
https://github.com/vllm-project/vllm/pull/34846
[Perf] Improve default triton fused moe configs (#34846)
[Perf] Improve default triton fused moe configs (#34846) Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: Robert Shaw <114415538+robertgshaw2-redhat@users.noreply.github.com>
vllm/model_executor/layers/fused_moe/fused_moe.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Fused MoE Triton kernels.""" import functools import json import os from collections.abc import Callable from typing import Any import torch import vllm.envs as envs import vllm.model_executor.layers.fused_m...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Fused MoE Triton kernels.""" import functools import json import os from collections.abc import Callable from typing import Any import torch import vllm.envs as envs import vllm.model_executor.layers.fused_m...
--- vllm/model_executor/layers/fused_moe/fused_moe.py +++ vllm/model_executor/layers/fused_moe/fused_moe.py @@ -1233,28 +1233,31 @@ block_shape: list[int] | None = None, ) -> dict[str, int]: if vllm_is_batch_invariant(): - config = { + return { "BLOCK_SIZE_M": 64, "BLO...
56
22
1
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/fused_moe/fused_moe.py). Goal: [Perf] Improve default triton fused moe configs Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors t...
<!-- markdownlint-disable --> ## Purpose Improve the default Triton fused MoE kernel configs when no tuned config file is available. The old defaults were chosen without much consideration: `BLOCK_SIZE_K=32` matched <1% of tuned configs, `num_warps`/`num_stages` were never set, and there was no batch-size awareness. ...
[{"scope": "kernel", "hardware": "H100", "model": "Mixtral", "shape": "E=8,N=7168,K=4096,topk=2", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 267.13, "optimized": 251.48, "stated_speedup": 0.94, "speedup": 1.0622}, {"scope": "kernel", "hardware": "H100", "model": "Mixtral"...
0.99
null
vllm
8435b2e0492525b2ae7361b7f0081febb483bb34
2026-02-23T09:02:26-05:00
34,302
https://github.com/vllm-project/vllm/pull/34302
[ModelBash][DSV3] Add TRTLLM DSV3 Router GEMM kernel (6% B1 Speedup) (#34302)
[ModelBash][DSV3] Add TRTLLM DSV3 Router GEMM kernel (6% B1 Speedup) (#34302) Signed-off-by: Robert Shaw <robshaw@redhat.com> Co-authored-by: Robert Shaw <robshaw@redhat.com>
csrc/moe/moe_ops.h
cpp
Apache-2.0
#pragma once #include <torch/all.h> void topk_softmax(torch::Tensor& topk_weights, torch::Tensor& topk_indices, torch::Tensor& token_expert_indices, torch::Tensor& gating_output, bool renormalize, std::optional<torch::Tensor> bias); void topk_sigmoid(torch::Tenso...
#pragma once #include <torch/all.h> void topk_softmax(torch::Tensor& topk_weights, torch::Tensor& topk_indices, torch::Tensor& token_expert_indices, torch::Tensor& gating_output, bool renormalize, std::optional<torch::Tensor> bias); void topk_sigmoid(torch::Tenso...
--- csrc/moe/moe_ops.h +++ csrc/moe/moe_ops.h @@ -56,3 +56,14 @@ void shuffle_rows(const torch::Tensor& input_tensor, const torch::Tensor& dst2src_map, torch::Tensor& output_tensor); + +#ifndef USE_ROCM +// DeepSeek V3 optimized router GEMM kernel for SM90+ +// Computes output = m...
11
0
2
[ "deepseek" ]
[]
[]
Optimize this cpp kernel file from vllm (csrc/moe/moe_ops.h). Goal: [ModelBash][DSV3] Add TRTLLM DSV3 Router GEMM kernel (6% B1 Speedup) Target hardware: unspecified Target models: deepseek Current file: ```cpp #pragma once #include <torch/all.h> void topk_softmax(torch::Tensor& topk_weights, torch::Tensor& topk_in...
Port the optimized router GEMM kernel from sglang's sgl-kernel for DeepSeek V3 MoE models. This kernel is specifically optimized for small batch sizes (1-16 tokens) common in decode phase. The kernel is originally adapted from TRTLLM. - original PR: https://github.com/sgl-project/sglang/pull/7627/changes Key features:...
[{"scope": "e2e", "hardware": null, "model": "DeepSeek-V3", "shape": "hidden_dim=7168,num_experts=256/384", "batch_size": 1, "metric": "output token throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 109.58, "optimized": 115.65, "stated_speedup": null, "speedup": 1.0554}, {"scope": "e2e", "hardware": n...
1.06
1.0554
vllm
8435b2e0492525b2ae7361b7f0081febb483bb34
2026-02-23T09:02:26-05:00
34,302
https://github.com/vllm-project/vllm/pull/34302
[ModelBash][DSV3] Add TRTLLM DSV3 Router GEMM kernel (6% B1 Speedup) (#34302)
[ModelBash][DSV3] Add TRTLLM DSV3 Router GEMM kernel (6% B1 Speedup) (#34302) Signed-off-by: Robert Shaw <robshaw@redhat.com> Co-authored-by: Robert Shaw <robshaw@redhat.com>
csrc/moe/torch_bindings.cpp
cpp
Apache-2.0
#include "core/registration.h" #include "moe_ops.h" TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, m) { // Apply topk softmax to the gating outputs. m.def( "topk_softmax(Tensor! topk_weights, Tensor! topk_indices, Tensor! " "token_expert_indices, Tensor gating_output, bool renormalize, Tensor? " "bia...
#include "core/registration.h" #include "moe_ops.h" TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, m) { // Apply topk softmax to the gating outputs. m.def( "topk_softmax(Tensor! topk_weights, Tensor! topk_indices, Tensor! " "token_expert_indices, Tensor gating_output, bool renormalize, Tensor? " "bia...
--- csrc/moe/torch_bindings.cpp +++ csrc/moe/torch_bindings.cpp @@ -124,6 +124,10 @@ "routed_scaling_factor, Tensor bias, int scoring_func) -> (Tensor, " "Tensor)"); m.impl("grouped_topk", torch::kCUDA, &grouped_topk); + + // DeepSeek V3 optimized router GEMM for SM90+ + m.def("dsv3_router_gemm(Tenso...
4
0
2
[ "deepseek" ]
[]
[]
Optimize this cpp kernel file from vllm (csrc/moe/torch_bindings.cpp). Goal: [ModelBash][DSV3] Add TRTLLM DSV3 Router GEMM kernel (6% B1 Speedup) Target hardware: unspecified Target models: deepseek Current file: ```cpp #include "core/registration.h" #include "moe_ops.h" TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, m)...
Port the optimized router GEMM kernel from sglang's sgl-kernel for DeepSeek V3 MoE models. This kernel is specifically optimized for small batch sizes (1-16 tokens) common in decode phase. The kernel is originally adapted from TRTLLM. - original PR: https://github.com/sgl-project/sglang/pull/7627/changes Key features:...
[{"scope": "e2e", "hardware": null, "model": "DeepSeek-V3", "shape": "hidden_dim=7168,num_experts=256/384", "batch_size": 1, "metric": "output token throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 109.58, "optimized": 115.65, "stated_speedup": null, "speedup": 1.0554}, {"scope": "e2e", "hardware": n...
1.06
1.0554
vllm
2aab2bb54366c5a26add1b07f107b86f7fe28ff5
2026-02-20T20:32:05-08:00
34,541
https://github.com/vllm-project/vllm/pull/34541
[ROCM] Optimize ROCM_AITER_FA spec decode eagle performance (#34541)
[ROCM] Optimize ROCM_AITER_FA spec decode eagle performance (#34541) Signed-off-by: jennyyyyzhen <yzhen@hmc.edu>
vllm/v1/attention/backends/rocm_aiter_fa.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Attention layer with AiterFlashAttention.""" from dataclasses import dataclass from typing import ClassVar import torch from vllm._aiter_ops import rocm_aiter_ops from vllm.config import VllmConfig, get_laye...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Attention layer with AiterFlashAttention.""" from dataclasses import dataclass from typing import ClassVar import torch from vllm._aiter_ops import rocm_aiter_ops from vllm.config import VllmConfig, get_laye...
--- vllm/v1/attention/backends/rocm_aiter_fa.py +++ vllm/v1/attention/backends/rocm_aiter_fa.py @@ -396,8 +396,7 @@ class AiterFlashAttentionMetadataBuilder( AttentionMetadataBuilder[AiterFlashAttentionMetadata] ): - _cudagraph_support = AttentionCGSupport.UNIFORM_SINGLE_TOKEN_DECODE - reorder_batch_thresh...
50
2
1
[]
[ "ROCM" ]
[]
Optimize this triton kernel file from vllm (vllm/v1/attention/backends/rocm_aiter_fa.py). Goal: [ROCM] Optimize ROCM_AITER_FA spec decode eagle performance Target hardware: ROCM Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to...
## Purpose This PR has dependency on #32877, which fixes accuracy issue of rocm aiter fa. **Changes:** - Change cudagraph_support to UNIFORM_BATCH to support decode cudagraph when num_speculative_tokens >0 - Override build_for_drafting and remove cpu-gpu sync, so cudagraph can also work for draft model. **Trace** Be...
[]
null
null
vllm
b1c4f0b26548d36fca304b298957e4791eafa09b
2026-02-20T01:34:45-08:00
34,206
https://github.com/vllm-project/vllm/pull/34206
[Kernel] Optimize grouped topk kernel (#34206)
[Kernel] Optimize grouped topk kernel (#34206) Signed-off-by: Xin Yang <xyangx@amazon.com>
csrc/moe/grouped_topk_kernels.cu
cuda
Apache-2.0
/* * Adapted from * https://github.com/NVIDIA/TensorRT-LLM/blob/v0.21.0/cpp/tensorrt_llm/kernels/noAuxTcKernels.cu * Copyright (c) 2025, The vLLM team. * SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & * AFFILIATES. All rights reserved. SPDX-License-Identifier: Apache-2.0 * * Licensed under ...
/* * Adapted from * https://github.com/NVIDIA/TensorRT-LLM/blob/v1.3.0rc2/cpp/tensorrt_llm/kernels/noAuxTcKernels.cu * Copyright (c) 2025, The vLLM team. * SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & * AFFILIATES. All rights reserved. SPDX-License-Identifier: Apache-2.0 * * Licensed unde...
--- csrc/moe/grouped_topk_kernels.cu +++ csrc/moe/grouped_topk_kernels.cu @@ -1,6 +1,6 @@ /* * Adapted from - * https://github.com/NVIDIA/TensorRT-LLM/blob/v0.21.0/cpp/tensorrt_llm/kernels/noAuxTcKernels.cu + * https://github.com/NVIDIA/TensorRT-LLM/blob/v1.3.0rc2/cpp/tensorrt_llm/kernels/noAuxTcKernels.cu * Copyr...
375
96
1
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/moe/grouped_topk_kernels.cu). Goal: [Kernel] Optimize grouped topk kernel Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Adapted from * https://github.com/NVIDIA/TensorRT-LLM/blob/v0.21.0/cpp/tensorrt_llm/kernels/noAuxTcKernels.cu *...
## Purpose This PR add grouped topk kernel optimized for small expert count (num_experts<=512 for single group, or num_experts<=256 for multi group), which covers DeepSeek (num_experts=256, n_group=8), Kimi-K2.5 (num_experts=384, n_group=1), Nemotron (num_experts=512, n_group=1) etc. For large expert count, fall back...
[{"scope": "kernel", "hardware": "H200", "model": "DeepSeek-R1", "shape": "num_experts=256, n_group=8", "batch_size": null, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 7, "optimized": 4, "stated_speedup": null, "speedup": 1.75}, {"scope": "e2e", "hardware": null, "model": "DeepSeek-R1", "s...
1.75
1.0156
vllm
6874638bc443ae99ee900072e0bb039fa5f7f0e7
2026-02-18T10:42:36-05:00
34,758
https://github.com/vllm-project/vllm/pull/34758
[Model Bash] DeepSeek R1 BF16 Min Latency QKV A GEMM (0.5% E2E Speedup) (#34758)
[Model Bash] DeepSeek R1 BF16 Min Latency QKV A GEMM (0.5% E2E Speedup) (#34758) Signed-off-by: Robert Shaw <robshaw@redhat.com> Co-authored-by: Robert Shaw <robshaw@redhat.com>
csrc/ops.h
cpp
Apache-2.0
#pragma once #include <optional> #include <torch/library.h> #include <tuple> #include "core/scalar_type.hpp" #include <vector> torch::Tensor weak_ref_tensor(torch::Tensor& tensor) { // Ensure tensor is on CUDA if (!tensor.is_cuda()) { throw std::runtime_error("Tensor must be on CUDA device"); } // Get ...
#pragma once #include <optional> #include <torch/library.h> #include <tuple> #include "core/scalar_type.hpp" #include <vector> torch::Tensor weak_ref_tensor(torch::Tensor& tensor) { // Ensure tensor is on CUDA if (!tensor.is_cuda()) { throw std::runtime_error("Tensor must be on CUDA device"); } // Get ...
--- csrc/ops.h +++ csrc/ops.h @@ -410,3 +410,8 @@ int64_t quant_level, bool cast_bf2half = false); int64_t qr_max_size(); #endif + +#ifndef USE_ROCM +void dsv3_fused_a_gemm(torch::Tensor& output, torch::Tensor const& mat_a, + torch::Tensor const& mat_b); +#endif
5
0
3
[ "deepseek" ]
[]
[]
Optimize this cpp kernel file from vllm (csrc/ops.h). Goal: [Model Bash] DeepSeek R1 BF16 Min Latency QKV A GEMM (0.5% E2E Speedup) Target hardware: unspecified Target models: deepseek Current file: ```cpp #pragma once #include <optional> #include <torch/library.h> #include <tuple> #include "core/scalar_type.hpp" ...
## Purpose - add min latency bf16 qkv_a_gemm - adapted from sgl: * https://github.com/sgl-project/sglang/blob/main/sgl-kernel/csrc/gemm/dsv3_fused_a_gemm.cu, which adapted from trtllm - disappointing E2E win, but sets up using PDL to overlap with AR in future PR ## Test Plan - lm eval ```bash local-completions ({'mod...
[]
null
null
vllm
6874638bc443ae99ee900072e0bb039fa5f7f0e7
2026-02-18T10:42:36-05:00
34,758
https://github.com/vllm-project/vllm/pull/34758
[Model Bash] DeepSeek R1 BF16 Min Latency QKV A GEMM (0.5% E2E Speedup) (#34758)
[Model Bash] DeepSeek R1 BF16 Min Latency QKV A GEMM (0.5% E2E Speedup) (#34758) Signed-off-by: Robert Shaw <robshaw@redhat.com> Co-authored-by: Robert Shaw <robshaw@redhat.com>
csrc/torch_bindings.cpp
cpp
Apache-2.0
#include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> #include <torch/version.h> // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only /...
#include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> #include <torch/version.h> // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only /...
--- csrc/torch_bindings.cpp +++ csrc/torch_bindings.cpp @@ -239,6 +239,11 @@ // Quantization ops #ifndef USE_ROCM + // DeepSeek V3 fused A GEMM (SM 9.0+, bf16 only, 1-16 tokens). + ops.def( + "dsv3_fused_a_gemm(Tensor! output, Tensor mat_a, Tensor mat_b) -> ()"); + ops.impl("dsv3_fused_a_gemm", torch::kCU...
5
0
3
[ "deepseek" ]
[]
[]
Optimize this cpp kernel file from vllm (csrc/torch_bindings.cpp). Goal: [Model Bash] DeepSeek R1 BF16 Min Latency QKV A GEMM (0.5% E2E Speedup) Target hardware: unspecified Target models: deepseek Current file: ```cpp #include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #includ...
## Purpose - add min latency bf16 qkv_a_gemm - adapted from sgl: * https://github.com/sgl-project/sglang/blob/main/sgl-kernel/csrc/gemm/dsv3_fused_a_gemm.cu, which adapted from trtllm - disappointing E2E win, but sets up using PDL to overlap with AR in future PR ## Test Plan - lm eval ```bash local-completions ({'mod...
[]
null
null
vllm
b68fd899d1317259d61d8bbaf79dcb2749d17634
2026-02-17T09:58:49+08:00
34,507
https://github.com/vllm-project/vllm/pull/34507
[Bugfix] Fix fused MoE int32 overflow in stride*offset without perf regression (#34507)
[Bugfix] Fix fused MoE int32 overflow in stride*offset without perf regression (#34507) Signed-off-by: haosdent <haosdent@gmail.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>
vllm/model_executor/layers/fused_moe/fused_moe.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Fused MoE Triton kernels.""" import functools import json import os from collections.abc import Callable from typing import Any import torch import vllm.envs as envs import vllm.model_executor.layers.fused_m...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Fused MoE Triton kernels.""" import functools import json import os from collections.abc import Callable from typing import Any import torch import vllm.envs as envs import vllm.model_executor.layers.fused_m...
--- vllm/model_executor/layers/fused_moe/fused_moe.py +++ vllm/model_executor/layers/fused_moe/fused_moe.py @@ -175,7 +175,8 @@ if pid_m * BLOCK_SIZE_M >= num_tokens_post_padded: return offs_token_id = pid_m * BLOCK_SIZE_M + tl.arange(0, BLOCK_SIZE_M).to(tl.int64) - offs_token = tl.load(sorted_tok...
5
1
1
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/fused_moe/fused_moe.py). Goal: [Bugfix] Fix fused MoE int32 overflow in stride*offset without perf regression Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrigh...
## Purpose Fixes #34413 PR #34279 annotated all stride parameters as tl.int64 to fix an int32 overflow crash, but this caused ~60x perf regression on small GPUs (e.g. NVIDIA GB10) due to register pressure. PR #34530 reverted that fix. This patch prevents the overflow with minimal register impact by casting offs_toke...
[]
null
null
vllm
afdce12c89555ce7b7bd4f3215b5d844de0a32ed
2026-02-10T16:29:52+01:00
33,680
https://github.com/vllm-project/vllm/pull/33680
[Perf][Kernel] Add faster topKperRow decode kernel for DeepSeek-V3.2 sparse attention (#33680)
[Perf][Kernel] Add faster topKperRow decode kernel for DeepSeek-V3.2 sparse attention (#33680) Signed-off-by: LopezCastroRoberto <rocastro@redhat.com> Signed-off-by: Roberto L. Castro <38211239+LopezCastroRoberto@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
csrc/ops.h
cpp
Apache-2.0
#pragma once #include <optional> #include <torch/library.h> #include <tuple> #include "core/scalar_type.hpp" #include <vector> torch::Tensor weak_ref_tensor(torch::Tensor& tensor) { // Ensure tensor is on CUDA if (!tensor.is_cuda()) { throw std::runtime_error("Tensor must be on CUDA device"); } // Get ...
#pragma once #include <optional> #include <torch/library.h> #include <tuple> #include "core/scalar_type.hpp" #include <vector> torch::Tensor weak_ref_tensor(torch::Tensor& tensor) { // Ensure tensor is on CUDA if (!tensor.is_cuda()) { throw std::runtime_error("Tensor must be on CUDA device"); } // Get ...
--- csrc/ops.h +++ csrc/ops.h @@ -114,6 +114,10 @@ int64_t numRows, int64_t stride0, int64_t stride1, int64_t topK); +void large_context_topk(const torch::Tensor& score, torch::Tensor& indices, + const torch::Tensor& lengths, + ...
4
0
5
[ "deepseek" ]
[]
[]
Optimize this cpp kernel file from vllm (csrc/ops.h). Goal: [Perf][Kernel] Add faster topKperRow decode kernel for DeepSeek-V3.2 sparse attention Target hardware: unspecified Target models: deepseek Current file: ```cpp #pragma once #include <optional> #include <torch/library.h> #include <tuple> #include "core/scal...
## Summary This PR adds an optimized top-k per-row decode kernel for DeepSeek-V3.2 sparse attention (K = 2048). The new kernel replaces vLLM’s native `top_k_per_row_decode` in the decode path for long-context inference. It uses a 5-pass radix selection algorithm optimized for large-K workloads and long sequence lengths...
[{"scope": "e2e", "hardware": "NVIDIA B200", "model": "nvidia/DeepSeek-V3.2-NVFP4", "shape": "input-len=131072,output-len=2048", "batch_size": 1, "metric": "Output token throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 63.95, "optimized": 68.29, "stated_speedup": null, "speedup": 1.0679}, {"scope": "...
null
1.0685
vllm
afdce12c89555ce7b7bd4f3215b5d844de0a32ed
2026-02-10T16:29:52+01:00
33,680
https://github.com/vllm-project/vllm/pull/33680
[Perf][Kernel] Add faster topKperRow decode kernel for DeepSeek-V3.2 sparse attention (#33680)
[Perf][Kernel] Add faster topKperRow decode kernel for DeepSeek-V3.2 sparse attention (#33680) Signed-off-by: LopezCastroRoberto <rocastro@redhat.com> Signed-off-by: Roberto L. Castro <38211239+LopezCastroRoberto@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
csrc/torch_bindings.cpp
cpp
Apache-2.0
#include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> #include <torch/version.h> // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only /...
#include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> #include <torch/version.h> // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only /...
--- csrc/torch_bindings.cpp +++ csrc/torch_bindings.cpp @@ -189,6 +189,12 @@ "Tensor seq_lens, Tensor! indices, " "int numRows, int stride0, int stride1, int topK) -> ()"); ops.impl("top_k_per_row_decode", torch::kCUDA, &top_k_per_row_decode); + + ops.def( + "large_context_topk(Tensor score, Tens...
6
0
5
[ "deepseek" ]
[]
[]
Optimize this cpp kernel file from vllm (csrc/torch_bindings.cpp). Goal: [Perf][Kernel] Add faster topKperRow decode kernel for DeepSeek-V3.2 sparse attention Target hardware: unspecified Target models: deepseek Current file: ```cpp #include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registrati...
## Summary This PR adds an optimized top-k per-row decode kernel for DeepSeek-V3.2 sparse attention (K = 2048). The new kernel replaces vLLM’s native `top_k_per_row_decode` in the decode path for long-context inference. It uses a 5-pass radix selection algorithm optimized for large-K workloads and long sequence lengths...
[{"scope": "e2e", "hardware": "NVIDIA B200", "model": "nvidia/DeepSeek-V3.2-NVFP4", "shape": "input-len=131072,output-len=2048", "batch_size": 1, "metric": "Output token throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 63.95, "optimized": 68.29, "stated_speedup": null, "speedup": 1.0679}, {"scope": "...
null
1.0685
vllm
179ae7da8f48f76b0db4dc3e331153b24a36a96a
2026-02-09T00:13:24+08:00
33,771
https://github.com/vllm-project/vllm/pull/33771
[Revert] Fix performance regression for GLM-4.7-GPTQ decode and MTP acceptance rate (#33771)
[Revert] Fix performance regression for GLM-4.7-GPTQ decode and MTP acceptance rate (#33771) Signed-off-by: aabbccddwasd <aabbccddwasd@qq.com>
vllm/v1/attention/backends/flashinfer.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Attention layer with FlashInfer.""" from dataclasses import dataclass from typing import ClassVar import numpy as np import torch from flashinfer import ( BatchDecodeWithPagedKVCacheWrapper, BatchPref...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Attention layer with FlashInfer.""" from dataclasses import dataclass from typing import ClassVar import numpy as np import torch from flashinfer import ( BatchDecodeWithPagedKVCacheWrapper, BatchPref...
--- vllm/v1/attention/backends/flashinfer.py +++ vllm/v1/attention/backends/flashinfer.py @@ -919,9 +919,7 @@ # Guard access to seq_lens_cpu, which may not always be needed # and can be expensive to retrieve in async mode. needs_seq_lens_cpu = self.use_dcp or use_cascade or not is_only_trtllm...
1
3
1
[ "glm" ]
[]
[]
Optimize this triton kernel file from vllm (vllm/v1/attention/backends/flashinfer.py). Goal: [Revert] Fix performance regression for GLM-4.7-GPTQ decode and MTP acceptance rate Target hardware: unspecified Target models: glm Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyr...
## Purpose Fix performance regressions introduced by two recent commits: - `e0327c9db` (#31773) - Decode performance regression ~~- `654a71fc3` (#32805) - MTP (Multi-Token Prediction) acceptance rate regression~~ **Affected Model:** GLM-4.7-GPTQ-INT4-INT8MIX - Model body: int4/int8 mixed quantization - MT...
[{"scope": "e2e", "hardware": "4\u00d7RTX PRO 6000 BLACKWELL", "model": "GLM-4.7-GPTQ-INT4-INT8MIX", "shape": "MTP module in BF16", "batch_size": null, "metric": "throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 77, "optimized": 95, "stated_speedup": null, "speedup": 1.2338}]
null
1.2338
vllm
ed17f54c8bccc2f1a19f83f65b36d837698b8792
2026-02-07T05:33:11-08:00
33,493
https://github.com/vllm-project/vllm/pull/33493
Perf tuning and expansion of cases covered for wvSplitKrc (#33493)
Perf tuning and expansion of cases covered for wvSplitKrc (#33493) Signed-off-by: Hashem Hashemi <hashem.hashemi@amd.com>
csrc/rocm/skinny_gemms.cu
cuda
Apache-2.0
#include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <cuda_runtime.h> #include <cuda_fp16.h> #include <cuda_bf16.h> #include <stdexcept> #include <algorithm> #include "../cuda_compat.h" #include "dispatch_utils.h" #include "quantization/w8a8/fp8/common.cuh" // TODO(rasm...
#include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <cuda_runtime.h> #include <cuda_fp16.h> #include <cuda_bf16.h> #include <stdexcept> #include <algorithm> #include "../cuda_compat.h" #include "dispatch_utils.h" #include "quantization/w8a8/fp8/common.cuh" // TODO(rasm...
--- csrc/rocm/skinny_gemms.cu +++ csrc/rocm/skinny_gemms.cu @@ -1365,13 +1365,12 @@ return out_c; } -#if defined(__gfx950__) // TODO: Add NAVI support - // This version targets big A[] cases, where it is much larger than LDS - // capacity +// This version targets cases skinny where CUs are not filled +// Wave-...
144
185
2
[]
[ "ROCM" ]
[]
Optimize this cuda kernel file from vllm (csrc/rocm/skinny_gemms.cu). Goal: Perf tuning and expansion of cases covered for wvSplitKrc Target hardware: ROCM Target models: unspecified Current file: ```cuda #include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <cuda_runtime...
<!-- markdownlint-disable --> mi355 measurements before and after changes: m, n, K , bfor(us), aftr (us) 128, 16, 2880, 4.55, 4.56 640, 16, 2880, 4.80, 4.83 128, 32, 2880, 3.91, **3.21** 640, 32, 2880, 4.13, 4.05 128, 64, 2880, 4.42, **3.23** 640, 64, 2880, 4.88, **4.43** 128, 128, 2880, 4.51, **3.98** 640, 128, ...
[]
null
null
vllm
1363e3d6d5659b58376fa5284afc2c8be548cc9d
2026-02-06T07:01:48Z
32,263
https://github.com/vllm-project/vllm/pull/32263
[cpu][performance] CPU Paged Attention NEON BFMMLA BF16 Implementation (#32263)
[cpu][performance] CPU Paged Attention NEON BFMMLA BF16 Implementation (#32263) Signed-off-by: Gassan <gassan.salama@arm.com>
csrc/cpu/cpu_attn_impl.hpp
cpp
Apache-2.0
#ifndef CPU_ATTN_HPP #define CPU_ATTN_HPP #include <type_traits> #include <cstddef> #if defined(__APPLE__) #include <sys/sysctl.h> #endif #include "cpu/cpu_arch_macros.h" #include "cpu/utils.hpp" namespace cpu_attention { enum class ISA { AMX, VEC, VEC16, NEON }; template <ISA isa, typename scalar_t, int64_t hea...
#ifndef CPU_ATTN_HPP #define CPU_ATTN_HPP #include <type_traits> #include <cstddef> #if defined(__APPLE__) #include <sys/sysctl.h> #endif #include "cpu/cpu_arch_macros.h" #include "cpu/utils.hpp" namespace cpu_attention { enum class ISA { AMX, VEC, VEC16, NEON }; template <ISA isa, typename scalar_t, int64_t hea...
--- csrc/cpu/cpu_attn_impl.hpp +++ csrc/cpu/cpu_attn_impl.hpp @@ -1107,7 +1107,8 @@ if (sliding_window_left != -1) { pos = std::max(pos, curr_token_pos - sliding_window_left); } - return pos; + // Clamp to tile end to avoid OOB when window starts past the tile + ...
2
1
3
[]
[ "CPU" ]
[]
Optimize this cpp kernel file from vllm (csrc/cpu/cpu_attn_impl.hpp). Goal: [cpu][performance] CPU Paged Attention NEON BFMMLA BF16 Implementation Target hardware: CPU Target models: unspecified Current file: ```cpp #ifndef CPU_ATTN_HPP #define CPU_ATTN_HPP #include <type_traits> #include <cstddef> #if defined(__AP...
<!-- markdownlint-disable --> ## Purpose CPU Paged Attention NEON BFMMLA BF16 Implementation Co-authored-by: GitHub Copilot ## Test Results Using: https://github.com/vllm-project/vllm/pull/31720 Benchmark Suite, Against Current NEON Implementation: **Prefill: 2.32x Decode: 2.07x** cc. @aditew01 @fadara01
[{"scope": "kernel", "hardware": null, "model": null, "shape": null, "batch_size": null, "metric": "performance", "unit": null, "higher_is_better": true, "baseline": null, "optimized": null, "stated_speedup": 2.32, "speedup": 2.32}, {"scope": "kernel", "hardware": null, "model": null, "shape": null, "batch_size": null,...
2.195
null
vllm
1363e3d6d5659b58376fa5284afc2c8be548cc9d
2026-02-06T07:01:48Z
32,263
https://github.com/vllm-project/vllm/pull/32263
[cpu][performance] CPU Paged Attention NEON BFMMLA BF16 Implementation (#32263)
[cpu][performance] CPU Paged Attention NEON BFMMLA BF16 Implementation (#32263) Signed-off-by: Gassan <gassan.salama@arm.com>
csrc/cpu/cpu_attn_neon.hpp
cpp
Apache-2.0
#ifndef CPU_ATTN_NEON_HPP #define CPU_ATTN_NEON_HPP #include "cpu_attn_impl.hpp" #include <arm_neon.h> #include <type_traits> namespace cpu_attention { namespace { #define BLOCK_SIZE_ALIGNMENT 32 #define HEAD_SIZE_ALIGNMENT 32 #define MAX_Q_HEAD_NUM_PER_ITER 16 // These do not use vectorized class for loading / con...
#ifndef CPU_ATTN_NEON_HPP #define CPU_ATTN_NEON_HPP #include "cpu_attn_impl.hpp" #include <arm_neon.h> #include <type_traits> #ifdef ARM_BF16_SUPPORT #include "cpu_attn_neon_bfmmla.hpp" #endif namespace cpu_attention { namespace { #define BLOCK_SIZE_ALIGNMENT 32 #define HEAD_SIZE_ALIGNMENT 32 #define MAX_Q_HEAD_NU...
--- csrc/cpu/cpu_attn_neon.hpp +++ csrc/cpu/cpu_attn_neon.hpp @@ -4,6 +4,9 @@ #include "cpu_attn_impl.hpp" #include <arm_neon.h> #include <type_traits> +#ifdef ARM_BF16_SUPPORT + #include "cpu_attn_neon_bfmmla.hpp" +#endif namespace cpu_attention { namespace { @@ -57,7 +60,7 @@ #endif } -// Mx8, with 1 <= M...
17
2
3
[]
[ "CPU" ]
[]
Optimize this cpp kernel file from vllm (csrc/cpu/cpu_attn_neon.hpp). Goal: [cpu][performance] CPU Paged Attention NEON BFMMLA BF16 Implementation Target hardware: CPU Target models: unspecified Current file: ```cpp #ifndef CPU_ATTN_NEON_HPP #define CPU_ATTN_NEON_HPP #include "cpu_attn_impl.hpp" #include <arm_neon.h...
<!-- markdownlint-disable --> ## Purpose CPU Paged Attention NEON BFMMLA BF16 Implementation Co-authored-by: GitHub Copilot ## Test Results Using: https://github.com/vllm-project/vllm/pull/31720 Benchmark Suite, Against Current NEON Implementation: **Prefill: 2.32x Decode: 2.07x** cc. @aditew01 @fadara01
[{"scope": "kernel", "hardware": null, "model": null, "shape": null, "batch_size": null, "metric": "performance", "unit": null, "higher_is_better": true, "baseline": null, "optimized": null, "stated_speedup": 2.32, "speedup": 2.32}, {"scope": "kernel", "hardware": null, "model": null, "shape": null, "batch_size": null,...
2.195
null
vllm
d5c4800112c12bbcd4955858ef1b415c16ae16e7
2026-02-05T14:16:02-08:00
33,527
https://github.com/vllm-project/vllm/pull/33527
Adds padding and perf improvements to wvSplitK_fp8 (#33527)
Adds padding and perf improvements to wvSplitK_fp8 (#33527) Signed-off-by: Hashem Hashemi <hashem.hashemi@amd.com>
csrc/rocm/skinny_gemms.cu
cuda
Apache-2.0
#include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <cuda_runtime.h> #include <cuda_fp16.h> #include <cuda_bf16.h> #include <stdexcept> #include <algorithm> #include "../cuda_compat.h" #include "dispatch_utils.h" #include "quantization/w8a8/fp8/common.cuh" // TODO(rasm...
#include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <cuda_runtime.h> #include <cuda_fp16.h> #include <cuda_bf16.h> #include <stdexcept> #include <algorithm> #include "../cuda_compat.h" #include "dispatch_utils.h" #include "quantization/w8a8/fp8/common.cuh" // TODO(rasm...
--- csrc/rocm/skinny_gemms.cu +++ csrc/rocm/skinny_gemms.cu @@ -1899,8 +1899,9 @@ template <typename scalar_t, typename fp8_t, int THRDS, int YTILE, int WvPrGrp, int A_CHUNK, int UNRL, int N> __global__ void __launch_bounds__(WvPrGrp* THRDS) - wvSplitKQ_hf_sml_(const int K, const int Kp, const int M, co...
129
177
2
[]
[ "ROCM" ]
[]
Optimize this cuda kernel file from vllm (csrc/rocm/skinny_gemms.cu). Goal: Adds padding and perf improvements to wvSplitK_fp8 Target hardware: ROCM Target models: unspecified Current file: ```cuda #include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <cuda_runtime.h> #in...
Adds activation padding support to wvSplitKQ. Additionally improves bias and dpp reduce perf. Expands test scenarios. ## Purpose ## Test Plan ## Test Result --- <details> <summary> Essential Elements of an Effective PR Description Checklist </summary> - [ ] The purpose of the PR, such as "Fix some issue (link exis...
[]
null
null
vllm
824058076c56164a3772a5f5829bd9662507e5a3
2026-02-04T15:20:52+04:00
33,291
https://github.com/vllm-project/vllm/pull/33291
[PERF] Change GDN Attention State Layout from [N, HV, K, V] to [N, HV, V, K] (#33291)
[PERF] Change GDN Attention State Layout from [N, HV, K, V] to [N, HV, V, K] (#33291) Signed-off-by: Vadim Gimpelson <vadim.gimpelson@gmail.com>
vllm/model_executor/layers/fla/ops/chunk_delta_h.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Songlin Yang, Yu Zhang # # This file contains code copied from the flash-linear-attention project. # The original source code was licensed under the MIT license and included # the followi...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Songlin Yang, Yu Zhang # # This file contains code copied from the flash-linear-attention project. # The original source code was licensed under the MIT license and included # the followi...
--- vllm/model_executor/layers/fla/ops/chunk_delta_h.py +++ vllm/model_executor/layers/fla/ops/chunk_delta_h.py @@ -81,70 +81,70 @@ NT = tl.cdiv(T, BT) boh = i_n * NT - # [BK, BV] - b_h1 = tl.zeros([64, BV], dtype=tl.float32) + # [BV, BK] + b_h1 = tl.zeros([BV, 64], dtype=tl.float32) ...
35
35
6
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/fla/ops/chunk_delta_h.py). Goal: [PERF] Change GDN Attention State Layout from [N, HV, K, V] to [N, HV, V, K] Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrigh...
## Summary This PR changes the recurrent state memory layout in GDN (Gated Delta Net) attention from `[N, HV, K, V]` to `[N, HV, V, K]` for improved memory access patterns and throughput. Behind speedup, also allows to use FI's GDN kernels ## Performance Results **Model**: `nvidia/Qwen3-Next-80B-A3B-Instruct-NVFP4`...
[{"scope": "e2e", "hardware": null, "model": "nvidia/Qwen3-Next-80B-A3B-Instruct-NVFP4", "shape": null, "batch_size": 1, "metric": "throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 199.58, "optimized": 201.37, "stated_speedup": null, "speedup": 1.009}, {"scope": "e2e", "hardware": null, "model": "nvi...
null
1.009
vllm
824058076c56164a3772a5f5829bd9662507e5a3
2026-02-04T15:20:52+04:00
33,291
https://github.com/vllm-project/vllm/pull/33291
[PERF] Change GDN Attention State Layout from [N, HV, K, V] to [N, HV, V, K] (#33291)
[PERF] Change GDN Attention State Layout from [N, HV, K, V] to [N, HV, V, K] (#33291) Signed-off-by: Vadim Gimpelson <vadim.gimpelson@gmail.com>
vllm/model_executor/layers/fla/ops/chunk_o.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Songlin Yang, Yu Zhang # # This file contains code copied from the flash-linear-attention project. # The original source code was licensed under the MIT license and included # the followi...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Songlin Yang, Yu Zhang # # This file contains code copied from the flash-linear-attention project. # The original source code was licensed under the MIT license and included # the followi...
--- vllm/model_executor/layers/fla/ops/chunk_o.py +++ vllm/model_executor/layers/fla/ops/chunk_o.py @@ -85,7 +85,7 @@ k += (bos * Hg + i_h // (H // Hg)) * K v += (bos * H + i_h) * V o += (bos * H + i_h) * V - h += (i_tg * H + i_h).to(tl.int64) * K * V + h += (i_tg * H + i_h).to(tl.int64) * V * K ...
4
4
6
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/fla/ops/chunk_o.py). Goal: [PERF] Change GDN Attention State Layout from [N, HV, K, V] to [N, HV, V, K] Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText:...
## Summary This PR changes the recurrent state memory layout in GDN (Gated Delta Net) attention from `[N, HV, K, V]` to `[N, HV, V, K]` for improved memory access patterns and throughput. Behind speedup, also allows to use FI's GDN kernels ## Performance Results **Model**: `nvidia/Qwen3-Next-80B-A3B-Instruct-NVFP4`...
[{"scope": "e2e", "hardware": null, "model": "nvidia/Qwen3-Next-80B-A3B-Instruct-NVFP4", "shape": null, "batch_size": 1, "metric": "throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 199.58, "optimized": 201.37, "stated_speedup": null, "speedup": 1.009}, {"scope": "e2e", "hardware": null, "model": "nvi...
null
1.009
vllm
824058076c56164a3772a5f5829bd9662507e5a3
2026-02-04T15:20:52+04:00
33,291
https://github.com/vllm-project/vllm/pull/33291
[PERF] Change GDN Attention State Layout from [N, HV, K, V] to [N, HV, V, K] (#33291)
[PERF] Change GDN Attention State Layout from [N, HV, K, V] to [N, HV, V, K] (#33291) Signed-off-by: Vadim Gimpelson <vadim.gimpelson@gmail.com>
vllm/model_executor/layers/fla/ops/fused_recurrent.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Songlin Yang, Yu Zhang # # This file contains code copied from the flash-linear-attention project. # The original source code was licensed under the MIT license and included # the followi...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Songlin Yang, Yu Zhang # # This file contains code copied from the flash-linear-attention project. # The original source code was licensed under the MIT license and included # the followi...
--- vllm/model_executor/layers/fla/ops/fused_recurrent.py +++ vllm/model_executor/layers/fla/ops/fused_recurrent.py @@ -97,9 +97,9 @@ mask_k = o_k < K mask_v = o_v < V - mask_h = mask_k[:, None] & mask_v[None, :] - - b_h = tl.zeros([BK, BV], dtype=tl.float32) + mask_h = mask_v[:, None] & mask_k[Non...
17
17
6
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/fla/ops/fused_recurrent.py). Goal: [PERF] Change GDN Attention State Layout from [N, HV, K, V] to [N, HV, V, K] Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyri...
## Summary This PR changes the recurrent state memory layout in GDN (Gated Delta Net) attention from `[N, HV, K, V]` to `[N, HV, V, K]` for improved memory access patterns and throughput. Behind speedup, also allows to use FI's GDN kernels ## Performance Results **Model**: `nvidia/Qwen3-Next-80B-A3B-Instruct-NVFP4`...
[{"scope": "e2e", "hardware": null, "model": "nvidia/Qwen3-Next-80B-A3B-Instruct-NVFP4", "shape": null, "batch_size": 1, "metric": "throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 199.58, "optimized": 201.37, "stated_speedup": null, "speedup": 1.009}, {"scope": "e2e", "hardware": null, "model": "nvi...
null
1.009
vllm
824058076c56164a3772a5f5829bd9662507e5a3
2026-02-04T15:20:52+04:00
33,291
https://github.com/vllm-project/vllm/pull/33291
[PERF] Change GDN Attention State Layout from [N, HV, K, V] to [N, HV, V, K] (#33291)
[PERF] Change GDN Attention State Layout from [N, HV, K, V] to [N, HV, V, K] (#33291) Signed-off-by: Vadim Gimpelson <vadim.gimpelson@gmail.com>
vllm/model_executor/layers/fla/ops/kda.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Songlin Yang, Yu Zhang # # This file contains code copied from the flash-linear-attention project. # The original source code was licensed under the MIT license and included # the followi...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Songlin Yang, Yu Zhang # # This file contains code copied from the flash-linear-attention project. # The original source code was licensed under the MIT license and included # the followi...
--- vllm/model_executor/layers/fla/ops/kda.py +++ vllm/model_executor/layers/fla/ops/kda.py @@ -55,7 +55,7 @@ if inplace_final_state: final_state = initial_state else: - final_state = q.new_empty(T, HV, K, V, dtype=initial_state.dtype) + final_state = q.new_empty(T, HV, V, K, dtype=init...
1
1
6
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/fla/ops/kda.py). Goal: [PERF] Change GDN Attention State Layout from [N, HV, K, V] to [N, HV, V, K] Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Cop...
## Summary This PR changes the recurrent state memory layout in GDN (Gated Delta Net) attention from `[N, HV, K, V]` to `[N, HV, V, K]` for improved memory access patterns and throughput. Behind speedup, also allows to use FI's GDN kernels ## Performance Results **Model**: `nvidia/Qwen3-Next-80B-A3B-Instruct-NVFP4`...
[{"scope": "e2e", "hardware": null, "model": "nvidia/Qwen3-Next-80B-A3B-Instruct-NVFP4", "shape": null, "batch_size": 1, "metric": "throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 199.58, "optimized": 201.37, "stated_speedup": null, "speedup": 1.009}, {"scope": "e2e", "hardware": null, "model": "nvi...
null
1.009
vllm
e69c990c216c623b1de22f055926602a336f9352
2026-02-03T04:17:56Z
30,329
https://github.com/vllm-project/vllm/pull/30329
[Feature][CPU Backend]: Optimize ARM vectorization backend (#30329)
[Feature][CPU Backend]: Optimize ARM vectorization backend (#30329) Signed-off-by: Radu Salavat <radu.salavat@arm.com>
csrc/cpu/cpu_attn_impl.hpp
cpp
Apache-2.0
#ifndef CPU_ATTN_HPP #define CPU_ATTN_HPP #include <type_traits> #include <cstddef> #if defined(__APPLE__) #include <sys/sysctl.h> #endif #include "cpu/cpu_arch_macros.h" #include "cpu/utils.hpp" namespace cpu_attention { enum class ISA { AMX, VEC, VEC16, NEON }; template <ISA isa, typename scalar_t, int64_t hea...
#ifndef CPU_ATTN_HPP #define CPU_ATTN_HPP #include <type_traits> #include <cstddef> #if defined(__APPLE__) #include <sys/sysctl.h> #endif #include "cpu/cpu_arch_macros.h" #include "cpu/utils.hpp" namespace cpu_attention { enum class ISA { AMX, VEC, VEC16, NEON }; template <ISA isa, typename scalar_t, int64_t hea...
--- csrc/cpu/cpu_attn_impl.hpp +++ csrc/cpu/cpu_attn_impl.hpp @@ -816,14 +816,10 @@ using vec_t = vec_op::FP32Vec16; }; -// ARM only supports BF16 with ARMv8.6-A extension -#if (defined(__aarch64__) && !defined(ARM_BF16_SUPPORT)) -#else template <> struct VecTypeTrait<c10::BFloat16> { using vec_t = vec_op::B...
0
11
5
[]
[ "CPU" ]
[]
Optimize this cpp kernel file from vllm (csrc/cpu/cpu_attn_impl.hpp). Goal: [Feature][CPU Backend]: Optimize ARM vectorization backend Target hardware: CPU Target models: unspecified Current file: ```cpp #ifndef CPU_ATTN_HPP #define CPU_ATTN_HPP #include <type_traits> #include <cstddef> #if defined(__APPLE__) #in...
## Purpose Implement vectorised backed based on `at::vec::Vectorized` for ARM, introduce highlevel FP32/FP16/BF16 vector wrappers and add new shared based class `VectorizedRegWrapper` capable of scaling with dtypes. - Implement ARM vectorisation based on `at::vec::Vectorized<T>` for `float`, `c10::Half` and `c10::BFlo...
[]
null
null
vllm
e69c990c216c623b1de22f055926602a336f9352
2026-02-03T04:17:56Z
30,329
https://github.com/vllm-project/vllm/pull/30329
[Feature][CPU Backend]: Optimize ARM vectorization backend (#30329)
[Feature][CPU Backend]: Optimize ARM vectorization backend (#30329) Signed-off-by: Radu Salavat <radu.salavat@arm.com>
csrc/cpu/dnnl_kernels.cpp
cpp
Apache-2.0
#include "cpu_types.hpp" #include "dnnl_helper.h" namespace { template <typename scalar_t> struct KernelVecType { using load_vec_type = void; using cvt_vec_type = void; }; template <> struct KernelVecType<float> { using load_vec_type = vec_op::FP32Vec16; using cvt_vec_type = vec_op::FP32Vec16; }; #if !define...
#include "cpu_types.hpp" #include "dnnl_helper.h" namespace { template <typename scalar_t> struct KernelVecType { using load_vec_type = void; using cvt_vec_type = void; }; template <> struct KernelVecType<float> { using load_vec_type = vec_op::FP32Vec16; using cvt_vec_type = vec_op::FP32Vec16; }; template <>...
--- csrc/cpu/dnnl_kernels.cpp +++ csrc/cpu/dnnl_kernels.cpp @@ -14,13 +14,11 @@ using cvt_vec_type = vec_op::FP32Vec16; }; -#if !defined(__aarch64__) || defined(ARM_BF16_SUPPORT) template <> struct KernelVecType<c10::BFloat16> { using load_vec_type = vec_op::BF16Vec16; using cvt_vec_type = vec_op::FP32Vec...
0
2
5
[]
[ "CPU" ]
[]
Optimize this cpp kernel file from vllm (csrc/cpu/dnnl_kernels.cpp). Goal: [Feature][CPU Backend]: Optimize ARM vectorization backend Target hardware: CPU Target models: unspecified Current file: ```cpp #include "cpu_types.hpp" #include "dnnl_helper.h" namespace { template <typename scalar_t> struct KernelVecType { ...
## Purpose Implement vectorised backed based on `at::vec::Vectorized` for ARM, introduce highlevel FP32/FP16/BF16 vector wrappers and add new shared based class `VectorizedRegWrapper` capable of scaling with dtypes. - Implement ARM vectorisation based on `at::vec::Vectorized<T>` for `float`, `c10::Half` and `c10::BFlo...
[]
null
null
vllm
e69c990c216c623b1de22f055926602a336f9352
2026-02-03T04:17:56Z
30,329
https://github.com/vllm-project/vllm/pull/30329
[Feature][CPU Backend]: Optimize ARM vectorization backend (#30329)
[Feature][CPU Backend]: Optimize ARM vectorization backend (#30329) Signed-off-by: Radu Salavat <radu.salavat@arm.com>
csrc/cpu/mla_decode.cpp
cpp
Apache-2.0
#include "cpu_types.hpp" #include <float.h> namespace { template <typename scalar_t> struct KernelVecType { using qk_load_vec_type = void; using qk_vec_type = void; using v_load_vec_type = void; }; template <> struct KernelVecType<float> { using qk_load_vec_type = vec_op::FP32Vec16; using qk_vec_type = vec_...
#include "cpu_types.hpp" #include <float.h> namespace { template <typename scalar_t> struct KernelVecType { using qk_load_vec_type = void; using qk_vec_type = void; using v_load_vec_type = void; }; template <> struct KernelVecType<float> { using qk_load_vec_type = vec_op::FP32Vec16; using qk_vec_type = vec_...
--- csrc/cpu/mla_decode.cpp +++ csrc/cpu/mla_decode.cpp @@ -38,9 +38,7 @@ using qk_vec_type = vec_op::BF16Vec32; using v_load_vec_type = vec_op::BF16Vec16; }; -#elif defined(__aarch64__) && !defined(ARM_BF16_SUPPORT) -// pass -#else +#elif defined(__aarch64__) template <> struct KernelVecType<c10::BFloat16> { ...
1
3
5
[]
[ "CPU" ]
[]
Optimize this cpp kernel file from vllm (csrc/cpu/mla_decode.cpp). Goal: [Feature][CPU Backend]: Optimize ARM vectorization backend Target hardware: CPU Target models: unspecified Current file: ```cpp #include "cpu_types.hpp" #include <float.h> namespace { template <typename scalar_t> struct KernelVecType { using ...
## Purpose Implement vectorised backed based on `at::vec::Vectorized` for ARM, introduce highlevel FP32/FP16/BF16 vector wrappers and add new shared based class `VectorizedRegWrapper` capable of scaling with dtypes. - Implement ARM vectorisation based on `at::vec::Vectorized<T>` for `float`, `c10::Half` and `c10::BFlo...
[]
null
null
vllm
e69c990c216c623b1de22f055926602a336f9352
2026-02-03T04:17:56Z
30,329
https://github.com/vllm-project/vllm/pull/30329
[Feature][CPU Backend]: Optimize ARM vectorization backend (#30329)
[Feature][CPU Backend]: Optimize ARM vectorization backend (#30329) Signed-off-by: Radu Salavat <radu.salavat@arm.com>
csrc/cpu/utils.hpp
cpp
Apache-2.0
#ifndef UTILS_HPP #define UTILS_HPP #include <atomic> #include <unistd.h> #include <ATen/cpu/Utils.h> #include "cpu/cpu_types.hpp" namespace cpu_utils { enum class ISA { AMX, VEC }; inline ISA get_isa(const std::string& isa) { if (isa == "amx") { return ISA::AMX; } else if (isa == "vec") { return ISA::V...
#ifndef UTILS_HPP #define UTILS_HPP #include <atomic> #include <unistd.h> #include <ATen/cpu/Utils.h> #include "cpu/cpu_types.hpp" namespace cpu_utils { enum class ISA { AMX, VEC }; inline ISA get_isa(const std::string& isa) { if (isa == "amx") { return ISA::AMX; } else if (isa == "vec") { return ISA::V...
--- csrc/cpu/utils.hpp +++ csrc/cpu/utils.hpp @@ -30,12 +30,10 @@ using vec_t = vec_op::FP32Vec16; }; -#if !defined(__aarch64__) || defined(ARM_BF16_SUPPORT) template <> struct VecTypeTrait<c10::BFloat16> { using vec_t = vec_op::BF16Vec16; }; -#endif #if !defined(__powerpc__) template <>
0
2
5
[]
[ "CPU" ]
[]
Optimize this cpp kernel file from vllm (csrc/cpu/utils.hpp). Goal: [Feature][CPU Backend]: Optimize ARM vectorization backend Target hardware: CPU Target models: unspecified Current file: ```cpp #ifndef UTILS_HPP #define UTILS_HPP #include <atomic> #include <unistd.h> #include <ATen/cpu/Utils.h> #include "cpu/cpu_...
## Purpose Implement vectorised backed based on `at::vec::Vectorized` for ARM, introduce highlevel FP32/FP16/BF16 vector wrappers and add new shared based class `VectorizedRegWrapper` capable of scaling with dtypes. - Implement ARM vectorisation based on `at::vec::Vectorized<T>` for `float`, `c10::Half` and `c10::BFlo...
[]
null
null
vllm
c4e744dbd41f23ee7fd554a86cc1bf516082552d
2026-01-28T13:15:24-05:00
32,892
https://github.com/vllm-project/vllm/pull/32892
[Perf] Optimize `moe_permute` for CUTLASS FP8 (#32892)
[Perf] Optimize `moe_permute` for CUTLASS FP8 (#32892) Signed-off-by: yewentao256 <zhyanwentao@126.com>
csrc/moe/moe_permute_unpermute_op.cu
cuda
Apache-2.0
#include <c10/core/ScalarType.h> #include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include "permute_unpermute_kernels/moe_permute_unpermute_kernel.h" #include "permute_unpermute_kernels/dispatch.h" #include "core/registration.h" // moe_permute kernels require at least CUDA 12.0 #if defined(CUDA_VERSION) && (C...
#include <c10/core/ScalarType.h> #include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include "permute_unpermute_kernels/moe_permute_unpermute_kernel.h" #include "permute_unpermute_kernels/dispatch.h" #include "core/registration.h" // moe_permute kernels require at least CUDA 12.0 #if defined(CUDA_VERSION) && (C...
--- csrc/moe/moe_permute_unpermute_op.cu +++ csrc/moe/moe_permute_unpermute_op.cu @@ -73,25 +73,40 @@ get_ptr<int64_t>(expert_first_token_offset), n_token, n_expert, n_local_expert, topk, sorter, get_ptr<int>(sort_workspace), stream); + // DeepGEMM: use getMIndices kernel to compute + // 1) align_expe...
24
9
2
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/moe/moe_permute_unpermute_op.cu). Goal: [Perf] Optimize `moe_permute` for CUTLASS FP8 Target hardware: unspecified Target models: unspecified Current file: ```cuda #include <c10/core/ScalarType.h> #include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include "permut...
## Purpose Optimize `moe_permute` kernel using `aligned_expert_first_token_offset` - Reduce calculation - Reduce shared memory usage ## Test ### Acc ```bash tests/kernels/moe/test_moe_permute_unpermute.py ........................... [ 6%] ..............................................................................
[{"scope": "kernel", "hardware": null, "model": "deepseek-ai/DeepSeek-V2-lite", "shape": null, "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 22.46, "optimized": 15.8, "stated_speedup": 1.4215, "speedup": 1.4215}, {"scope": "kernel", "hardware": null, "model": "deepseek-ai/De...
1.5096
null
vllm
c4e744dbd41f23ee7fd554a86cc1bf516082552d
2026-01-28T13:15:24-05:00
32,892
https://github.com/vllm-project/vllm/pull/32892
[Perf] Optimize `moe_permute` for CUTLASS FP8 (#32892)
[Perf] Optimize `moe_permute` for CUTLASS FP8 (#32892) Signed-off-by: yewentao256 <zhyanwentao@126.com>
csrc/moe/permute_unpermute_kernels/moe_permute_unpermute_kernel.h
cpp
Apache-2.0
#pragma once // reference from tensorrt_llm moe kernel implementation archive in // https://github.com/BBuf/tensorrt-llm-moe/tree/master #include <c10/core/ScalarType.h> #include <torch/all.h> #include "dispatch.h" #include <cub/cub.cuh> #include <cub/device/device_radix_sort.cuh> #include <cub/util_type.cuh> #include...
#pragma once // reference from tensorrt_llm moe kernel implementation archive in // https://github.com/BBuf/tensorrt-llm-moe/tree/master #include <c10/core/ScalarType.h> #include <torch/all.h> #include "dispatch.h" #include <cub/cub.cuh> #include <cub/device/device_radix_sort.cuh> #include <cub/util_type.cuh> #include...
--- csrc/moe/permute_unpermute_kernels/moe_permute_unpermute_kernel.h +++ csrc/moe/permute_unpermute_kernels/moe_permute_unpermute_kernel.h @@ -60,7 +60,8 @@ T const* unpermuted_input, T* permuted_output, int* sorted_experts, int const* expanded_dest_row_to_expanded_source_row, int* expanded_source_row_t...
2
1
2
[]
[]
[]
Optimize this cpp kernel file from vllm (csrc/moe/permute_unpermute_kernels/moe_permute_unpermute_kernel.h). Goal: [Perf] Optimize `moe_permute` for CUTLASS FP8 Target hardware: unspecified Target models: unspecified Current file: ```cpp #pragma once // reference from tensorrt_llm moe kernel implementation archive in...
## Purpose Optimize `moe_permute` kernel using `aligned_expert_first_token_offset` - Reduce calculation - Reduce shared memory usage ## Test ### Acc ```bash tests/kernels/moe/test_moe_permute_unpermute.py ........................... [ 6%] ..............................................................................
[{"scope": "kernel", "hardware": null, "model": "deepseek-ai/DeepSeek-V2-lite", "shape": null, "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 22.46, "optimized": 15.8, "stated_speedup": 1.4215, "speedup": 1.4215}, {"scope": "kernel", "hardware": null, "model": "deepseek-ai/De...
1.5096
null
vllm
3a6d5cbefd97a3dee07ba1756d8b5a9052801403
2026-01-27T17:24:41-05:00
33,102
https://github.com/vllm-project/vllm/pull/33102
[Perf] Optimize dcp allocate tensor (#33102)
[Perf] Optimize dcp allocate tensor (#33102) Signed-off-by: yewentao256 <zhyanwentao@126.com>
vllm/v1/attention/ops/common.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project import torch from vllm.distributed.parallel_state import GroupCoordinator from vllm.triton_utils import tl, triton @triton.jit def _correct_attn_cp_out_kernel( outputs_ptr, new_output_ptr, lses_ptr,...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project import torch from vllm.distributed.parallel_state import GroupCoordinator from vllm.triton_utils import tl, triton @triton.jit def _correct_attn_cp_out_kernel( outputs_ptr, new_output_ptr, lses_ptr,...
--- vllm/v1/attention/ops/common.py +++ vllm/v1/attention/ops/common.py @@ -195,14 +195,10 @@ if ctx is None: ctx = CPTritonContext() - lses = torch.empty( - (cp_group.world_size,) + cp_attn_lse.shape, - dtype=cp_attn_lse.dtype, - device=cp_attn_lse.device, - ) - cp_attn_...
3
7
1
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/v1/attention/ops/common.py). Goal: [Perf] Optimize dcp allocate tensor Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project import torc...
## Purpose There is no need to allocate an additional tensor for view_as, we can optimize through that.
[]
null
null
vllm
f4a0921c9c1194abf0a5e53218cfe5fb110eedac
2026-01-26T15:56:54+02:00
32,873
https://github.com/vllm-project/vllm/pull/32873
[Performance] Tune Mamba selective scan kernel for B200 (#32873)
[Performance] Tune Mamba selective scan kernel for B200 (#32873) Signed-off-by: Daniel Serebrenik <daserebrenik@nvidia.com> Co-authored-by: Robert Shaw <114415538+robertgshaw2-redhat@users.noreply.github.com>
vllm/model_executor/layers/mamba/ops/mamba_ssm.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright (c) 2024, Tri Dao, Albert Gu. # Adapted from https://github.com/state-spaces/mamba/blob/v2.2.4/mamba_ssm/ops/triton/selective_state_update.py import torch from packaging import version from vllm imp...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright (c) 2024, Tri Dao, Albert Gu. # Adapted from https://github.com/state-spaces/mamba/blob/v2.2.4/mamba_ssm/ops/triton/selective_state_update.py import torch from packaging import version from vllm imp...
--- vllm/model_executor/layers/mamba/ops/mamba_ssm.py +++ vllm/model_executor/layers/mamba/ops/mamba_ssm.py @@ -286,6 +286,7 @@ out=None, num_accepted_tokens=None, cu_seqlens=None, + is_blackwell=False, ): """ Argument: @@ -391,17 +392,26 @@ if dst_state_batch_indices is not None ...
21
11
2
[ "mamba" ]
[ "B200" ]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/mamba/ops/mamba_ssm.py). Goal: [Performance] Tune Mamba selective scan kernel for B200 Target hardware: B200 Target models: mamba Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the...
## Purpose Tune config of `selective_state_update` for **Nemotron Nano NVFP4** on **B200 (TP1)**. ## Test Plan Compare vLLM performance (Nano NVFP4, B200, TP1) with main branch and this branch/PR. ## Test Result Server command: ``` export VLLM_USE_FLASHINFER_MOE_FP4=1 export VLLM_FLASHINFER_MOE_BACKEND=throughput ...
[]
null
null
vllm
d08b356ee08dc8e0b0dd052ed7bef5245e21d7af
2026-01-22T12:47:04-08:00
32,619
https://github.com/vllm-project/vllm/pull/32619
[Perf] Create TMA-aligned input scale tensor for DeepGemm on Hopper (#32619)
[Perf] Create TMA-aligned input scale tensor for DeepGemm on Hopper (#32619) Signed-off-by: Xin Yang <xyangx@amazon.com>
vllm/model_executor/layers/quantization/utils/fp8_utils.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from https://github.com/sgl-project/sglang/pull/2575 import functools import json import os from collections.abc import Callable, Sequence from typing import Any import torch import vllm.envs as envs ...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from https://github.com/sgl-project/sglang/pull/2575 import functools import json import os from collections.abc import Callable, Sequence from typing import Any import torch import vllm.envs as envs ...
--- vllm/model_executor/layers/quantization/utils/fp8_utils.py +++ vllm/model_executor/layers/quantization/utils/fp8_utils.py @@ -35,6 +35,7 @@ from vllm.utils.deep_gemm import ( DeepGemmQuantScaleFMT, fp8_gemm_nt, + get_tma_aligned_size, is_deep_gemm_e8m0_used, is_deep_gemm_supported, shou...
23
3
2
[]
[ "HOPPER" ]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/quantization/utils/fp8_utils.py). Goal: [Perf] Create TMA-aligned input scale tensor for DeepGemm on Hopper Target hardware: HOPPER Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: ...
## Purpose This PR is to create TMA-aligned input scale tensor for DeepGemm on Hopper. I noticed on H200 `deep_gemm::transpose_fp32` was launched before `deep_gemm::sm90_fp8_gemm_1d2d_impl` every time, because deepgemm requires input scale tensor to be column major TMA-aligned layout on Hopper, see [here](https://git...
[{"scope": "e2e", "hardware": null, "model": "DeepSeek-R1-0528", "shape": null, "batch_size": 8, "metric": "output token throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 449.4, "optimized": 464.59, "stated_speedup": 1.03, "speedup": 1.0338}]
null
1.0338
vllm
744ef30484169694ef4aaba9420a03ed5b861b66
2026-01-22T18:55:23Z
32,792
https://github.com/vllm-project/vllm/pull/32792
[CPU Backend] [Perf] Accelerate tensor-parallel/data-parallel inference across NUMA domains on Arm (#32792)
[CPU Backend] [Perf] Accelerate tensor-parallel/data-parallel inference across NUMA domains on Arm (#32792) Signed-off-by: Fadi Arafeh <fadi.arafeh@arm.com>
csrc/cpu/cpu_types_arm.hpp
cpp
Apache-2.0
#include <arm_neon.h> #include <torch/all.h> #include <cmath> #if defined(__APPLE__) #include "omp.h" #endif namespace vec_op { #ifdef ARM_BF16_SUPPORT #define VLLM_DISPATCH_CASE_FLOATING_TYPES(...) \ AT_DISPATCH_CASE(at::ScalarType::Float, __VA_ARGS__) \ AT_DISPATCH_CASE(at::ScalarType::Half, __...
#include <arm_neon.h> #include <torch/all.h> #include <cmath> #if defined(__APPLE__) #include "omp.h" #endif namespace vec_op { #ifdef ARM_BF16_SUPPORT #define VLLM_DISPATCH_CASE_FLOATING_TYPES(...) \ AT_DISPATCH_CASE(at::ScalarType::Float, __VA_ARGS__) \ AT_DISPATCH_CASE(at::ScalarType::Half, __...
--- csrc/cpu/cpu_types_arm.hpp +++ csrc/cpu/cpu_types_arm.hpp @@ -80,8 +80,10 @@ reg.val[1] = vld1q_f16(reinterpret_cast<const __fp16*>(ptr) + 8); } + // ASIMD does not support non-temporal loads + explicit FP16Vec16(bool, const void* ptr) : FP16Vec16(ptr) {} + explicit FP16Vec16(const FP32Vec16& vec); -...
99
1
3
[]
[ "CPU" ]
[]
Optimize this cpp kernel file from vllm (csrc/cpu/cpu_types_arm.hpp). Goal: [CPU Backend] [Perf] Accelerate tensor-parallel/data-parallel inference across NUMA domains on Arm Target hardware: CPU Target models: unspecified Current file: ```cpp #include <arm_neon.h> #include <torch/all.h> #include <cmath> #if defined...
[CPU Backend] [Perf] Accelerate tensor-parallel/data-parallel inference across NUMA domains on Arm Fixes: #32786 ## Purpose This PR addresses #32786 by enabling vLLM's custom shared memory communicator for Arm, in favor of torch.distributed which has very high synchronization costs. It also enables auto thread bindi...
[{"scope": "e2e", "hardware": "c8g.metal.48xlarge", "model": "llama3.2-3b-Instruct", "shape": "tp=2, 2 NUMAs", "batch_size": null, "metric": "throughput", "unit": "%", "higher_is_better": true, "baseline": 100, "optimized": 196.3, "stated_speedup": null, "speedup": 1.963}, {"scope": "e2e", "hardware": "c8g.metal.48xlar...
null
2
vllm
744ef30484169694ef4aaba9420a03ed5b861b66
2026-01-22T18:55:23Z
32,792
https://github.com/vllm-project/vllm/pull/32792
[CPU Backend] [Perf] Accelerate tensor-parallel/data-parallel inference across NUMA domains on Arm (#32792)
[CPU Backend] [Perf] Accelerate tensor-parallel/data-parallel inference across NUMA domains on Arm (#32792) Signed-off-by: Fadi Arafeh <fadi.arafeh@arm.com>
csrc/cpu/shm.cpp
cpp
Apache-2.0
#include "cpu/cpu_types.hpp" #include <fcntl.h> #include <sys/mman.h> #include <sys/stat.h> #include <unistd.h> namespace { #define MAX_SHM_RANK_NUM 8 #define PER_THREAD_SHM_BUFFER_BYTES (4 * 1024 * 1024) static_assert(PER_THREAD_SHM_BUFFER_BYTES % 2 == 0); #define PER_THREAD_SHM_BUFFER_OFFSET (PER_THREAD_SHM_BUFFER_...
#include "cpu/cpu_types.hpp" #include <fcntl.h> #include <sys/mman.h> #include <sys/stat.h> #include <unistd.h> #ifdef __aarch64__ #include <atomic> #endif namespace { #define MAX_SHM_RANK_NUM 8 #define PER_THREAD_SHM_BUFFER_BYTES (4 * 1024 * 1024) static_assert(PER_THREAD_SHM_BUFFER_BYTES % 2 == 0); #define PER_T...
--- csrc/cpu/shm.cpp +++ csrc/cpu/shm.cpp @@ -4,6 +4,10 @@ #include <sys/mman.h> #include <sys/stat.h> #include <unistd.h> + +#ifdef __aarch64__ + #include <atomic> +#endif namespace { #define MAX_SHM_RANK_NUM 8 @@ -34,8 +38,17 @@ }; struct ThreadSHMContext { +#ifdef __aarch64__ + // memory model is weaker...
51
3
3
[]
[ "CPU" ]
[]
Optimize this cpp kernel file from vllm (csrc/cpu/shm.cpp). Goal: [CPU Backend] [Perf] Accelerate tensor-parallel/data-parallel inference across NUMA domains on Arm Target hardware: CPU Target models: unspecified Current file: ```cpp #include "cpu/cpu_types.hpp" #include <fcntl.h> #include <sys/mman.h> #include <sys...
[CPU Backend] [Perf] Accelerate tensor-parallel/data-parallel inference across NUMA domains on Arm Fixes: #32786 ## Purpose This PR addresses #32786 by enabling vLLM's custom shared memory communicator for Arm, in favor of torch.distributed which has very high synchronization costs. It also enables auto thread bindi...
[{"scope": "e2e", "hardware": "c8g.metal.48xlarge", "model": "llama3.2-3b-Instruct", "shape": "tp=2, 2 NUMAs", "batch_size": null, "metric": "throughput", "unit": "%", "higher_is_better": true, "baseline": 100, "optimized": 196.3, "stated_speedup": null, "speedup": 1.963}, {"scope": "e2e", "hardware": "c8g.metal.48xlar...
null
2
vllm
744ef30484169694ef4aaba9420a03ed5b861b66
2026-01-22T18:55:23Z
32,792
https://github.com/vllm-project/vllm/pull/32792
[CPU Backend] [Perf] Accelerate tensor-parallel/data-parallel inference across NUMA domains on Arm (#32792)
[CPU Backend] [Perf] Accelerate tensor-parallel/data-parallel inference across NUMA domains on Arm (#32792) Signed-off-by: Fadi Arafeh <fadi.arafeh@arm.com>
csrc/cpu/torch_bindings.cpp
cpp
Apache-2.0
#include "cache.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> std::string init_cpu_threads_env(const std::string& cpu_ids); void release_dnnl_matmul_handler(int64_t handler); int64_t create_onednn_scaled_mm_handler(const torch::Tensor& b, const...
#include "cache.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> std::string init_cpu_threads_env(const std::string& cpu_ids); void release_dnnl_matmul_handler(int64_t handler); int64_t create_onednn_scaled_mm_handler(const torch::Tensor& b, const...
--- csrc/cpu/torch_bindings.cpp +++ csrc/cpu/torch_bindings.cpp @@ -230,7 +230,7 @@ #endif // SHM CCL -#ifdef __AVX512F__ +#if defined(__AVX512F__) || defined(__aarch64__) ops.def("init_shm_manager(str name, int group_size, int rank) -> int", &init_shm_manager); ops.def("join_shm_manager(int handle...
2
2
3
[]
[ "CPU" ]
[]
Optimize this cpp kernel file from vllm (csrc/cpu/torch_bindings.cpp). Goal: [CPU Backend] [Perf] Accelerate tensor-parallel/data-parallel inference across NUMA domains on Arm Target hardware: CPU Target models: unspecified Current file: ```cpp #include "cache.h" #include "ops.h" #include "core/registration.h" #incl...
[CPU Backend] [Perf] Accelerate tensor-parallel/data-parallel inference across NUMA domains on Arm Fixes: #32786 ## Purpose This PR addresses #32786 by enabling vLLM's custom shared memory communicator for Arm, in favor of torch.distributed which has very high synchronization costs. It also enables auto thread bindi...
[{"scope": "e2e", "hardware": "c8g.metal.48xlarge", "model": "llama3.2-3b-Instruct", "shape": "tp=2, 2 NUMAs", "batch_size": null, "metric": "throughput", "unit": "%", "higher_is_better": true, "baseline": 100, "optimized": 196.3, "stated_speedup": null, "speedup": 1.963}, {"scope": "e2e", "hardware": "c8g.metal.48xlar...
null
2
vllm
6c97b9b9b6337d021615ed74f9cf836b65c446d7
2026-01-20T11:34:39-05:00
32,273
https://github.com/vllm-project/vllm/pull/32273
[Perf] Only clone when needed for `moe_permute` (#32273)
[Perf] Only clone when needed for `moe_permute` (#32273) Signed-off-by: yewentao256 <zhyanwentao@126.com>
csrc/moe/moe_permute_unpermute_op.cu
cuda
Apache-2.0
#include <c10/core/ScalarType.h> #include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include "permute_unpermute_kernels/moe_permute_unpermute_kernel.h" #include "permute_unpermute_kernels/dispatch.h" #include "core/registration.h" // moe_permute kernels require at least CUDA 12.0 #if defined(CUDA_VERSION) && (C...
#include <c10/core/ScalarType.h> #include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include "permute_unpermute_kernels/moe_permute_unpermute_kernel.h" #include "permute_unpermute_kernels/dispatch.h" #include "core/registration.h" // moe_permute kernels require at least CUDA 12.0 #if defined(CUDA_VERSION) && (C...
--- csrc/moe/moe_permute_unpermute_op.cu +++ csrc/moe/moe_permute_unpermute_op.cu @@ -42,7 +42,7 @@ auto sort_workspace = torch::empty( {sorter_size}, torch::dtype(torch::kInt8).device(torch::kCUDA).requires_grad(false)); - auto copy_topk_ids = topk_ids.clone(); // copy topk_ids for preprocess + tor...
4
3
3
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/moe/moe_permute_unpermute_op.cu). Goal: [Perf] Only clone when needed for `moe_permute` Target hardware: unspecified Target models: unspecified Current file: ```cuda #include <c10/core/ScalarType.h> #include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include "perm...
## Purpose Part of the https://github.com/vllm-project/vllm/issues/31755 Only clone when needed ## Test `export MODEL="zai-org/GLM-4.7-FP8"` `vllm serve $MODEL -tp 8 --port 9256 --enable-expert-parallel --max_num_seqs 128 ` `lm_eval --model local-completions --model_args "base_url=http://127.0.0.1:9256/v1/completi...
[]
null
null
vllm
6c97b9b9b6337d021615ed74f9cf836b65c446d7
2026-01-20T11:34:39-05:00
32,273
https://github.com/vllm-project/vllm/pull/32273
[Perf] Only clone when needed for `moe_permute` (#32273)
[Perf] Only clone when needed for `moe_permute` (#32273) Signed-off-by: yewentao256 <zhyanwentao@126.com>
csrc/moe/permute_unpermute_kernels/moe_permute_unpermute_kernel.cu
cuda
Apache-2.0
#include "moe_permute_unpermute_kernel.h" // moe_permute kernels require at least CUDA 12.0 #if defined(CUDA_VERSION) && (CUDA_VERSION >= 12000) // CubKeyValueSorter definition begin CubKeyValueSorter::CubKeyValueSorter() : num_experts_(0), num_bits_(sizeof(int) * 8) {} int CubKeyValueSorter::expertsToBits(int ...
#include "moe_permute_unpermute_kernel.h" // moe_permute kernels require at least CUDA 12.0 #if defined(CUDA_VERSION) && (CUDA_VERSION >= 12000) // CubKeyValueSorter definition begin CubKeyValueSorter::CubKeyValueSorter() : num_experts_(0), num_bits_(sizeof(int) * 8) {} int CubKeyValueSorter::expertsToBits(int ...
--- csrc/moe/permute_unpermute_kernels/moe_permute_unpermute_kernel.cu +++ csrc/moe/permute_unpermute_kernels/moe_permute_unpermute_kernel.cu @@ -109,7 +109,7 @@ sorted_indices, total_indices, num_experts, expert_first_token_offset); } -void sortAndScanExpert(int* expert_for_source_row, const int* source_rows...
1
1
3
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/moe/permute_unpermute_kernels/moe_permute_unpermute_kernel.cu). Goal: [Perf] Only clone when needed for `moe_permute` Target hardware: unspecified Target models: unspecified Current file: ```cuda #include "moe_permute_unpermute_kernel.h" // moe_permute kernels require ...
## Purpose Part of the https://github.com/vllm-project/vllm/issues/31755 Only clone when needed ## Test `export MODEL="zai-org/GLM-4.7-FP8"` `vllm serve $MODEL -tp 8 --port 9256 --enable-expert-parallel --max_num_seqs 128 ` `lm_eval --model local-completions --model_args "base_url=http://127.0.0.1:9256/v1/completi...
[]
null
null
vllm
6c97b9b9b6337d021615ed74f9cf836b65c446d7
2026-01-20T11:34:39-05:00
32,273
https://github.com/vllm-project/vllm/pull/32273
[Perf] Only clone when needed for `moe_permute` (#32273)
[Perf] Only clone when needed for `moe_permute` (#32273) Signed-off-by: yewentao256 <zhyanwentao@126.com>
csrc/moe/permute_unpermute_kernels/moe_permute_unpermute_kernel.h
cpp
Apache-2.0
#pragma once // reference from tensorrt_llm moe kernel implementation archive in // https://github.com/BBuf/tensorrt-llm-moe/tree/master #include <c10/core/ScalarType.h> #include <torch/all.h> #include "dispatch.h" #include <cub/cub.cuh> #include <cub/device/device_radix_sort.cuh> #include <cub/util_type.cuh> #include...
#pragma once // reference from tensorrt_llm moe kernel implementation archive in // https://github.com/BBuf/tensorrt-llm-moe/tree/master #include <c10/core/ScalarType.h> #include <torch/all.h> #include "dispatch.h" #include <cub/cub.cuh> #include <cub/device/device_radix_sort.cuh> #include <cub/util_type.cuh> #include...
--- csrc/moe/permute_unpermute_kernels/moe_permute_unpermute_kernel.h +++ csrc/moe/permute_unpermute_kernels/moe_permute_unpermute_kernel.h @@ -48,7 +48,7 @@ int64_t* expert_first_token_offset, cudaStream_t stream); -void sortAndScanExpert(int* e...
1
1
3
[]
[]
[]
Optimize this cpp kernel file from vllm (csrc/moe/permute_unpermute_kernels/moe_permute_unpermute_kernel.h). Goal: [Perf] Only clone when needed for `moe_permute` Target hardware: unspecified Target models: unspecified Current file: ```cpp #pragma once // reference from tensorrt_llm moe kernel implementation archive ...
## Purpose Part of the https://github.com/vllm-project/vllm/issues/31755 Only clone when needed ## Test `export MODEL="zai-org/GLM-4.7-FP8"` `vllm serve $MODEL -tp 8 --port 9256 --enable-expert-parallel --max_num_seqs 128 ` `lm_eval --model local-completions --model_args "base_url=http://127.0.0.1:9256/v1/completi...
[]
null
null
vllm
8cc26acd8b77c8af12d2fbf1f5bd38d09861928c
2026-01-18T12:19:59+08:00
32,403
https://github.com/vllm-project/vllm/pull/32403
[Performance] Improve Triton prefill attention kernel's performance (#32403)
[Performance] Improve Triton prefill attention kernel's performance (#32403) Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
vllm/v1/attention/ops/triton_prefill_attention.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from # https://github.com/sgl-project/sglang/blob/97cb762bb65ebf05025eb342de03c184660427a3/python/sglang/srt/layers/attention/triton_ops/prefill_attention.py # Changes: # - Add support for sliding windo...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from # https://github.com/sgl-project/sglang/blob/97cb762bb65ebf05025eb342de03c184660427a3/python/sglang/srt/layers/attention/triton_ops/prefill_attention.py # Changes: # - Add support for sliding windo...
--- vllm/v1/attention/ops/triton_prefill_attention.py +++ vllm/v1/attention/ops/triton_prefill_attention.py @@ -30,6 +30,7 @@ from vllm.platforms import current_platform from vllm.triton_utils import tl, triton +from vllm.utils.math_utils import RCP_LN2 @triton.jit @@ -110,15 +111,7 @@ end_n_limit = block...
27
46
1
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/v1/attention/ops/triton_prefill_attention.py). Goal: [Performance] Improve Triton prefill attention kernel's performance Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copy...
<!-- markdownlint-disable --> ## Purpose Refine prefill attention kernel with FA2 implementation based on https://github.com/ModelTC/LightLLM/blob/2fbd2b8a7b180570129bd539bb34cbe0a5dbb22a/lightllm/common/basemodel/triton_kernel/att/prefill_att/context_flashattention_nopad.py#L287-L288 - In previous implementation, we ...
[{"scope": "e2e", "hardware": null, "model": null, "shape": "Input_len=2048", "batch_size": 8, "metric": "throughput", "unit": "requests/s", "higher_is_better": true, "baseline": 33.9996, "optimized": 34.969, "stated_speedup": null, "speedup": 1.0285}, {"scope": "e2e", "hardware": null, "model": null, "shape": "Input_l...
null
1.0201
vllm
7a1030431ade33439902f5b0cf7ff4a69c0fc033
2026-01-16T09:45:04-08:00
29,843
https://github.com/vllm-project/vllm/pull/29843
Atomics Reduce Counting Optimization for SplitK Skinny GEMMs. (#29843)
Atomics Reduce Counting Optimization for SplitK Skinny GEMMs. (#29843) Signed-off-by: Hashem Hashemi <hashem.hashemi@amd.com>
csrc/rocm/ops.h
cpp
Apache-2.0
#pragma once #include <torch/all.h> torch::Tensor LLMM1(at::Tensor& in_a, at::Tensor& in_b, const int64_t rows_per_block); torch::Tensor wvSplitK(const at::Tensor& in_a, const at::Tensor& in_b, const std::optional<at::Tensor>& in_bias, const int64_t C...
#pragma once #include <torch/all.h> torch::Tensor LLMM1(at::Tensor& in_a, at::Tensor& in_b, const int64_t rows_per_block); torch::Tensor wvSplitK(const at::Tensor& in_a, const at::Tensor& in_b, const std::optional<at::Tensor>& in_bias, const int64_t C...
--- csrc/rocm/ops.h +++ csrc/rocm/ops.h @@ -8,6 +8,10 @@ torch::Tensor wvSplitK(const at::Tensor& in_a, const at::Tensor& in_b, const std::optional<at::Tensor>& in_bias, const int64_t CuCount); + +torch::Tensor wvSplitKrc(const at::Tensor& in_a, const at::Tensor& in_b, +...
4
0
4
[]
[ "ROCM" ]
[]
Optimize this cpp kernel file from vllm (csrc/rocm/ops.h). Goal: Atomics Reduce Counting Optimization for SplitK Skinny GEMMs. Target hardware: ROCM Target models: unspecified Current file: ```cpp #pragma once #include <torch/all.h> torch::Tensor LLMM1(at::Tensor& in_a, at::Tensor& in_b, const i...
## Purpose Optimize N=16-128 M=128,640 range and K=2880 cases -- targeting decode GEMMs observed in low concurrency gpt-oss. After more testing can be expanded to all GEMMs where N=16-128 and **(M/16)*(K/512)** is less than SIMD count. ## Test Plan ## Test Result --- <details> <summary> Essential Elements of an Effe...
[]
null
null
vllm
7a1030431ade33439902f5b0cf7ff4a69c0fc033
2026-01-16T09:45:04-08:00
29,843
https://github.com/vllm-project/vllm/pull/29843
Atomics Reduce Counting Optimization for SplitK Skinny GEMMs. (#29843)
Atomics Reduce Counting Optimization for SplitK Skinny GEMMs. (#29843) Signed-off-by: Hashem Hashemi <hashem.hashemi@amd.com>
csrc/rocm/skinny_gemms.cu
cuda
Apache-2.0
#include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <cuda_runtime.h> #include <cuda_fp16.h> #include <cuda_bf16.h> #include <stdexcept> #include <algorithm> #include "../cuda_compat.h" #include "dispatch_utils.h" #include "quantization/w8a8/fp8/common.cuh" #if defined(...
#include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <cuda_runtime.h> #include <cuda_fp16.h> #include <cuda_bf16.h> #include <stdexcept> #include <algorithm> #include "../cuda_compat.h" #include "dispatch_utils.h" #include "quantization/w8a8/fp8/common.cuh" #if defined(...
--- csrc/rocm/skinny_gemms.cu +++ csrc/rocm/skinny_gemms.cu @@ -287,6 +287,11 @@ V0 += (s.x + s.y); \ } +// To avoid LLVM silently upcasting to double +__device__ inline unsigned int min__(uint32_t a, uint32_t b) { + return min(a, b); +} + #if defined(_...
545
9
4
[]
[ "ROCM" ]
[]
Optimize this cuda kernel file from vllm (csrc/rocm/skinny_gemms.cu). Goal: Atomics Reduce Counting Optimization for SplitK Skinny GEMMs. Target hardware: ROCM Target models: unspecified Current file: ```cuda #include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <cuda_run...
## Purpose Optimize N=16-128 M=128,640 range and K=2880 cases -- targeting decode GEMMs observed in low concurrency gpt-oss. After more testing can be expanded to all GEMMs where N=16-128 and **(M/16)*(K/512)** is less than SIMD count. ## Test Plan ## Test Result --- <details> <summary> Essential Elements of an Effe...
[]
null
null
vllm
7a1030431ade33439902f5b0cf7ff4a69c0fc033
2026-01-16T09:45:04-08:00
29,843
https://github.com/vllm-project/vllm/pull/29843
Atomics Reduce Counting Optimization for SplitK Skinny GEMMs. (#29843)
Atomics Reduce Counting Optimization for SplitK Skinny GEMMs. (#29843) Signed-off-by: Hashem Hashemi <hashem.hashemi@amd.com>
csrc/rocm/torch_bindings.cpp
cpp
Apache-2.0
#include "core/registration.h" #include "rocm/ops.h" // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only // functions that return Tensors require a meta function. // // See the following links for de...
#include "core/registration.h" #include "rocm/ops.h" // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only // functions that return Tensors require a meta function. // // See the following links for de...
--- csrc/rocm/torch_bindings.cpp +++ csrc/rocm/torch_bindings.cpp @@ -25,6 +25,12 @@ "wvSplitK(Tensor in_a, Tensor in_b, Tensor? in_bias, int CuCount) -> " "Tensor"); rocm_ops.impl("wvSplitK", torch::kCUDA, &wvSplitK); + + // Custom gemm op for skinny matrix-matrix multiplication + rocm_ops.def( + ...
6
0
4
[]
[ "ROCM" ]
[]
Optimize this cpp kernel file from vllm (csrc/rocm/torch_bindings.cpp). Goal: Atomics Reduce Counting Optimization for SplitK Skinny GEMMs. Target hardware: ROCM Target models: unspecified Current file: ```cpp #include "core/registration.h" #include "rocm/ops.h" // Note on op signatures: // The X_meta signatures are...
## Purpose Optimize N=16-128 M=128,640 range and K=2880 cases -- targeting decode GEMMs observed in low concurrency gpt-oss. After more testing can be expanded to all GEMMs where N=16-128 and **(M/16)*(K/512)** is less than SIMD count. ## Test Plan ## Test Result --- <details> <summary> Essential Elements of an Effe...
[]
null
null
vllm
130d6c9514856cb5a152329f0382d60ff6e8d97e
2026-01-15T23:29:53+08:00
29,887
https://github.com/vllm-project/vllm/pull/29887
[ROCm][Perf] Enable shuffle kv cache layout and assembly paged attention kernel for `AiterFlashAttentionBackend` (#29887)
[ROCm][Perf] Enable shuffle kv cache layout and assembly paged attention kernel for `AiterFlashAttentionBackend` (#29887) Signed-off-by: ganyi <ygan@amd.com>
vllm/v1/attention/backends/rocm_aiter_fa.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Attention layer with AiterFlashAttention.""" from dataclasses import dataclass from typing import ClassVar import torch from vllm.attention.layer import Attention from vllm.config import VllmConfig, get_laye...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Attention layer with AiterFlashAttention.""" from dataclasses import dataclass from typing import ClassVar import torch from vllm._aiter_ops import rocm_aiter_ops from vllm.attention.layer import Attention f...
--- vllm/v1/attention/backends/rocm_aiter_fa.py +++ vllm/v1/attention/backends/rocm_aiter_fa.py @@ -7,6 +7,7 @@ import torch +from vllm._aiter_ops import rocm_aiter_ops from vllm.attention.layer import Attention from vllm.config import VllmConfig, get_layers_from_vllm_config from vllm.logger import init_logger ...
302
87
1
[]
[ "ROCM" ]
[]
Optimize this triton kernel file from vllm (vllm/v1/attention/backends/rocm_aiter_fa.py). Goal: [ROCm][Perf] Enable shuffle kv cache layout and assembly paged attention kernel for `AiterFlashAttentionBackend` Target hardware: ROCM Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2....
## Purpose This PR add assembly paged attention kernel in aiter to `AiterFlashAttentionBackend`. We verify this implementation on `Qwen3-30B-A3B-FP8` Mi308 and observed at least about 20% thoughput gain and obvious latency reduction on tpot. This PR add this flag `USING_SHUFFLE_LAYOUT` to control whether to enable as...
[{"scope": "e2e", "hardware": "Mi308", "model": "Qwen3-30B-A3B-FP8", "shape": null, "batch_size": 200, "metric": "Request throughput", "unit": "req/s", "higher_is_better": true, "baseline": 2.1, "optimized": 2.51, "stated_speedup": null, "speedup": 1.1952}, {"scope": "e2e", "hardware": "Mi308", "model": "Qwen3-30B-A3B-...
null
1.1952
vllm
f28125d87b6a5976a1584267077d4f0287ce6ce2
2026-01-13T13:58:18-05:00
32,058
https://github.com/vllm-project/vllm/pull/32058
[Perf] Optimize grouped topk kernel, 1.2%~2% E2E Throughput improvement (#32058)
[Perf] Optimize grouped topk kernel, 1.2%~2% E2E Throughput improvement (#32058) Signed-off-by: yewentao256 <zhyanwentao@126.com>
csrc/moe/grouped_topk_kernels.cu
cuda
Apache-2.0
/* * Adapted from * https://github.com/NVIDIA/TensorRT-LLM/blob/v0.21.0/cpp/tensorrt_llm/kernels/noAuxTcKernels.cu * Copyright (c) 2025, The vLLM team. * SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & * AFFILIATES. All rights reserved. SPDX-License-Identifier: Apache-2.0 * * Licensed under ...
/* * Adapted from * https://github.com/NVIDIA/TensorRT-LLM/blob/v0.21.0/cpp/tensorrt_llm/kernels/noAuxTcKernels.cu * Copyright (c) 2025, The vLLM team. * SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & * AFFILIATES. All rights reserved. SPDX-License-Identifier: Apache-2.0 * * Licensed under ...
--- csrc/moe/grouped_topk_kernels.cu +++ csrc/moe/grouped_topk_kernels.cu @@ -31,8 +31,6 @@ constexpr unsigned FULL_WARP_MASK = 0xffffffff; constexpr int32_t WARP_SIZE = 32; -constexpr int32_t BLOCK_SIZE = 512; -constexpr int32_t NUM_WARPS_PER_BLOCK = BLOCK_SIZE / WARP_SIZE; namespace warp_topk { @@ -63,14 +61...
193
295
1
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/moe/grouped_topk_kernels.cu). Goal: [Perf] Optimize grouped topk kernel, 1.2%~2% E2E Throughput improvement Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Adapted from * https://github.com/NVIDIA/TensorRT-LLM/blob/v0.21.0/cpp/tensorr...
## Purpose Part of the https://github.com/vllm-project/vllm/issues/31755 Here we combine the two kernels together, reducing global write and read ## Test ## Test `export MODEL="zai-org/GLM-4.7-FP8"` `vllm serve $MODEL -tp 8 --port 9256 --enable-expert-parallel --max_num_seqs 128` ### Acc `lm_eval --model loca...
[]
null
null
vllm
b8bf5c45bbbb1249bd1656557603da71e9d4c3b9
2026-01-10T19:13:44+01:00
31,984
https://github.com/vllm-project/vllm/pull/31984
[Kernel] Optimize Sliding Window Attention in 3D Triton Kernel (#31984)
[Kernel] Optimize Sliding Window Attention in 3D Triton Kernel (#31984) Signed-off-by: Jan van Lunteren <jvl@zurich.ibm.com>
vllm/v1/attention/ops/triton_unified_attention.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Authors: # - Burkhard Ringlein <ngl@zurich.ibm.com> # - Jan van Lunteren <jvl@zurich.ibm.com> # - Chih-Chieh Yang <chih.chieh.yang@ibm.com> # - Thomas Parnell <tpa@zurich.ibm.com> import torch from vllm.l...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Authors: # - Burkhard Ringlein <ngl@zurich.ibm.com> # - Jan van Lunteren <jvl@zurich.ibm.com> # - Chih-Chieh Yang <chih.chieh.yang@ibm.com> # - Thomas Parnell <tpa@zurich.ibm.com> import torch from vllm.l...
--- vllm/v1/attention/ops/triton_unified_attention.py +++ vllm/v1/attention/ops/triton_unified_attention.py @@ -545,10 +545,33 @@ # this prefix can be skipped) num_tiles = cdiv_fn(max_seq_prefix_len, TILE_SIZE) - # iterate through tiles within current segment + # ---- Sliding-window tile pruning -----...
26
3
1
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/v1/attention/ops/triton_unified_attention.py). Goal: [Kernel] Optimize Sliding Window Attention in 3D Triton Kernel Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright...
## Purpose This pull request improves the efficiency of sliding window attention in the 3D kernel by applying the same optimization used in the 2D kernel. It ensures that only tiles within the defined window are processed, resulting in better performance and reduced computational overhead. ## Performance The followin...
[{"scope": "e2e", "hardware": "NVIDIA H100", "model": "openai/gpt-oss-20b", "shape": "input-len=500, output-len=6400; output-len=12800", "batch_size": 1, "metric": "latency", "unit": null, "higher_is_better": false, "baseline": null, "optimized": null, "stated_speedup": 1.03, "speedup": 1.03}, {"scope": "e2e", "hardwar...
null
1.035
vllm
308feab33f3b386a6701cc5b28337bc04fe13a9b
2026-01-09T14:13:43-05:00
31,830
https://github.com/vllm-project/vllm/pull/31830
[Perf] Optimize cutlass moe problem size calculation, 5.3% E2E Throughput improvement, 2.2% TTFT improvement (#31830)
[Perf] Optimize cutlass moe problem size calculation, 5.3% E2E Throughput improvement, 2.2% TTFT improvement (#31830) Signed-off-by: yewentao256 <zhyanwentao@126.com> Signed-off-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
csrc/ops.h
cpp
Apache-2.0
#pragma once #include <optional> #include <torch/library.h> #include "core/scalar_type.hpp" #include <vector> torch::Tensor weak_ref_tensor(torch::Tensor& tensor) { // Ensure tensor is on CUDA if (!tensor.is_cuda()) { throw std::runtime_error("Tensor must be on CUDA device"); } // Get the raw data poin...
#pragma once #include <optional> #include <torch/library.h> #include "core/scalar_type.hpp" #include <vector> torch::Tensor weak_ref_tensor(torch::Tensor& tensor) { // Ensure tensor is on CUDA if (!tensor.is_cuda()) { throw std::runtime_error("Tensor must be on CUDA device"); } // Get the raw data poin...
--- csrc/ops.h +++ csrc/ops.h @@ -265,6 +265,11 @@ const int64_t k, const std::optional<torch::Tensor>& blockscale_offsets, std::optional<bool> force_swap_ab = std::nullopt); +void get_cutlass_moe_mm_problem_sizes_from_expert_offsets( + const torch::Tensor& expert_first_token_offset, + torch::Tensor& ...
5
0
5
[]
[]
[]
Optimize this cpp kernel file from vllm (csrc/ops.h). Goal: [Perf] Optimize cutlass moe problem size calculation, 5.3% E2E Throughput improvement, 2.2% TTFT improvement Target hardware: unspecified Target models: unspecified Current file: ```cpp #pragma once #include <optional> #include <torch/library.h> #include "...
## Purpose Part of the https://github.com/vllm-project/vllm/issues/31755 Here we add a kernel for faster calculation of problem size ## Test `export MODEL="zai-org/GLM-4.7-FP8"` `vllm serve $MODEL -tp 8 --port 9256 --enable-expert-parallel --max_num_seqs 128` ### Acc `lm_eval --model local-completions --model_...
[]
null
null
vllm
308feab33f3b386a6701cc5b28337bc04fe13a9b
2026-01-09T14:13:43-05:00
31,830
https://github.com/vllm-project/vllm/pull/31830
[Perf] Optimize cutlass moe problem size calculation, 5.3% E2E Throughput improvement, 2.2% TTFT improvement (#31830)
[Perf] Optimize cutlass moe problem size calculation, 5.3% E2E Throughput improvement, 2.2% TTFT improvement (#31830) Signed-off-by: yewentao256 <zhyanwentao@126.com> Signed-off-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
csrc/quantization/w8a8/cutlass/moe/moe_data.cu
cuda
Apache-2.0
#include <cudaTypedefs.h> #include <c10/cuda/CUDAGuard.h> #include <torch/all.h> #include <iostream> constexpr uint64_t THREADS_PER_EXPERT = 512; // threshold must match the dispatch logic in run_cutlass_moe_mm_sm90() constexpr int SWAP_AB_THRESHOLD = 64; template <bool SWAP_AB> __global__ void compute_problem_size...
#include <cudaTypedefs.h> #include <c10/cuda/CUDAGuard.h> #include <torch/all.h> #include "dispatch_utils.h" #include <iostream> constexpr uint64_t THREADS_PER_EXPERT = 512; // threshold must match the dispatch logic in run_cutlass_moe_mm_sm90() constexpr int SWAP_AB_THRESHOLD = 64; template <bool SWAP_AB> __globa...
--- csrc/quantization/w8a8/cutlass/moe/moe_data.cu +++ csrc/quantization/w8a8/cutlass/moe/moe_data.cu @@ -2,6 +2,8 @@ #include <c10/cuda/CUDAGuard.h> #include <torch/all.h> + +#include "dispatch_utils.h" #include <iostream> @@ -114,22 +116,17 @@ const bool swap_ab) { ...
97
13
5
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/quantization/w8a8/cutlass/moe/moe_data.cu). Goal: [Perf] Optimize cutlass moe problem size calculation, 5.3% E2E Throughput improvement, 2.2% TTFT improvement Target hardware: unspecified Target models: unspecified Current file: ```cuda #include <cudaTypedefs.h> #includ...
## Purpose Part of the https://github.com/vllm-project/vllm/issues/31755 Here we add a kernel for faster calculation of problem size ## Test `export MODEL="zai-org/GLM-4.7-FP8"` `vllm serve $MODEL -tp 8 --port 9256 --enable-expert-parallel --max_num_seqs 128` ### Acc `lm_eval --model local-completions --model_...
[]
null
null
vllm
308feab33f3b386a6701cc5b28337bc04fe13a9b
2026-01-09T14:13:43-05:00
31,830
https://github.com/vllm-project/vllm/pull/31830
[Perf] Optimize cutlass moe problem size calculation, 5.3% E2E Throughput improvement, 2.2% TTFT improvement (#31830)
[Perf] Optimize cutlass moe problem size calculation, 5.3% E2E Throughput improvement, 2.2% TTFT improvement (#31830) Signed-off-by: yewentao256 <zhyanwentao@126.com> Signed-off-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
csrc/quantization/w8a8/cutlass/scaled_mm_entry.cu
cuda
Apache-2.0
#include <cudaTypedefs.h> #include <c10/cuda/CUDAGuard.h> #include <torch/all.h> #include "cutlass_extensions/common.hpp" void cutlass_scaled_mm_sm75(torch::Tensor& c, torch::Tensor const& a, torch::Tensor const& b, torch::Tensor const& a_scales, ...
#include <cudaTypedefs.h> #include <c10/cuda/CUDAGuard.h> #include <torch/all.h> #include "cutlass_extensions/common.hpp" void cutlass_scaled_mm_sm75(torch::Tensor& c, torch::Tensor const& a, torch::Tensor const& b, torch::Tensor const& a_scales, ...
--- csrc/quantization/w8a8/cutlass/scaled_mm_entry.cu +++ csrc/quantization/w8a8/cutlass/scaled_mm_entry.cu @@ -83,6 +83,11 @@ const int64_t k, const std::optional<torch::Tensor>& blockscale_offsets, std::optional<bool> force_swap_ab = std::nullopt); +void get_cutlass_moe_mm_problem_sizes_from_expert_offset...
24
0
5
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/quantization/w8a8/cutlass/scaled_mm_entry.cu). Goal: [Perf] Optimize cutlass moe problem size calculation, 5.3% E2E Throughput improvement, 2.2% TTFT improvement Target hardware: unspecified Target models: unspecified Current file: ```cuda #include <cudaTypedefs.h> #inc...
## Purpose Part of the https://github.com/vllm-project/vllm/issues/31755 Here we add a kernel for faster calculation of problem size ## Test `export MODEL="zai-org/GLM-4.7-FP8"` `vllm serve $MODEL -tp 8 --port 9256 --enable-expert-parallel --max_num_seqs 128` ### Acc `lm_eval --model local-completions --model_...
[]
null
null
vllm
308feab33f3b386a6701cc5b28337bc04fe13a9b
2026-01-09T14:13:43-05:00
31,830
https://github.com/vllm-project/vllm/pull/31830
[Perf] Optimize cutlass moe problem size calculation, 5.3% E2E Throughput improvement, 2.2% TTFT improvement (#31830)
[Perf] Optimize cutlass moe problem size calculation, 5.3% E2E Throughput improvement, 2.2% TTFT improvement (#31830) Signed-off-by: yewentao256 <zhyanwentao@126.com> Signed-off-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
csrc/torch_bindings.cpp
cpp
Apache-2.0
#include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> #include <torch/version.h> // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only /...
#include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> #include <torch/version.h> // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only /...
--- csrc/torch_bindings.cpp +++ csrc/torch_bindings.cpp @@ -487,6 +487,17 @@ ops.impl("get_cutlass_moe_mm_problem_sizes", torch::kCUDA, &get_cutlass_moe_mm_problem_sizes); + // compute per-expert problem sizes from expert_first_token_offset + // produced by vLLM's moe_permute kernel + ops.def( + ...
11
0
5
[]
[]
[]
Optimize this cpp kernel file from vllm (csrc/torch_bindings.cpp). Goal: [Perf] Optimize cutlass moe problem size calculation, 5.3% E2E Throughput improvement, 2.2% TTFT improvement Target hardware: unspecified Target models: unspecified Current file: ```cpp #include "cache.h" #include "cuda_utils.h" #include "ops.h"...
## Purpose Part of the https://github.com/vllm-project/vllm/issues/31755 Here we add a kernel for faster calculation of problem size ## Test `export MODEL="zai-org/GLM-4.7-FP8"` `vllm serve $MODEL -tp 8 --port 9256 --enable-expert-parallel --max_num_seqs 128` ### Acc `lm_eval --model local-completions --model_...
[]
null
null
vllm
34cd32fe302f63270ac90c3ac8ec68b561aac3d7
2026-01-09T09:40:33-05:00
31,832
https://github.com/vllm-project/vllm/pull/31832
[Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe (#31832)
[Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe (#31832) Signed-off-by: mgoin <mgoin64@gmail.com> Signed-off-by: Michael Goin <mgoin64@gmail.com>
csrc/ops.h
cpp
Apache-2.0
#pragma once #include <optional> #include <torch/library.h> #include "core/scalar_type.hpp" #include <vector> torch::Tensor weak_ref_tensor(torch::Tensor& tensor) { // Ensure tensor is on CUDA if (!tensor.is_cuda()) { throw std::runtime_error("Tensor must be on CUDA device"); } // Get the raw data poin...
#pragma once #include <optional> #include <torch/library.h> #include "core/scalar_type.hpp" #include <vector> torch::Tensor weak_ref_tensor(torch::Tensor& tensor) { // Ensure tensor is on CUDA if (!tensor.is_cuda()) { throw std::runtime_error("Tensor must be on CUDA device"); } // Get the raw data poin...
--- csrc/ops.h +++ csrc/ops.h @@ -301,6 +301,12 @@ torch::Tensor const& input_offset_by_experts, torch::Tensor const& output_scale_offset_by_experts); +void silu_and_mul_scaled_fp4_experts_quant( + torch::Tensor& output, torch::Tensor& output_scale, + torch::Tensor const& input, torch::Tensor const& i...
6
0
7
[]
[]
[]
Optimize this cpp kernel file from vllm (csrc/ops.h). Goal: [Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe Target hardware: unspecified Target models: unspecified Current file: ```cpp #pragma once #include <optional> #include <torch/library.h> #include "core/scalar_type.hpp" #include <vector> to...
## Purpose We can easily fuse the silu_and_mul operation into the nvfp4 quantization operation for moe, which we already do for dense nvfp4 as of https://github.com/vllm-project/vllm/pull/23671. This PR just generalizes some utils to expose the same functionality for expert quantization. This seems to improve latency ...
[{"scope": "e2e", "hardware": null, "model": "nvidia/Qwen3-30B-A3B-NVFP4", "shape": "input-len=100,output-len=100", "batch_size": 8, "metric": "benchmark duration", "unit": "s", "higher_is_better": false, "baseline": 0.8, "optimized": 0.78, "stated_speedup": null, "speedup": 1.0256}, {"scope": "e2e", "hardware": null, ...
null
1.0256
vllm
34cd32fe302f63270ac90c3ac8ec68b561aac3d7
2026-01-09T09:40:33-05:00
31,832
https://github.com/vllm-project/vllm/pull/31832
[Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe (#31832)
[Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe (#31832) Signed-off-by: mgoin <mgoin64@gmail.com> Signed-off-by: Michael Goin <mgoin64@gmail.com>
csrc/quantization/fp4/activation_nvfp4_quant_fusion_kernels.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/quantization/fp4/activation_nvfp4_quant_fusion_kernels.cu +++ csrc/quantization/fp4/activation_nvfp4_quant_fusion_kernels.cu @@ -30,37 +30,6 @@ #include "nvfp4_utils.cuh" namespace vllm { - -// silu in float32 -__device__ __forceinline__ float silu(float x) { - return __fdividef(x, (1.f + __expf(-x))); -}...
0
31
7
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/quantization/fp4/activation_nvfp4_quant_fusion_kernels.cu). Goal: [Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2025, NVIDIA CORPORATION. All rights rese...
## Purpose We can easily fuse the silu_and_mul operation into the nvfp4 quantization operation for moe, which we already do for dense nvfp4 as of https://github.com/vllm-project/vllm/pull/23671. This PR just generalizes some utils to expose the same functionality for expert quantization. This seems to improve latency ...
[{"scope": "e2e", "hardware": null, "model": "nvidia/Qwen3-30B-A3B-NVFP4", "shape": "input-len=100,output-len=100", "batch_size": 8, "metric": "benchmark duration", "unit": "s", "higher_is_better": false, "baseline": 0.8, "optimized": 0.78, "stated_speedup": null, "speedup": 1.0256}, {"scope": "e2e", "hardware": null, ...
null
1.0256
vllm
34cd32fe302f63270ac90c3ac8ec68b561aac3d7
2026-01-09T09:40:33-05:00
31,832
https://github.com/vllm-project/vllm/pull/31832
[Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe (#31832)
[Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe (#31832) Signed-off-by: mgoin <mgoin64@gmail.com> Signed-off-by: Michael Goin <mgoin64@gmail.com>
csrc/quantization/fp4/nvfp4_experts_quant.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/quantization/fp4/nvfp4_experts_quant.cu +++ csrc/quantization/fp4/nvfp4_experts_quant.cu @@ -31,8 +31,12 @@ namespace vllm { +// NVFP4 quantization kernel for experts (low-latency path). +// When FUSE_SILU_MUL=true, expects input with gate||up layout and fuses +// SiLU(gate)*up before quantization. // Us...
137
58
7
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/quantization/fp4/nvfp4_experts_quant.cu). Goal: [Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licens...
## Purpose We can easily fuse the silu_and_mul operation into the nvfp4 quantization operation for moe, which we already do for dense nvfp4 as of https://github.com/vllm-project/vllm/pull/23671. This PR just generalizes some utils to expose the same functionality for expert quantization. This seems to improve latency ...
[{"scope": "e2e", "hardware": null, "model": "nvidia/Qwen3-30B-A3B-NVFP4", "shape": "input-len=100,output-len=100", "batch_size": 8, "metric": "benchmark duration", "unit": "s", "higher_is_better": false, "baseline": 0.8, "optimized": 0.78, "stated_speedup": null, "speedup": 1.0256}, {"scope": "e2e", "hardware": null, ...
null
1.0256
vllm
34cd32fe302f63270ac90c3ac8ec68b561aac3d7
2026-01-09T09:40:33-05:00
31,832
https://github.com/vllm-project/vllm/pull/31832
[Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe (#31832)
[Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe (#31832) Signed-off-by: mgoin <mgoin64@gmail.com> Signed-off-by: Michael Goin <mgoin64@gmail.com>
csrc/quantization/fp4/nvfp4_quant_entry.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/quantization/fp4/nvfp4_quant_entry.cu +++ csrc/quantization/fp4/nvfp4_quant_entry.cu @@ -41,6 +41,15 @@ torch::Tensor& input_sf); #endif +#if (defined(ENABLE_NVFP4_SM100) && ENABLE_NVFP4_SM100) || \ + (defined(ENABLE_NVFP4_SM120) && ENABLE_NVFP4_SM120) +void silu_and...
24
0
7
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/quantization/fp4/nvfp4_quant_entry.cu). Goal: [Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licensed...
## Purpose We can easily fuse the silu_and_mul operation into the nvfp4 quantization operation for moe, which we already do for dense nvfp4 as of https://github.com/vllm-project/vllm/pull/23671. This PR just generalizes some utils to expose the same functionality for expert quantization. This seems to improve latency ...
[{"scope": "e2e", "hardware": null, "model": "nvidia/Qwen3-30B-A3B-NVFP4", "shape": "input-len=100,output-len=100", "batch_size": 8, "metric": "benchmark duration", "unit": "s", "higher_is_better": false, "baseline": 0.8, "optimized": 0.78, "stated_speedup": null, "speedup": 1.0256}, {"scope": "e2e", "hardware": null, ...
null
1.0256
vllm
34cd32fe302f63270ac90c3ac8ec68b561aac3d7
2026-01-09T09:40:33-05:00
31,832
https://github.com/vllm-project/vllm/pull/31832
[Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe (#31832)
[Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe (#31832) Signed-off-by: mgoin <mgoin64@gmail.com> Signed-off-by: Michael Goin <mgoin64@gmail.com>
csrc/quantization/fp4/nvfp4_utils.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 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/quantization/fp4/nvfp4_utils.cuh +++ csrc/quantization/fp4/nvfp4_utils.cuh @@ -239,4 +239,34 @@ return e2m1Vec; } +// silu in float32 +__device__ __forceinline__ float silu(float x) { + return __fdividef(x, (1.f + __expf(-x))); +} + +__device__ __forceinline__ float2 silu2(float2 x) { + return make_flo...
30
0
7
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/quantization/fp4/nvfp4_utils.cuh). Goal: [Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licensed unde...
## Purpose We can easily fuse the silu_and_mul operation into the nvfp4 quantization operation for moe, which we already do for dense nvfp4 as of https://github.com/vllm-project/vllm/pull/23671. This PR just generalizes some utils to expose the same functionality for expert quantization. This seems to improve latency ...
[{"scope": "e2e", "hardware": null, "model": "nvidia/Qwen3-30B-A3B-NVFP4", "shape": "input-len=100,output-len=100", "batch_size": 8, "metric": "benchmark duration", "unit": "s", "higher_is_better": false, "baseline": 0.8, "optimized": 0.78, "stated_speedup": null, "speedup": 1.0256}, {"scope": "e2e", "hardware": null, ...
null
1.0256
vllm
34cd32fe302f63270ac90c3ac8ec68b561aac3d7
2026-01-09T09:40:33-05:00
31,832
https://github.com/vllm-project/vllm/pull/31832
[Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe (#31832)
[Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe (#31832) Signed-off-by: mgoin <mgoin64@gmail.com> Signed-off-by: Michael Goin <mgoin64@gmail.com>
csrc/torch_bindings.cpp
cpp
Apache-2.0
#include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> #include <torch/version.h> // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only /...
#include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> #include <torch/version.h> // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only /...
--- csrc/torch_bindings.cpp +++ csrc/torch_bindings.cpp @@ -558,6 +558,15 @@ "Tensor output_scale_offset_by_experts) -> ()"); ops.impl("scaled_fp4_experts_quant", torch::kCUDA, &scaled_fp4_experts_quant); + // Fused SiLU+Mul+NVFP4 experts quantization. + ops.def( + "silu_and_mul_scaled_fp4_experts_qu...
9
0
7
[]
[]
[]
Optimize this cpp kernel file from vllm (csrc/torch_bindings.cpp). Goal: [Perf][Kernel] Fused SiLU+Mul+Quant kernel for NVFP4 cutlass_moe Target hardware: unspecified Target models: unspecified Current file: ```cpp #include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <t...
## Purpose We can easily fuse the silu_and_mul operation into the nvfp4 quantization operation for moe, which we already do for dense nvfp4 as of https://github.com/vllm-project/vllm/pull/23671. This PR just generalizes some utils to expose the same functionality for expert quantization. This seems to improve latency ...
[{"scope": "e2e", "hardware": null, "model": "nvidia/Qwen3-30B-A3B-NVFP4", "shape": "input-len=100,output-len=100", "batch_size": 8, "metric": "benchmark duration", "unit": "s", "higher_is_better": false, "baseline": 0.8, "optimized": 0.78, "stated_speedup": null, "speedup": 1.0256}, {"scope": "e2e", "hardware": null, ...
null
1.0256
vllm
1a19e9cd87b6bb091fc9c530e6446601db52b58e
2026-01-09T12:28:02+01:00
31,380
https://github.com/vllm-project/vllm/pull/31380
[Bugfix][ROCm]Fix Qwen3-Next-80B-A3B-Thinking inference and optimize non-standard block size (544) support under rocm_atten (#31380)
[Bugfix][ROCm]Fix Qwen3-Next-80B-A3B-Thinking inference and optimize non-standard block size (544) support under rocm_atten (#31380) Signed-off-by: vllmellm <vllm.ellm@embeddedllm.com>
vllm/attention/ops/chunked_prefill_paged_decode.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Authors: # - Burkhard Ringlein <ngl@zurich.ibm.com> # - Jan van Lunteren <jvl@zurich.ibm.com> # - Chih-Chieh Yang <chih.chieh.yang@ibm.com> # - Thomas Parnell <tpa@zurich.ibm.com> import torch from vllm i...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Authors: # - Burkhard Ringlein <ngl@zurich.ibm.com> # - Jan van Lunteren <jvl@zurich.ibm.com> # - Chih-Chieh Yang <chih.chieh.yang@ibm.com> # - Thomas Parnell <tpa@zurich.ibm.com> import torch from vllm i...
--- vllm/attention/ops/chunked_prefill_paged_decode.py +++ vllm/attention/ops/chunked_prefill_paged_decode.py @@ -46,6 +46,7 @@ output_stride_0: tl.int64, # int output_stride_1: tl.int64, # int, should be equal to head_size BLOCK_SIZE: tl.constexpr, # int + PHYSICAL_BLOCK_SIZE: tl.constexpr, # int...
85
30
4
[ "qwen" ]
[ "ROCM" ]
[]
Optimize this triton kernel file from vllm (vllm/attention/ops/chunked_prefill_paged_decode.py). Goal: [Bugfix][ROCm]Fix Qwen3-Next-80B-A3B-Thinking inference and optimize non-standard block size (544) support under rocm_atten Target hardware: ROCM Target models: qwen Current file: ```python # SPDX-License-Identifier...
## Purpose Fixes #26473 This PR refactors the rocm_attn backend kernels to support models with non-power-of-2 block sizes, specifically the Qwen/Qwen3-Next-80B-A3B-Thinking model. The core of this update is a Dynamic Dispatching Mechanism:Standard Path ($2^n$): For models with power-of-2 block sizes (16, 32, 64, 128...
[]
null
null
vllm
1a19e9cd87b6bb091fc9c530e6446601db52b58e
2026-01-09T12:28:02+01:00
31,380
https://github.com/vllm-project/vllm/pull/31380
[Bugfix][ROCm]Fix Qwen3-Next-80B-A3B-Thinking inference and optimize non-standard block size (544) support under rocm_atten (#31380)
[Bugfix][ROCm]Fix Qwen3-Next-80B-A3B-Thinking inference and optimize non-standard block size (544) support under rocm_atten (#31380) Signed-off-by: vllmellm <vllm.ellm@embeddedllm.com>
vllm/attention/ops/prefix_prefill.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # The kernels in this file are adapted from LightLLM's context_attention_fwd: # https://github.com/ModelTC/lightllm/blob/main/lightllm/models/llama/triton_kernel/context_flashattention_nopad.py import torch fro...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # The kernels in this file are adapted from LightLLM's context_attention_fwd: # https://github.com/ModelTC/lightllm/blob/main/lightllm/models/llama/triton_kernel/context_flashattention_nopad.py import torch fro...
--- vllm/attention/ops/prefix_prefill.py +++ vllm/attention/ops/prefix_prefill.py @@ -79,6 +79,7 @@ BLOCK_DMODEL: tl.constexpr, BLOCK_DMODEL_PADDED: tl.constexpr, BLOCK_SIZE: tl.constexpr, + PHYSICAL_BLOCK_SIZE: tl.constexpr, BLOCK_N: tl.constexpr, SLIDING_WINDOW: tl.constexpr, num_unro...
81
33
4
[ "qwen" ]
[ "ROCM" ]
[]
Optimize this triton kernel file from vllm (vllm/attention/ops/prefix_prefill.py). Goal: [Bugfix][ROCm]Fix Qwen3-Next-80B-A3B-Thinking inference and optimize non-standard block size (544) support under rocm_atten Target hardware: ROCM Target models: qwen Current file: ```python # SPDX-License-Identifier: Apache-2.0 #...
## Purpose Fixes #26473 This PR refactors the rocm_attn backend kernels to support models with non-power-of-2 block sizes, specifically the Qwen/Qwen3-Next-80B-A3B-Thinking model. The core of this update is a Dynamic Dispatching Mechanism:Standard Path ($2^n$): For models with power-of-2 block sizes (16, 32, 64, 128...
[]
null
null
vllm
1a19e9cd87b6bb091fc9c530e6446601db52b58e
2026-01-09T12:28:02+01:00
31,380
https://github.com/vllm-project/vllm/pull/31380
[Bugfix][ROCm]Fix Qwen3-Next-80B-A3B-Thinking inference and optimize non-standard block size (544) support under rocm_atten (#31380)
[Bugfix][ROCm]Fix Qwen3-Next-80B-A3B-Thinking inference and optimize non-standard block size (544) support under rocm_atten (#31380) Signed-off-by: vllmellm <vllm.ellm@embeddedllm.com>
vllm/attention/ops/triton_reshape_and_cache_flash.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project import torch from vllm.platforms import current_platform from vllm.triton_utils import tl, triton @triton.jit def reshape_and_cache_kernel_flash( key_ptr, # [num_tokens, num_heads, head_size] value_pt...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project import torch from vllm.platforms import current_platform from vllm.triton_utils import tl, triton @triton.jit def reshape_and_cache_kernel_flash( key_ptr, # [num_tokens, num_heads, head_size] value_pt...
--- vllm/attention/ops/triton_reshape_and_cache_flash.py +++ vllm/attention/ops/triton_reshape_and_cache_flash.py @@ -20,10 +20,15 @@ key_stride: tl.int64, value_stride: tl.int64, block_stride: tl.int64, + head_stride: tl.int64, + dim_stride_k: tl.int64, + dim_stride_v: tl.int64, page_strid...
52
12
4
[ "qwen" ]
[ "ROCM" ]
[]
Optimize this triton kernel file from vllm (vllm/attention/ops/triton_reshape_and_cache_flash.py). Goal: [Bugfix][ROCm]Fix Qwen3-Next-80B-A3B-Thinking inference and optimize non-standard block size (544) support under rocm_atten Target hardware: ROCM Target models: qwen Current file: ```python # SPDX-License-Identifi...
## Purpose Fixes #26473 This PR refactors the rocm_attn backend kernels to support models with non-power-of-2 block sizes, specifically the Qwen/Qwen3-Next-80B-A3B-Thinking model. The core of this update is a Dynamic Dispatching Mechanism:Standard Path ($2^n$): For models with power-of-2 block sizes (16, 32, 64, 128...
[]
null
null
vllm
f347ac6c346f8e84a75ec975618c5aa79c1b9db5
2026-01-07T13:31:26-05:00
31,837
https://github.com/vllm-project/vllm/pull/31837
[Perf] Fuse stride preparation for NVFP4 cutlass_moe (#31837)
[Perf] Fuse stride preparation for NVFP4 cutlass_moe (#31837) Signed-off-by: mgoin <mgoin64@gmail.com>
csrc/quantization/fp4/nvfp4_blockwise_moe_kernel.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/quantization/fp4/nvfp4_blockwise_moe_kernel.cu +++ csrc/quantization/fp4/nvfp4_blockwise_moe_kernel.cu @@ -62,7 +62,9 @@ ElementSF* a_scales_base_as_int, ElementSF* b_scales_base_as_int, ElementAccumulator* alphas_base_as_int, const int32_t* expert_offsets, const int32_t* sf_offsets, const int32...
30
18
1
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/quantization/fp4/nvfp4_blockwise_moe_kernel.cu). Goal: [Perf] Fuse stride preparation for NVFP4 cutlass_moe Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licensed un...
## Purpose When profiling another PR, I noticed that there were always 3 `vectorized_elementwise_kernel` kernels when calling the `ops.cutlass_fp4_moe_mm` function and found these `torch::full` constructors. The kernel `__get_group_gemm_starts` already runs once per-expert to set up pointers. We can add stride initial...
[{"scope": "e2e", "hardware": null, "model": "nvidia/Qwen3-30B-A3B-NVFP4", "shape": "input-len=100,output-len=100", "batch_size": 8, "metric": "Request throughput", "unit": "req/s", "higher_is_better": true, "baseline": 10.25, "optimized": 10.79, "stated_speedup": null, "speedup": 1.0527}, {"scope": "e2e", "hardware": ...
null
1.0256
vllm
cc6dafaef2bc6b0a3ea0d80efc93985fce6bc8b9
2026-01-07T07:53:54-08:00
29,213
https://github.com/vllm-project/vllm/pull/29213
[Perf][Kernels] Enable FlashInfer DeepGEMM swapAB on SM90 (for W8A8 Linear Op) (#29213)
[Perf][Kernels] Enable FlashInfer DeepGEMM swapAB on SM90 (for W8A8 Linear Op) (#29213) Signed-off-by: Kate Cheng <yunhsuanc@nvidia.com> Signed-off-by: Jhao-Ting Chen <jhaotingc@nvidia.com> Co-authored-by: Jhao-Ting Chen <jhaotingc@nvidia.com>
vllm/model_executor/layers/quantization/utils/fp8_utils.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from https://github.com/sgl-project/sglang/pull/2575 import functools import json import os from collections.abc import Callable, Sequence from typing import Any import torch import vllm.envs as envs ...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from https://github.com/sgl-project/sglang/pull/2575 import functools import json import os from collections.abc import Callable, Sequence from typing import Any import torch import vllm.envs as envs ...
--- vllm/model_executor/layers/quantization/utils/fp8_utils.py +++ vllm/model_executor/layers/quantization/utils/fp8_utils.py @@ -38,6 +38,11 @@ should_use_deepgemm_for_fp8_linear, transform_sf_into_required_layout, ) +from vllm.utils.flashinfer import ( + flashinfer_fp8_blockscale_gemm, + is_flashinfe...
143
1
1
[]
[ "SM90" ]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/quantization/utils/fp8_utils.py). Goal: [Perf][Kernels] Enable FlashInfer DeepGEMM swapAB on SM90 (for W8A8 Linear Op) Target hardware: SM90 Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyri...
### **Purpose** Per https://github.com/vllm-project/vllm/issues/28427, https://github.com/vllm-project/vllm/issues/28316, TRTLLM has `fp8_gemm_kernel_swapAB` kernel for blockscale FP8 gemm in linear layer. This PR https://github.com/vllm-project/vllm/pull/29213 (and FlashInfer PR https://github.com/flashinfer-ai/flash...
[{"scope": "e2e", "hardware": "H200", "model": "DeepSeek-V3.1", "shape": null, "batch_size": 4, "metric": "output token throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 314.7, "optimized": 350.57, "stated_speedup": null, "speedup": 1.114}, {"scope": "e2e", "hardware": "H200", "model": "DeepSeek-V3.1"...
1.1457
1.06
vllm
22dffca9822987f0e912bfd9635e94bbdd05def3
2026-01-06T21:32:46+04:00
31,722
https://github.com/vllm-project/vllm/pull/31722
[PERF] Speed-up of GDN attention decode part (Qwen3-Next) (#31722)
[PERF] Speed-up of GDN attention decode part (Qwen3-Next) (#31722) Signed-off-by: Vadim Gimpelson <vadim.gimpelson@gmail.com>
vllm/model_executor/layers/fla/ops/fused_recurrent.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Songlin Yang, Yu Zhang # # This file contains code copied from the flash-linear-attention project. # The original source code was licensed under the MIT license and included # the followi...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Songlin Yang, Yu Zhang # # This file contains code copied from the flash-linear-attention project. # The original source code was licensed under the MIT license and included # the followi...
--- vllm/model_executor/layers/fla/ops/fused_recurrent.py +++ vllm/model_executor/layers/fla/ops/fused_recurrent.py @@ -189,7 +189,7 @@ B, T, H, K, V = *k.shape, v.shape[-1] HV = v.shape[2] N = B if cu_seqlens is None else len(cu_seqlens) - 1 - BK, BV = triton.next_power_of_2(K), min(triton.next_power...
1
1
1
[ "qwen" ]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/fla/ops/fused_recurrent.py). Goal: [PERF] Speed-up of GDN attention decode part (Qwen3-Next) Target hardware: unspecified Target models: qwen Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contrib...
Speed Up GDN Attention (Decode) - `fused_recurrent_gated_delta_rule_fwd` # Benchmarks ## H200 — `fused_recurrent_gated_delta_rule_fwd` with shapes from Qwen3-Next ### Before | Batch Size | TP=4 (μs) | TP=2 (μs) | |-----------:|----------:|----------:| | 32 | 19.87 ± 0.08 | 30.14 ± 0.02 | | 128 | 52.06 ± 0.02 | 9...
[{"scope": "kernel", "hardware": "H200", "model": "Qwen3-Next", "shape": "TP=4", "batch_size": 32, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 19.87, "optimized": 13.6, "stated_speedup": null, "speedup": 1.461}, {"scope": "kernel", "hardware": "H200", "model": "Qwen3-Next", "shape": "TP=2"...
1.5423
1.168
vllm
7cd288a4b3f45f3524134b9915c35accd668c2f0
2025-12-24T19:17:49+05:30
30,800
https://github.com/vllm-project/vllm/pull/30800
[PERF] Add interleaved memory allocation to NUMA module (#30800)
[PERF] Add interleaved memory allocation to NUMA module (#30800)
csrc/cpu/utils.cpp
cpp
Apache-2.0
#ifndef VLLM_NUMA_DISABLED #include <numa.h> #include <unistd.h> #include <string> #include <sched.h> #endif #if __GLIBC__ == 2 && __GLIBC_MINOR__ < 30 #include <unistd.h> #include <sys/syscall.h> #define gettid() syscall(SYS_gettid) #endif #include "cpu/utils.hpp" #ifdef VLLM_NUMA_DISABLED std::string ...
#ifndef VLLM_NUMA_DISABLED #include <numa.h> #include <unistd.h> #include <string> #include <sched.h> #endif #if __GLIBC__ == 2 && __GLIBC_MINOR__ < 30 #include <unistd.h> #include <sys/syscall.h> #define gettid() syscall(SYS_gettid) #endif #include "cpu/utils.hpp" #ifdef VLLM_NUMA_DISABLED std::string ...
--- csrc/cpu/utils.cpp +++ csrc/cpu/utils.cpp @@ -24,6 +24,8 @@ #ifndef VLLM_NUMA_DISABLED std::string init_cpu_threads_env(const std::string& cpu_ids) { bitmask* omp_cpu_mask = numa_parse_cpustring_all(cpu_ids.c_str()); + TORCH_CHECK(omp_cpu_mask != nullptr, + "Failed to parse CPU string: " + cpu_id...
38
13
1
[]
[ "CPU" ]
[]
Optimize this cpp kernel file from vllm (csrc/cpu/utils.cpp). Goal: [PERF] Add interleaved memory allocation to NUMA module Target hardware: CPU Target models: unspecified Current file: ```cpp #ifndef VLLM_NUMA_DISABLED #include <numa.h> #include <unistd.h> #include <string> #include <sched.h> #endif #if __GL...
## Purpose This PR adds support for interleaved memory allocation when the system is configured with more than one NUMA node. Enabling interleaved allocation helps distribute memory traffic across nodes more evenly, which is particularly beneficial for memory-bound workloads. In summary, this PR: - Introduces NUMA-awar...
[{"scope": "e2e", "hardware": "AMD EPYC", "model": null, "shape": null, "batch_size": 96, "metric": "throughput", "unit": null, "higher_is_better": true, "baseline": null, "optimized": null, "stated_speedup": 1.3, "speedup": 1.3}]
null
1.3
vllm
06d490282f2bab6922137eb5230be9df5ebbe9c4
2025-12-21T12:41:57-05:00
30,897
https://github.com/vllm-project/vllm/pull/30897
[NVFP4][Perf] Tune NVFP4 input quant kernel for small batch size (#30897)
[NVFP4][Perf] Tune NVFP4 input quant kernel for small batch size (#30897) Signed-off-by: mgoin <mgoin64@gmail.com>
csrc/quantization/fp4/activation_nvfp4_quant_fusion_kernels.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/quantization/fp4/activation_nvfp4_quant_fusion_kernels.cu +++ csrc/quantization/fp4/activation_nvfp4_quant_fusion_kernels.cu @@ -74,6 +74,9 @@ static_assert(sizeof(PackedVec) == sizeof(Type) * CVT_FP4_ELTS_PER_THREAD, "Vec size is not matched."); + // Precompute SF layout parameter (cons...
4
1
4
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/quantization/fp4/activation_nvfp4_quant_fusion_kernels.cu). Goal: [NVFP4][Perf] Tune NVFP4 input quant kernel for small batch size Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2025, NVIDIA CORPORATION. All rights rese...
## Purpose We discovered that the nvfp4 input quant operation was severely bottlenecking performance for dense models at small batch sizes. While investigating the flashinfer impl, I noticed that there is logic to [increase the grid size for small M](https://github.com/flashinfer-ai/flashinfer/blob/f0592411a3478d0548d...
[{"scope": "e2e", "hardware": null, "model": "Qwen3-8B-NVFP4", "shape": null, "batch_size": 1, "metric": "throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 220, "optimized": 276, "stated_speedup": 1.25, "speedup": 1.2545}, {"scope": "e2e", "hardware": null, "model": "Qwen3-30B-A3B-NVFP4", "shape": nul...
null
1.1564
vllm
06d490282f2bab6922137eb5230be9df5ebbe9c4
2025-12-21T12:41:57-05:00
30,897
https://github.com/vllm-project/vllm/pull/30897
[NVFP4][Perf] Tune NVFP4 input quant kernel for small batch size (#30897)
[NVFP4][Perf] Tune NVFP4 input quant kernel for small batch size (#30897) Signed-off-by: mgoin <mgoin64@gmail.com>
csrc/quantization/fp4/nvfp4_experts_quant.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/quantization/fp4/nvfp4_experts_quant.cu +++ csrc/quantization/fp4/nvfp4_experts_quant.cu @@ -25,6 +25,7 @@ #include <cuda_fp8.h> #include "dispatch_utils.h" +#include "cuda_utils.h" #include "nvfp4_utils.cuh" #include "launch_bounds_utils.h" @@ -43,6 +44,9 @@ (CVT_FP4_SF_VEC_SIZE / CVT_FP4_ELTS_...
14
17
4
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/quantization/fp4/nvfp4_experts_quant.cu). Goal: [NVFP4][Perf] Tune NVFP4 input quant kernel for small batch size Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licens...
## Purpose We discovered that the nvfp4 input quant operation was severely bottlenecking performance for dense models at small batch sizes. While investigating the flashinfer impl, I noticed that there is logic to [increase the grid size for small M](https://github.com/flashinfer-ai/flashinfer/blob/f0592411a3478d0548d...
[{"scope": "e2e", "hardware": null, "model": "Qwen3-8B-NVFP4", "shape": null, "batch_size": 1, "metric": "throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 220, "optimized": 276, "stated_speedup": 1.25, "speedup": 1.2545}, {"scope": "e2e", "hardware": null, "model": "Qwen3-30B-A3B-NVFP4", "shape": nul...
null
1.1564
vllm
06d490282f2bab6922137eb5230be9df5ebbe9c4
2025-12-21T12:41:57-05:00
30,897
https://github.com/vllm-project/vllm/pull/30897
[NVFP4][Perf] Tune NVFP4 input quant kernel for small batch size (#30897)
[NVFP4][Perf] Tune NVFP4 input quant kernel for small batch size (#30897) Signed-off-by: mgoin <mgoin64@gmail.com>
csrc/quantization/fp4/nvfp4_quant_kernels.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/quantization/fp4/nvfp4_quant_kernels.cu +++ csrc/quantization/fp4/nvfp4_quant_kernels.cu @@ -38,6 +38,12 @@ return (x + y - 1) / y * y; } +// Compute effective rows for grid configuration with swizzled SF layouts. +inline int computeEffectiveRows(int m) { + constexpr int ROW_TILE = 128; + return round_...
20
42
4
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/quantization/fp4/nvfp4_quant_kernels.cu). Goal: [NVFP4][Perf] Tune NVFP4 input quant kernel for small batch size Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licens...
## Purpose We discovered that the nvfp4 input quant operation was severely bottlenecking performance for dense models at small batch sizes. While investigating the flashinfer impl, I noticed that there is logic to [increase the grid size for small M](https://github.com/flashinfer-ai/flashinfer/blob/f0592411a3478d0548d...
[{"scope": "e2e", "hardware": null, "model": "Qwen3-8B-NVFP4", "shape": null, "batch_size": 1, "metric": "throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 220, "optimized": 276, "stated_speedup": 1.25, "speedup": 1.2545}, {"scope": "e2e", "hardware": null, "model": "Qwen3-30B-A3B-NVFP4", "shape": nul...
null
1.1564
vllm
06d490282f2bab6922137eb5230be9df5ebbe9c4
2025-12-21T12:41:57-05:00
30,897
https://github.com/vllm-project/vllm/pull/30897
[NVFP4][Perf] Tune NVFP4 input quant kernel for small batch size (#30897)
[NVFP4][Perf] Tune NVFP4 input quant kernel for small batch size (#30897) Signed-off-by: mgoin <mgoin64@gmail.com>
csrc/quantization/fp4/nvfp4_utils.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 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/quantization/fp4/nvfp4_utils.cuh +++ csrc/quantization/fp4/nvfp4_utils.cuh @@ -128,51 +128,42 @@ return b; } +// Compute SF output offset for swizzled tensor core layout. +// SF layout: [numMTiles, numKTiles, 32, 4, 4] +// Caller must precompute: numKTiles = (numCols + 63) / 64 template <class SFType, i...
29
38
4
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/quantization/fp4/nvfp4_utils.cuh). Goal: [NVFP4][Perf] Tune NVFP4 input quant kernel for small batch size Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. * * Licensed unde...
## Purpose We discovered that the nvfp4 input quant operation was severely bottlenecking performance for dense models at small batch sizes. While investigating the flashinfer impl, I noticed that there is logic to [increase the grid size for small M](https://github.com/flashinfer-ai/flashinfer/blob/f0592411a3478d0548d...
[{"scope": "e2e", "hardware": null, "model": "Qwen3-8B-NVFP4", "shape": null, "batch_size": 1, "metric": "throughput", "unit": "tok/s", "higher_is_better": true, "baseline": 220, "optimized": 276, "stated_speedup": 1.25, "speedup": 1.2545}, {"scope": "e2e", "hardware": null, "model": "Qwen3-30B-A3B-NVFP4", "shape": nul...
null
1.1564
vllm
0a1ab1e565fce5070bc1c1b1f3374537e437550c
2025-12-16T17:56:02-05:00
29,512
https://github.com/vllm-project/vllm/pull/29512
[Perf][Kernels] Vectorize `csrc/activations_kernels.cu` (#29512)
[Perf][Kernels] Vectorize `csrc/activations_kernels.cu` (#29512) Signed-off-by: mgoin <mgoin64@gmail.com>
csrc/activation_kernels.cu
cuda
Apache-2.0
#include <ATen/cuda/CUDAContext.h> #include <torch/all.h> #include <c10/cuda/CUDAGuard.h> #include <cmath> #include "cuda_compat.h" #include "dispatch_utils.h" namespace vllm { template <typename scalar_t, scalar_t (*ACT_FN)(const scalar_t&), bool act_first> __device__ __forceinline__ scalar_t compute(con...
#include <ATen/cuda/CUDAContext.h> #include <torch/all.h> #include <c10/cuda/CUDAGuard.h> #include <cmath> #include "cuda_compat.h" #include "dispatch_utils.h" namespace vllm { template <typename scalar_t, scalar_t (*ACT_FN)(const scalar_t&), bool act_first> __device__ __forceinline__ scalar_t compute(con...
--- csrc/activation_kernels.cu +++ csrc/activation_kernels.cu @@ -15,19 +15,61 @@ const scalar_t& y) { return act_first ? ACT_FN(x) * y : x * ACT_FN(y); } + +// Check if all pointers are 16-byte aligned for int4 vectorized access +__device__ __forceinline__ bool is_16byt...
176
38
1
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/activation_kernels.cu). Goal: [Perf][Kernels] Vectorize `csrc/activations_kernels.cu` Target hardware: unspecified Target models: unspecified Current file: ```cuda #include <ATen/cuda/CUDAContext.h> #include <torch/all.h> #include <c10/cuda/CUDAGuard.h> #include <cmath>...
<!-- markdownlint-disable --> ## Purpose We have been using `silu_and_mul`, `swigluoai_and_mul`, etc as unvectorized kernels for essentially all of the fused moe methods, so there are free gains to be had there, especially for large batch sizes. This PR expands all of them to 128 bit vectorized loads. ## Traces ```...
[]
null
null
vllm
6e78ed6ba7f3671f866766f93c6d3571e5bf504d
2025-12-13T16:12:53-05:00
29,903
https://github.com/vllm-project/vllm/pull/29903
[Logs] Optimize startup logs 4 (#29903)
[Logs] Optimize startup logs 4 (#29903) Signed-off-by: yewentao256 <zhyanwentao@126.com> Signed-off-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
vllm/model_executor/layers/fused_moe/fused_moe.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Fused MoE Triton kernels.""" import functools import json import os from collections.abc import Callable from typing import Any import torch import torch.nn.functional as F import vllm.envs as envs import vl...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Fused MoE Triton kernels.""" import functools import json import os from collections.abc import Callable from typing import Any import torch import torch.nn.functional as F import vllm.envs as envs import vl...
--- vllm/model_executor/layers/fused_moe/fused_moe.py +++ vllm/model_executor/layers/fused_moe/fused_moe.py @@ -885,12 +885,11 @@ # If no optimized configuration is available, we will use the default # configuration - logger.warning( - ( - "Using default MoE config. Performance might be...
5
6
2
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/fused_moe/fused_moe.py). Goal: [Logs] Optimize startup logs 4 Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM projec...
## Purpose Example: ```bash (Worker_TP5_EP5 pid=626382) INFO 12-02 09:01:00 [backends.py:216] Directly load the compiled graph(s) for dynamic shape from the cache, took 7.017 s (Worker_TP2_EP2 pid=626379) INFO 12-02 09:01:01 [backends.py:216] Directly load the compiled graph(s) for dynamic shape from the cache, took...
[]
null
null
vllm
c817b1415121cf88178af1e4e78f651d802df4da
2025-12-11T17:28:34-05:00
30,494
https://github.com/vllm-project/vllm/pull/30494
[Perf] Optimize deepgemm experts initialization, 3.9% TTFT improvement (#30494)
[Perf] Optimize deepgemm experts initialization, 3.9% TTFT improvement (#30494) Signed-off-by: yewentao256 <zhyanwentao@126.com> Co-authored-by: li-jinpeng <3332126450@qq.com> Co-authored-by: youkaichao <youkaichao@gmail.com>
vllm/model_executor/layers/fused_moe/deep_gemm_utils.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """ Taken from https://github.com/ModelTC/LightLLM/blob/8ed97c74c18f11505b048b1ba00ba5c0cef8bff6/lightllm/common/fused_moe/deepep_scatter_gather.py and updated to fit vllm needs and terminology. """ import torch ...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """ Taken from https://github.com/ModelTC/LightLLM/blob/8ed97c74c18f11505b048b1ba00ba5c0cef8bff6/lightllm/common/fused_moe/deepep_scatter_gather.py and updated to fit vllm needs and terminology. """ import torch ...
--- vllm/model_executor/layers/fused_moe/deep_gemm_utils.py +++ vllm/model_executor/layers/fused_moe/deep_gemm_utils.py @@ -84,10 +84,16 @@ m_indices_start_ptr = m_indices + cur_expert_start off_expert = tl.arange(0, BLOCK_E) + # any rows in the per-expert aligned region that do not correspond to + # ...
18
7
1
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/fused_moe/deep_gemm_utils.py). Goal: [Perf] Optimize deepgemm experts initialization, 3.9% TTFT improvement Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightT...
## Purpose Thanks for the context from @youkaichao ! Co-author: @li-jinpeng DeepGEMM uses negative values in m_indices (here expert_ids) to mark completely invalid / padded blocks that should be skipped. We always initialize expert_ids to -1 so any row that is not explicitly written by the scatter kernel will be tr...
[]
null
null
vllm
0ee6416f678de761f827f4bd387b36f0cbc43a0a
2025-12-08T19:44:01-05:00
30,159
https://github.com/vllm-project/vllm/pull/30159
[Perf] Optimize `group_topk` kernel, 1.9% Throughput improvement, 2.1% TPOT improvemnt (#30159)
[Perf] Optimize `group_topk` kernel, 1.9% Throughput improvement, 2.1% TPOT improvemnt (#30159) Signed-off-by: yewentao256 <zhyanwentao@126.com>
csrc/moe/grouped_topk_kernels.cu
cuda
Apache-2.0
/* * Adapted from * https://github.com/NVIDIA/TensorRT-LLM/blob/v0.21.0/cpp/tensorrt_llm/kernels/noAuxTcKernels.cu * Copyright (c) 2025, The vLLM team. * SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & * AFFILIATES. All rights reserved. SPDX-License-Identifier: Apache-2.0 * * Licensed under ...
/* * Adapted from * https://github.com/NVIDIA/TensorRT-LLM/blob/v0.21.0/cpp/tensorrt_llm/kernels/noAuxTcKernels.cu * Copyright (c) 2025, The vLLM team. * SPDX-FileCopyrightText: Copyright (c) 1993-2024 NVIDIA CORPORATION & * AFFILIATES. All rights reserved. SPDX-License-Identifier: Apache-2.0 * * Licensed under ...
--- csrc/moe/grouped_topk_kernels.cu +++ csrc/moe/grouped_topk_kernels.cu @@ -444,23 +444,27 @@ return cuda_cast<T, float>(sigmoid_accurate(f)); } -template <typename T> +template <ScoringFunc SF, typename T> +__device__ inline T apply_scoring(T val) { + if constexpr (SF == SCORING_SIGMOID) { + return apply_s...
128
47
1
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/moe/grouped_topk_kernels.cu). Goal: [Perf] Optimize `group_topk` kernel, 1.9% Throughput improvement, 2.1% TPOT improvemnt Target hardware: unspecified Target models: unspecified Current file: ```cuda /* * Adapted from * https://github.com/NVIDIA/TensorRT-LLM/blob/v0.2...
## Purpose We are trying to optimize the GLMv4.6 model, this kernel takes a lot of time and we try to reduce this first. This optimization could be also used for other models like V3.2 etc. Optimize the kernel, mainly: 1. Use template for the scoring function 2. unroll some usual ngroup ## Test `export MODEL="zai-...
[]
null
null
vllm
af0444bf40b7db2f3fb9fe1508d25ceba24cac87
2025-12-07T17:38:04+01:00
27,883
https://github.com/vllm-project/vllm/pull/27883
[Performance] Fused blockwise quant RMS norm (#27883)
[Performance] Fused blockwise quant RMS norm (#27883) Signed-off-by: ElizaWszola <ewszola@redhat.com> Signed-off-by: yewentao256 <zhyanwentao@126.com> Co-authored-by: yewentao256 <zhyanwentao@126.com>
csrc/dispatch_utils.h
cpp
Apache-2.0
/* * Adapted from * https://github.com/pytorch/pytorch/blob/v2.0.1/aten/src/ATen/Dispatch.h */ #pragma once #include <torch/all.h> // Need a special dispatch case macro since we will nest the FP8 dispatch. // Instead of the usual 'scalar_t', this names the dispatched type 'fp8_t'. #define AT_DISPATCH_FP8_CASE(enum...
/* * Adapted from * https://github.com/pytorch/pytorch/blob/v2.0.1/aten/src/ATen/Dispatch.h */ #pragma once #include <torch/all.h> // Need a special dispatch case macro since we will nest the FP8 dispatch. // Instead of the usual 'scalar_t', this names the dispatched type 'fp8_t'. #define AT_DISPATCH_FP8_CASE(enum...
--- csrc/dispatch_utils.h +++ csrc/dispatch_utils.h @@ -118,6 +118,24 @@ } \ } +#define VLLM_DISPATCH_BOOL(expr, const_expr, ...) \ + if (expr) { \ + constexpr bool const_expr = true; \ + __VA_ARGS__(); ...
18
0
7
[]
[]
[]
Optimize this cpp kernel file from vllm (csrc/dispatch_utils.h). Goal: [Performance] Fused blockwise quant RMS norm Target hardware: unspecified Target models: unspecified Current file: ```cpp /* * Adapted from * https://github.com/pytorch/pytorch/blob/v2.0.1/aten/src/ATen/Dispatch.h */ #pragma once #include <tor...
CUDA kernel and fusion code for Fused Groupwise FP8-Quantized RMS Norm. This code allows to fuse RMS Norm + FP8 Quantization of the RMS Norm's output when `enable_fusion==True`. ### Testing: #### Test fused op ```pytest tests/kernels/core/test_fused_quant_layernorm.py``` #### Test fusion ```pytest tests/compile/test...
[{"scope": "kernel", "hardware": "H100", "model": null, "shape": "N=1,D=1024,R=True,DT=torch.bfloat16,GS=[1,64]", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 36.2, "optimized": 24.7, "stated_speedup": null, "speedup": 1.4656}, {"scope": "kernel", "hardware": "H100", "model...
1.4685
1.0064
vllm
af0444bf40b7db2f3fb9fe1508d25ceba24cac87
2025-12-07T17:38:04+01:00
27,883
https://github.com/vllm-project/vllm/pull/27883
[Performance] Fused blockwise quant RMS norm (#27883)
[Performance] Fused blockwise quant RMS norm (#27883) Signed-off-by: ElizaWszola <ewszola@redhat.com> Signed-off-by: yewentao256 <zhyanwentao@126.com> Co-authored-by: yewentao256 <zhyanwentao@126.com>
csrc/ops.h
cpp
Apache-2.0
#pragma once #include <optional> #include <torch/library.h> #include "core/scalar_type.hpp" #include <vector> torch::Tensor weak_ref_tensor(torch::Tensor& tensor) { // Ensure tensor is on CUDA if (!tensor.is_cuda()) { throw std::runtime_error("Tensor must be on CUDA device"); } // Get the raw data poin...
#pragma once #include <optional> #include <torch/library.h> #include "core/scalar_type.hpp" #include <vector> torch::Tensor weak_ref_tensor(torch::Tensor& tensor) { // Ensure tensor is on CUDA if (!tensor.is_cuda()) { throw std::runtime_error("Tensor must be on CUDA device"); } // Get the raw data poin...
--- csrc/ops.h +++ csrc/ops.h @@ -128,6 +128,13 @@ std::optional<torch::Tensor> scale_ub, std::optional<torch::Tensor> residual); +void rms_norm_per_block_quant(torch::Tensor& out, torch::Tensor const& input, + ...
7
0
7
[]
[]
[]
Optimize this cpp kernel file from vllm (csrc/ops.h). Goal: [Performance] Fused blockwise quant RMS norm Target hardware: unspecified Target models: unspecified Current file: ```cpp #pragma once #include <optional> #include <torch/library.h> #include "core/scalar_type.hpp" #include <vector> torch::Tensor weak_ref...
CUDA kernel and fusion code for Fused Groupwise FP8-Quantized RMS Norm. This code allows to fuse RMS Norm + FP8 Quantization of the RMS Norm's output when `enable_fusion==True`. ### Testing: #### Test fused op ```pytest tests/kernels/core/test_fused_quant_layernorm.py``` #### Test fusion ```pytest tests/compile/test...
[{"scope": "kernel", "hardware": "H100", "model": null, "shape": "N=1,D=1024,R=True,DT=torch.bfloat16,GS=[1,64]", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 36.2, "optimized": 24.7, "stated_speedup": null, "speedup": 1.4656}, {"scope": "kernel", "hardware": "H100", "model...
1.4685
1.0064
vllm
af0444bf40b7db2f3fb9fe1508d25ceba24cac87
2025-12-07T17:38:04+01:00
27,883
https://github.com/vllm-project/vllm/pull/27883
[Performance] Fused blockwise quant RMS norm (#27883)
[Performance] Fused blockwise quant RMS norm (#27883) Signed-off-by: ElizaWszola <ewszola@redhat.com> Signed-off-by: yewentao256 <zhyanwentao@126.com> Co-authored-by: yewentao256 <zhyanwentao@126.com>
csrc/quantization/fused_kernels/fused_layernorm_dynamic_per_token_quant.cu
cuda
Apache-2.0
#include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include "../../dispatch_utils.h" #include "layernorm_utils.cuh" #include "quant_conversions.cuh" namespace vllm { template <typename scalar_t, typename scalar_out_t, bool has_residual = false> __device__ void rms_norm_dynamic_per_token_quant_vec( ...
#include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include "../../dispatch_utils.h" #include "layernorm_utils.cuh" #include "quant_conversions.cuh" namespace vllm { template <typename scalar_t, typename scalar_out_t, bool has_residual = false> __device__ void rms_norm_dynamic_per_token_quant_vec( ...
--- csrc/quantization/fused_kernels/fused_layernorm_dynamic_per_token_quant.cu +++ csrc/quantization/fused_kernels/fused_layernorm_dynamic_per_token_quant.cu @@ -31,14 +31,15 @@ // RMS Norm + Quant if constexpr (std::is_same_v<scalar_out_t, int8_t>) { + token_scale = 1.0f / token_scale; vllm::vectorized...
126
22
7
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/quantization/fused_kernels/fused_layernorm_dynamic_per_token_quant.cu). Goal: [Performance] Fused blockwise quant RMS norm Target hardware: unspecified Target models: unspecified Current file: ```cuda #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #...
CUDA kernel and fusion code for Fused Groupwise FP8-Quantized RMS Norm. This code allows to fuse RMS Norm + FP8 Quantization of the RMS Norm's output when `enable_fusion==True`. ### Testing: #### Test fused op ```pytest tests/kernels/core/test_fused_quant_layernorm.py``` #### Test fusion ```pytest tests/compile/test...
[{"scope": "kernel", "hardware": "H100", "model": null, "shape": "N=1,D=1024,R=True,DT=torch.bfloat16,GS=[1,64]", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 36.2, "optimized": 24.7, "stated_speedup": null, "speedup": 1.4656}, {"scope": "kernel", "hardware": "H100", "model...
1.4685
1.0064
vllm
af0444bf40b7db2f3fb9fe1508d25ceba24cac87
2025-12-07T17:38:04+01:00
27,883
https://github.com/vllm-project/vllm/pull/27883
[Performance] Fused blockwise quant RMS norm (#27883)
[Performance] Fused blockwise quant RMS norm (#27883) Signed-off-by: ElizaWszola <ewszola@redhat.com> Signed-off-by: yewentao256 <zhyanwentao@126.com> Co-authored-by: yewentao256 <zhyanwentao@126.com>
csrc/quantization/fused_kernels/layernorm_utils.cuh
cuda
Apache-2.0
#pragma once /** * __device__ layernorm utilities. */ #include "quantization/vectorization.cuh" #include "quantization/utils.cuh" #include "quant_conversions.cuh" #include "../../cub_helpers.h" namespace vllm { // has_residual must be true, if residual is not a nullptr template <typename scalar_t, bool has_resid...
#pragma once /** * __device__ layernorm utilities. */ #include "quantization/vectorization.cuh" #include "quantization/utils.cuh" #include "quant_conversions.cuh" #include "../../cub_helpers.h" #include "../../cuda_compat.h" namespace vllm { // has_residual must be true, if residual is not a nullptr template <ty...
--- csrc/quantization/fused_kernels/layernorm_utils.cuh +++ csrc/quantization/fused_kernels/layernorm_utils.cuh @@ -9,6 +9,7 @@ #include "quant_conversions.cuh" #include "../../cub_helpers.h" +#include "../../cuda_compat.h" namespace vllm { @@ -43,62 +44,150 @@ *rms = s_rms; } -template <typename scalar_...
325
111
7
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/quantization/fused_kernels/layernorm_utils.cuh). Goal: [Performance] Fused blockwise quant RMS norm Target hardware: unspecified Target models: unspecified Current file: ```cuda #pragma once /** * __device__ layernorm utilities. */ #include "quantization/vectorizatio...
CUDA kernel and fusion code for Fused Groupwise FP8-Quantized RMS Norm. This code allows to fuse RMS Norm + FP8 Quantization of the RMS Norm's output when `enable_fusion==True`. ### Testing: #### Test fused op ```pytest tests/kernels/core/test_fused_quant_layernorm.py``` #### Test fusion ```pytest tests/compile/test...
[{"scope": "kernel", "hardware": "H100", "model": null, "shape": "N=1,D=1024,R=True,DT=torch.bfloat16,GS=[1,64]", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 36.2, "optimized": 24.7, "stated_speedup": null, "speedup": 1.4656}, {"scope": "kernel", "hardware": "H100", "model...
1.4685
1.0064
vllm
af0444bf40b7db2f3fb9fe1508d25ceba24cac87
2025-12-07T17:38:04+01:00
27,883
https://github.com/vllm-project/vllm/pull/27883
[Performance] Fused blockwise quant RMS norm (#27883)
[Performance] Fused blockwise quant RMS norm (#27883) Signed-off-by: ElizaWszola <ewszola@redhat.com> Signed-off-by: yewentao256 <zhyanwentao@126.com> Co-authored-by: yewentao256 <zhyanwentao@126.com>
csrc/torch_bindings.cpp
cpp
Apache-2.0
#include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> #include <torch/version.h> // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only /...
#include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> #include <torch/version.h> // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only /...
--- csrc/torch_bindings.cpp +++ csrc/torch_bindings.cpp @@ -214,6 +214,14 @@ "Tensor? scale_ub, Tensor!? residual) -> ()"); ops.impl("rms_norm_dynamic_per_token_quant", torch::kCUDA, &rms_norm_dynamic_per_token_quant); + + // Fused Layernorm + Block quant kernels + ops.def( + "rms_norm_per_...
8
0
7
[]
[]
[]
Optimize this cpp kernel file from vllm (csrc/torch_bindings.cpp). Goal: [Performance] Fused blockwise quant RMS norm Target hardware: unspecified Target models: unspecified Current file: ```cpp #include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> #inc...
CUDA kernel and fusion code for Fused Groupwise FP8-Quantized RMS Norm. This code allows to fuse RMS Norm + FP8 Quantization of the RMS Norm's output when `enable_fusion==True`. ### Testing: #### Test fused op ```pytest tests/kernels/core/test_fused_quant_layernorm.py``` #### Test fusion ```pytest tests/compile/test...
[{"scope": "kernel", "hardware": "H100", "model": null, "shape": "N=1,D=1024,R=True,DT=torch.bfloat16,GS=[1,64]", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 36.2, "optimized": 24.7, "stated_speedup": null, "speedup": 1.4656}, {"scope": "kernel", "hardware": "H100", "model...
1.4685
1.0064
vllm
af0444bf40b7db2f3fb9fe1508d25ceba24cac87
2025-12-07T17:38:04+01:00
27,883
https://github.com/vllm-project/vllm/pull/27883
[Performance] Fused blockwise quant RMS norm (#27883)
[Performance] Fused blockwise quant RMS norm (#27883) Signed-off-by: ElizaWszola <ewszola@redhat.com> Signed-off-by: yewentao256 <zhyanwentao@126.com> Co-authored-by: yewentao256 <zhyanwentao@126.com>
vllm/model_executor/layers/quantization/utils/fp8_utils.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from https://github.com/sgl-project/sglang/pull/2575 import functools import json import os from collections.abc import Callable, Sequence from typing import Any import torch import vllm.envs as envs ...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from https://github.com/sgl-project/sglang/pull/2575 import functools import json import os from collections.abc import Callable, Sequence from typing import Any import torch import vllm.envs as envs ...
--- vllm/model_executor/layers/quantization/utils/fp8_utils.py +++ vllm/model_executor/layers/quantization/utils/fp8_utils.py @@ -733,7 +733,7 @@ assert out_q is None or out_q.shape == x.shape x_q = out_q if x_q is None: - x_q = torch.empty_like(x, device=x.device, dtype=dtype) + x_q = torc...
1
1
7
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/quantization/utils/fp8_utils.py). Goal: [Performance] Fused blockwise quant RMS norm Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contribu...
CUDA kernel and fusion code for Fused Groupwise FP8-Quantized RMS Norm. This code allows to fuse RMS Norm + FP8 Quantization of the RMS Norm's output when `enable_fusion==True`. ### Testing: #### Test fused op ```pytest tests/kernels/core/test_fused_quant_layernorm.py``` #### Test fusion ```pytest tests/compile/test...
[{"scope": "kernel", "hardware": "H100", "model": null, "shape": "N=1,D=1024,R=True,DT=torch.bfloat16,GS=[1,64]", "batch_size": 1, "metric": "latency", "unit": "us", "higher_is_better": false, "baseline": 36.2, "optimized": 24.7, "stated_speedup": null, "speedup": 1.4656}, {"scope": "kernel", "hardware": "H100", "model...
1.4685
1.0064
vllm
541a2ef892720489f770569417bc1bc4436dbb21
2025-12-07T07:31:14-05:00
29,546
https://github.com/vllm-project/vllm/pull/29546
[Perf] Deepgemm fused layout kernel for activations, 4.3% throughput improvement, 10.7% TTFT improvement. (#29546)
[Perf] Deepgemm fused layout kernel for activations, 4.3% throughput improvement, 10.7% TTFT improvement. (#29546) Signed-off-by: yewentao256 <zhyanwentao@126.com>
csrc/ops.h
cpp
Apache-2.0
#pragma once #include <optional> #include <torch/library.h> #include "core/scalar_type.hpp" #include <vector> torch::Tensor weak_ref_tensor(torch::Tensor& tensor) { // Ensure tensor is on CUDA if (!tensor.is_cuda()) { throw std::runtime_error("Tensor must be on CUDA device"); } // Get the raw data poin...
#pragma once #include <optional> #include <torch/library.h> #include "core/scalar_type.hpp" #include <vector> torch::Tensor weak_ref_tensor(torch::Tensor& tensor) { // Ensure tensor is on CUDA if (!tensor.is_cuda()) { throw std::runtime_error("Tensor must be on CUDA device"); } // Get the raw data poin...
--- csrc/ops.h +++ csrc/ops.h @@ -299,6 +299,14 @@ torch::Tensor& output_q, torch::Tensor& output_s, int64_t group_size, double eps, double int8_min, double int8_max); + +// Fused activation quantisation + DeepGEMM-compat...
8
0
5
[]
[]
[]
Optimize this cpp kernel file from vllm (csrc/ops.h). Goal: [Perf] Deepgemm fused layout kernel for activations, 4.3% throughput improvement, 10.7% TTFT improvement. Target hardware: unspecified Target models: unspecified Current file: ```cpp #pragma once #include <optional> #include <torch/library.h> #include "cor...
## Purpose Fused layout transform with per token group quant to get performance Namely, pack scales into a uint32 earlier and remove an additional kernel call ## Test `vllm serve deepseek-ai/DeepSeek-V3.1 -tp 8 --enable-expert-parallel --port 9256 --enforce_eager` ### Acc `lm_eval --model local-completions --mod...
[]
null
null
vllm
541a2ef892720489f770569417bc1bc4436dbb21
2025-12-07T07:31:14-05:00
29,546
https://github.com/vllm-project/vllm/pull/29546
[Perf] Deepgemm fused layout kernel for activations, 4.3% throughput improvement, 10.7% TTFT improvement. (#29546)
[Perf] Deepgemm fused layout kernel for activations, 4.3% throughput improvement, 10.7% TTFT improvement. (#29546) Signed-off-by: yewentao256 <zhyanwentao@126.com>
csrc/quantization/w8a8/fp8/per_token_group_quant.cu
cuda
Apache-2.0
#include <ATen/cuda/CUDAContext.h> #include "quantization/w8a8/per_token_group_quant_8bit.h" #include <cmath> #include <cuda_fp8.h> #include <torch/all.h> #include "quantization/vectorization.cuh" #include "quantization/vectorization_utils.cuh" #include "dispatch_utils.h" __device__ __forceinline__ float GroupRed...
#include <ATen/cuda/CUDAContext.h> #include "quantization/w8a8/per_token_group_quant_8bit.h" #include <cmath> #include <cuda_fp8.h> #include <torch/all.h> #include "quantization/vectorization.cuh" #include "quantization/vectorization_utils.cuh" #include "dispatch_utils.h" __device__ __forceinline__ float GroupRed...
--- csrc/quantization/w8a8/fp8/per_token_group_quant.cu +++ csrc/quantization/w8a8/fp8/per_token_group_quant.cu @@ -206,6 +206,191 @@ #undef LAUNCH_KERNEL } +template <typename T, typename DST_DTYPE> +__global__ void per_token_group_quant_8bit_packed_kernel( + const T* __restrict__ input, void* __restrict__ outp...
185
0
5
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/quantization/w8a8/fp8/per_token_group_quant.cu). Goal: [Perf] Deepgemm fused layout kernel for activations, 4.3% throughput improvement, 10.7% TTFT improvement. Target hardware: unspecified Target models: unspecified Current file: ```cuda #include <ATen/cuda/CUDAContext....
## Purpose Fused layout transform with per token group quant to get performance Namely, pack scales into a uint32 earlier and remove an additional kernel call ## Test `vllm serve deepseek-ai/DeepSeek-V3.1 -tp 8 --enable-expert-parallel --port 9256 --enforce_eager` ### Acc `lm_eval --model local-completions --mod...
[]
null
null
vllm
541a2ef892720489f770569417bc1bc4436dbb21
2025-12-07T07:31:14-05:00
29,546
https://github.com/vllm-project/vllm/pull/29546
[Perf] Deepgemm fused layout kernel for activations, 4.3% throughput improvement, 10.7% TTFT improvement. (#29546)
[Perf] Deepgemm fused layout kernel for activations, 4.3% throughput improvement, 10.7% TTFT improvement. (#29546) Signed-off-by: yewentao256 <zhyanwentao@126.com>
csrc/torch_bindings.cpp
cpp
Apache-2.0
#include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> #include <torch/version.h> // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only /...
#include "cache.h" #include "cuda_utils.h" #include "ops.h" #include "core/registration.h" #include <torch/library.h> #include <torch/version.h> // Note on op signatures: // The X_meta signatures are for the meta functions corresponding to op X. // They must be kept in sync with the signature for X. Generally, only /...
--- csrc/torch_bindings.cpp +++ csrc/torch_bindings.cpp @@ -617,6 +617,15 @@ ops.impl("per_token_group_fp8_quant", torch::kCUDA, &per_token_group_quant_fp8); + // Compute per-token-group 8-bit quantized tensor and UE8M0-packed, + // TMA-aligned scales for DeepGEMM. + ops.def( + "per_token_group...
9
0
5
[]
[]
[]
Optimize this cpp kernel file from vllm (csrc/torch_bindings.cpp). Goal: [Perf] Deepgemm fused layout kernel for activations, 4.3% throughput improvement, 10.7% TTFT improvement. Target hardware: unspecified Target models: unspecified Current file: ```cpp #include "cache.h" #include "cuda_utils.h" #include "ops.h" #i...
## Purpose Fused layout transform with per token group quant to get performance Namely, pack scales into a uint32 earlier and remove an additional kernel call ## Test `vllm serve deepseek-ai/DeepSeek-V3.1 -tp 8 --enable-expert-parallel --port 9256 --enforce_eager` ### Acc `lm_eval --model local-completions --mod...
[]
null
null
vllm
541a2ef892720489f770569417bc1bc4436dbb21
2025-12-07T07:31:14-05:00
29,546
https://github.com/vllm-project/vllm/pull/29546
[Perf] Deepgemm fused layout kernel for activations, 4.3% throughput improvement, 10.7% TTFT improvement. (#29546)
[Perf] Deepgemm fused layout kernel for activations, 4.3% throughput improvement, 10.7% TTFT improvement. (#29546) Signed-off-by: yewentao256 <zhyanwentao@126.com>
vllm/model_executor/layers/quantization/utils/fp8_utils.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from https://github.com/sgl-project/sglang/pull/2575 import functools import json import os from collections.abc import Callable, Sequence from typing import Any import torch import vllm.envs as envs ...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from https://github.com/sgl-project/sglang/pull/2575 import functools import json import os from collections.abc import Callable, Sequence from typing import Any import torch import vllm.envs as envs ...
--- vllm/model_executor/layers/quantization/utils/fp8_utils.py +++ vllm/model_executor/layers/quantization/utils/fp8_utils.py @@ -269,7 +269,11 @@ weight_scale: torch.Tensor, ) -> torch.Tensor: assert self.deepgemm_input_quant_op is not None - q_input, input_scale = self.deepgemm_input_qua...
79
1
5
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/quantization/utils/fp8_utils.py). Goal: [Perf] Deepgemm fused layout kernel for activations, 4.3% throughput improvement, 10.7% TTFT improvement. Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identi...
## Purpose Fused layout transform with per token group quant to get performance Namely, pack scales into a uint32 earlier and remove an additional kernel call ## Test `vllm serve deepseek-ai/DeepSeek-V3.1 -tp 8 --enable-expert-parallel --port 9256 --enforce_eager` ### Acc `lm_eval --model local-completions --mod...
[]
null
null
vllm
879ddb09c3b7b5a21f75e46ded148ce70f1c486e
2025-12-07T17:58:47+08:00
29,642
https://github.com/vllm-project/vllm/pull/29642
[Kernel][MoE] optimize `moe_align_block_size` (#29642)
[Kernel][MoE] optimize `moe_align_block_size` (#29642) Signed-off-by: Jinzhen Lin <jinzhen.ljz@antgroup.com> Co-authored-by: Jee Jee Li <pandaleefree@gmail.com>
csrc/moe/moe_align_sum_kernels.cu
cuda
Apache-2.0
#include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <cub/cub.cuh> #include <ATen/ATen.h> #include <ATen/cuda/Atomic.cuh> #include "../cuda_compat.h" #include "../dispatch_utils.h" #include "core/math.hpp" #define CEILDIV(x, y) (((x) + (y) - 1) / (y)) namespace vllm { n...
#include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <cub/cub.cuh> #include <ATen/ATen.h> #include <ATen/cuda/Atomic.cuh> #include "../cuda_compat.h" #include "../dispatch_utils.h" #include "core/math.hpp" #define CEILDIV(x, y) (((x) + (y) - 1) / (y)) namespace vllm { n...
--- csrc/moe/moe_align_sum_kernels.cu +++ csrc/moe/moe_align_sum_kernels.cu @@ -83,14 +83,22 @@ __global__ void moe_align_block_size_kernel( const scalar_t* __restrict__ topk_ids, int32_t* __restrict__ sorted_token_ids, int32_t* __restrict__ expert_ids, - int32_t* __restrict__ total_tokens_post_pad, int32...
117
57
6
[]
[]
[]
Optimize this cuda kernel file from vllm (csrc/moe/moe_align_sum_kernels.cu). Goal: [Kernel][MoE] optimize `moe_align_block_size` Target hardware: unspecified Target models: unspecified Current file: ```cuda #include <torch/all.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDAGuard.h> #include <cub/cub.cu...
## Introduction This PR optimize `moe_align_block_size` from three aspects: 1. For a small batch size, use the smallest possible value for `max_num_tokens_padded`. 2. In the CUDA Kernel, use additional thread or threadblock resources to fill `sorted_token_ids`. The previous CUDA Kernel used very few computational res...
[]
null
null
vllm
879ddb09c3b7b5a21f75e46ded148ce70f1c486e
2025-12-07T17:58:47+08:00
29,642
https://github.com/vllm-project/vllm/pull/29642
[Kernel][MoE] optimize `moe_align_block_size` (#29642)
[Kernel][MoE] optimize `moe_align_block_size` (#29642) Signed-off-by: Jinzhen Lin <jinzhen.ljz@antgroup.com> Co-authored-by: Jee Jee Li <pandaleefree@gmail.com>
csrc/moe/moe_ops.h
cpp
Apache-2.0
#pragma once #include <torch/all.h> void topk_softmax(torch::Tensor& topk_weights, torch::Tensor& topk_indices, torch::Tensor& token_expert_indices, torch::Tensor& gating_output, bool renormalize); void moe_sum(torch::Tensor& input, torch::Tensor& output); void moe_align_block_si...
#pragma once #include <torch/all.h> void topk_softmax(torch::Tensor& topk_weights, torch::Tensor& topk_indices, torch::Tensor& token_expert_indices, torch::Tensor& gating_output, bool renormalize); void moe_sum(torch::Tensor& input, torch::Tensor& output); void moe_align_block_si...
--- csrc/moe/moe_ops.h +++ csrc/moe/moe_ops.h @@ -11,7 +11,8 @@ void moe_align_block_size(torch::Tensor topk_ids, int64_t num_experts, int64_t block_size, torch::Tensor sorted_token_ids, torch::Tensor experts_ids, - torch::Tensor num_tokens...
2
1
6
[]
[]
[]
Optimize this cpp kernel file from vllm (csrc/moe/moe_ops.h). Goal: [Kernel][MoE] optimize `moe_align_block_size` Target hardware: unspecified Target models: unspecified Current file: ```cpp #pragma once #include <torch/all.h> void topk_softmax(torch::Tensor& topk_weights, torch::Tensor& topk_indices, ...
## Introduction This PR optimize `moe_align_block_size` from three aspects: 1. For a small batch size, use the smallest possible value for `max_num_tokens_padded`. 2. In the CUDA Kernel, use additional thread or threadblock resources to fill `sorted_token_ids`. The previous CUDA Kernel used very few computational res...
[]
null
null
vllm
879ddb09c3b7b5a21f75e46ded148ce70f1c486e
2025-12-07T17:58:47+08:00
29,642
https://github.com/vllm-project/vllm/pull/29642
[Kernel][MoE] optimize `moe_align_block_size` (#29642)
[Kernel][MoE] optimize `moe_align_block_size` (#29642) Signed-off-by: Jinzhen Lin <jinzhen.ljz@antgroup.com> Co-authored-by: Jee Jee Li <pandaleefree@gmail.com>
csrc/moe/torch_bindings.cpp
cpp
Apache-2.0
#include "core/registration.h" #include "moe_ops.h" TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, m) { // Apply topk softmax to the gating outputs. m.def( "topk_softmax(Tensor! topk_weights, Tensor! topk_indices, Tensor! " "token_expert_indices, Tensor gating_output, bool renormalize) -> ()"); m.impl("t...
#include "core/registration.h" #include "moe_ops.h" TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, m) { // Apply topk softmax to the gating outputs. m.def( "topk_softmax(Tensor! topk_weights, Tensor! topk_indices, Tensor! " "token_expert_indices, Tensor gating_output, bool renormalize) -> ()"); m.impl("t...
--- csrc/moe/torch_bindings.cpp +++ csrc/moe/torch_bindings.cpp @@ -19,7 +19,8 @@ "moe_align_block_size(Tensor topk_ids, int num_experts," " int block_size, Tensor! sorted_token_ids," " Tensor! experts_ids," - " Tensor! num_tokens_pos...
2
1
6
[]
[]
[]
Optimize this cpp kernel file from vllm (csrc/moe/torch_bindings.cpp). Goal: [Kernel][MoE] optimize `moe_align_block_size` Target hardware: unspecified Target models: unspecified Current file: ```cpp #include "core/registration.h" #include "moe_ops.h" TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, m) { // Apply topk s...
## Introduction This PR optimize `moe_align_block_size` from three aspects: 1. For a small batch size, use the smallest possible value for `max_num_tokens_padded`. 2. In the CUDA Kernel, use additional thread or threadblock resources to fill `sorted_token_ids`. The previous CUDA Kernel used very few computational res...
[]
null
null
vllm
879ddb09c3b7b5a21f75e46ded148ce70f1c486e
2025-12-07T17:58:47+08:00
29,642
https://github.com/vllm-project/vllm/pull/29642
[Kernel][MoE] optimize `moe_align_block_size` (#29642)
[Kernel][MoE] optimize `moe_align_block_size` (#29642) Signed-off-by: Jinzhen Lin <jinzhen.ljz@antgroup.com> Co-authored-by: Jee Jee Li <pandaleefree@gmail.com>
vllm/model_executor/layers/fused_moe/fused_moe.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Fused MoE Triton kernels.""" import functools import json import os from collections.abc import Callable from typing import Any import torch import torch.nn.functional as F import vllm.envs as envs import vl...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Fused MoE Triton kernels.""" import functools import json import os from collections.abc import Callable from typing import Any import torch import torch.nn.functional as F import vllm.envs as envs import vl...
--- vllm/model_executor/layers/fused_moe/fused_moe.py +++ vllm/model_executor/layers/fused_moe/fused_moe.py @@ -1887,7 +1887,11 @@ ) sorted_token_ids, expert_ids, num_tokens_post_padded = moe_align_block_size( - curr_topk_ids, config["BLOCK_SIZE_M"], global_num_experts, expert_map + ...
8
1
6
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/fused_moe/fused_moe.py). Goal: [Kernel][MoE] optimize `moe_align_block_size` Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to ...
## Introduction This PR optimize `moe_align_block_size` from three aspects: 1. For a small batch size, use the smallest possible value for `max_num_tokens_padded`. 2. In the CUDA Kernel, use additional thread or threadblock resources to fill `sorted_token_ids`. The previous CUDA Kernel used very few computational res...
[]
null
null
vllm
9843e332da56307597deb2739bb83b85c18c5dde
2025-12-05T08:09:20-05:00
30,068
https://github.com/vllm-project/vllm/pull/30068
[CPU][Perf] Add fast vectorized exp impl from Arm Optimized Routines (#30068)
[CPU][Perf] Add fast vectorized exp impl from Arm Optimized Routines (#30068) Signed-off-by: Ubuntu <ubuntu@ip-10-252-30-150.eu-west-1.compute.internal> Signed-off-by: Elham Harirpoush <elham.harirpoush@arm.com> Co-authored-by: Ubuntu <ubuntu@ip-10-252-30-150.eu-west-1.compute.internal>
csrc/cpu/cpu_attn_impl.hpp
cpp
Apache-2.0
#ifndef CPU_ATTN_HPP #define CPU_ATTN_HPP #include <type_traits> #include <cstddef> #if defined(__APPLE__) #include <sys/sysctl.h> #endif #include "cpu_types.hpp" #include "scratchpad_manager.h" #include "cpu_attn_macros.h" #include "utils.hpp" namespace cpu_attention { enum class ISA { AMX, VEC, VEC16, NEON }; ...
#ifndef CPU_ATTN_HPP #define CPU_ATTN_HPP #include <type_traits> #include <cstddef> #if defined(__APPLE__) #include <sys/sysctl.h> #endif #include "cpu_types.hpp" #include "scratchpad_manager.h" #include "cpu_attn_macros.h" #include "utils.hpp" namespace cpu_attention { enum class ISA { AMX, VEC, VEC16, NEON }; ...
--- csrc/cpu/cpu_attn_impl.hpp +++ csrc/cpu/cpu_attn_impl.hpp @@ -1246,14 +1246,8 @@ // rescale sum and partial outputs if (need_rescale) { // compute rescale factor -#ifdef DEFINE_FAST_EXP - vec_op::FP32Vec16 rescale_factor_vec(rescale_factor); - rescale_factor_vec = fast...
0
13
2
[]
[ "CPU" ]
[]
Optimize this cpp kernel file from vllm (csrc/cpu/cpu_attn_impl.hpp). Goal: [CPU][Perf] Add fast vectorized exp impl from Arm Optimized Routines Target hardware: CPU Target models: unspecified Current file: ```cpp #ifndef CPU_ATTN_HPP #define CPU_ATTN_HPP #include <type_traits> #include <cstddef> #if defined(__APPL...
<!-- markdownlint-disable --> ## Purpose This accelerates paged attention by 20% on Arm Neoverse-V2 for batch size = 64, query tokens = kv tokens = 512, q heads = 32, kv heads = 8, head size = 128, block size = 128 ## Test Plan @fadara01 will test in CI ## Test Result --- <details> <summary> Essential Elements of...
[{"scope": "kernel", "hardware": "Arm Neoverse-V2", "model": null, "shape": "q_heads=32,kv_heads=8,head_size=128,block_size=128", "batch_size": 64, "metric": "latency", "unit": null, "higher_is_better": false, "baseline": null, "optimized": null, "stated_speedup": 1.2, "speedup": 1.2}]
1.2
null
vllm
9843e332da56307597deb2739bb83b85c18c5dde
2025-12-05T08:09:20-05:00
30,068
https://github.com/vllm-project/vllm/pull/30068
[CPU][Perf] Add fast vectorized exp impl from Arm Optimized Routines (#30068)
[CPU][Perf] Add fast vectorized exp impl from Arm Optimized Routines (#30068) Signed-off-by: Ubuntu <ubuntu@ip-10-252-30-150.eu-west-1.compute.internal> Signed-off-by: Elham Harirpoush <elham.harirpoush@arm.com> Co-authored-by: Ubuntu <ubuntu@ip-10-252-30-150.eu-west-1.compute.internal>
csrc/cpu/cpu_attn_macros.h
cpp
Apache-2.0
#ifndef CPU_ATTN_MACROS_H #define CPU_ATTN_MACROS_H // x86_64 #ifdef __x86_64__ #define FAST_SPINNING _mm_pause(); #ifdef __AVX512F__ #define DEFINE_FAST_EXP \ const __m512 vec_factorial_1 = _mm512_set1_ps(0.999999701f); \ const __m512...
#ifndef CPU_ATTN_MACROS_H #define CPU_ATTN_MACROS_H // x86_64 #ifdef __x86_64__ #define FAST_SPINNING _mm_pause(); #ifdef __AVX512F__ #define DEFINE_FAST_EXP \ const __m512 vec_factorial_1 = _mm512_set1_ps(0.999999701f); \ const __m512...
--- csrc/cpu/cpu_attn_macros.h +++ csrc/cpu/cpu_attn_macros.h @@ -60,4 +60,54 @@ #endif +#ifdef __aarch64__ + // Implementation copied from Arm Optimized Routines (expf AdvSIMD) + // https://github.com/ARM-software/optimized-routines/blob/master/math/aarch64/advsimd/expf.c + #include <limits> + #define DEFINE_...
50
0
2
[]
[ "CPU" ]
[]
Optimize this cpp kernel file from vllm (csrc/cpu/cpu_attn_macros.h). Goal: [CPU][Perf] Add fast vectorized exp impl from Arm Optimized Routines Target hardware: CPU Target models: unspecified Current file: ```cpp #ifndef CPU_ATTN_MACROS_H #define CPU_ATTN_MACROS_H // x86_64 #ifdef __x86_64__ #define FAST_SPINNING...
<!-- markdownlint-disable --> ## Purpose This accelerates paged attention by 20% on Arm Neoverse-V2 for batch size = 64, query tokens = kv tokens = 512, q heads = 32, kv heads = 8, head size = 128, block size = 128 ## Test Plan @fadara01 will test in CI ## Test Result --- <details> <summary> Essential Elements of...
[{"scope": "kernel", "hardware": "Arm Neoverse-V2", "model": null, "shape": "q_heads=32,kv_heads=8,head_size=128,block_size=128", "batch_size": 64, "metric": "latency", "unit": null, "higher_is_better": false, "baseline": null, "optimized": null, "stated_speedup": 1.2, "speedup": 1.2}]
1.2
null
vllm
19bee6d12d985c231b16374c99836376fc0c5706
2025-12-03T13:04:59-05:00
29,470
https://github.com/vllm-project/vllm/pull/29470
[Performance][DP/EP] Add silu_mul_per_token_group_quant_fp8_colmajor kernel (#29470)
[Performance][DP/EP] Add silu_mul_per_token_group_quant_fp8_colmajor kernel (#29470) Signed-off-by: Varun Sundar Rabindranath <vsundarr@redhat.com> Co-authored-by: Varun Sundar Rabindranath <vsundarr@redhat.com> Co-authored-by: Tyler Michael Smith <tyler@neuralmagic.com>
vllm/model_executor/layers/quantization/utils/fp8_utils.py
triton
Apache-2.0
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from https://github.com/sgl-project/sglang/pull/2575 import functools import json import os from collections.abc import Callable, Sequence from typing import Any import torch import vllm.envs as envs ...
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from https://github.com/sgl-project/sglang/pull/2575 import functools import json import os from collections.abc import Callable, Sequence from typing import Any import torch import vllm.envs as envs ...
--- vllm/model_executor/layers/quantization/utils/fp8_utils.py +++ vllm/model_executor/layers/quantization/utils/fp8_utils.py @@ -490,6 +490,139 @@ tl.store(y_q_ptr + cols, y_q, mask=mask) tl.store(y_s_ptr, y_s) + + +@triton.jit +def _silu_mul_per_token_group_quant_fp8_colmajor( + y_ptr, # [M, N] + y...
133
0
2
[]
[]
[]
Optimize this triton kernel file from vllm (vllm/model_executor/layers/quantization/utils/fp8_utils.py). Goal: [Performance][DP/EP] Add silu_mul_per_token_group_quant_fp8_colmajor kernel Target hardware: unspecified Target models: unspecified Current file: ```python # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCo...
## Purpose With DeepEPHighThroughput all2all backend and EP, the "act_mul + fp8 quant" operation in deep_gemm_moe.py is expensive and almost as expensive as the FP8 gemms surrounding the operation. This PR, 1. Adds a fused silu_mul_quant kernels to fuse the operations together. 2. Another minor optimization is to rearr...
[]
null
null