optimize the compressor 128 split cutedsl kernel - #44230
Merged
Merged
Conversation
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: Jie Fang <jief@nvidia.com>
Jie-Fang
force-pushed
the
c128_split_kernel_opt
branch
from
June 2, 2026 05:05
9e5124d to
738fedd
Compare
Contributor
|
Hi @Jie-Fang, the pre-commit checks have failed. Please run: uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, Tip Is
|
zyongye
approved these changes
Jun 4, 2026
mvanhorn
pushed a commit
to mvanhorn/vllm
that referenced
this pull request
Jun 4, 2026
Signed-off-by: Jie Fang <jief@nvidia.com> Co-authored-by: Yongye Zhu <zyy1102000@gmail.com> Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
JisoLya
pushed a commit
to JisoLya/vllm
that referenced
this pull request
Jun 5, 2026
Signed-off-by: Jie Fang <jief@nvidia.com> Co-authored-by: Yongye Zhu <zyy1102000@gmail.com> Signed-off-by: JisoLya <523420504@qq.com>
knight0528
pushed a commit
to knight0528/vllm
that referenced
this pull request
Jun 8, 2026
Signed-off-by: Jie Fang <jief@nvidia.com> Co-authored-by: Yongye Zhu <zyy1102000@gmail.com>
waqahmed-amd-fi
pushed a commit
to waqahmed-amd-fi/vllm
that referenced
this pull request
Jun 10, 2026
Signed-off-by: Jie Fang <jief@nvidia.com> Co-authored-by: Yongye Zhu <zyy1102000@gmail.com> Signed-off-by: Waqar Ahmed <waqar.ahmed@amd.com>
Saddss
pushed a commit
to Saddss/vllm
that referenced
this pull request
Jun 14, 2026
Signed-off-by: Jie Fang <jief@nvidia.com> Co-authored-by: Yongye Zhu <zyy1102000@gmail.com>
divineearthly
pushed a commit
to divineearthly/vllm
that referenced
this pull request
Jun 19, 2026
Signed-off-by: Jie Fang <jief@nvidia.com> Co-authored-by: Yongye Zhu <zyy1102000@gmail.com> Signed-off-by: divineearthly <divineearthly@gmail.com>
nkzhenhua
pushed a commit
to nkzhenhua/vllm
that referenced
this pull request
Jun 24, 2026
Signed-off-by: Jie Fang <jief@nvidia.com> Co-authored-by: Yongye Zhu <zyy1102000@gmail.com>
1 task
ohsono
pushed a commit
to ohsono/vllm
that referenced
this pull request
Jul 3, 2026
Signed-off-by: Jie Fang <jief@nvidia.com> Co-authored-by: Yongye Zhu <zyy1102000@gmail.com>
philippesic
pushed a commit
to philippesic/vllm-semantic-cache
that referenced
this pull request
Jul 19, 2026
Signed-off-by: Jie Fang <jief@nvidia.com> Co-authored-by: Yongye Zhu <zyy1102000@gmail.com>
plasticchris
pushed a commit
to plasticchris/vllm
that referenced
this pull request
Jul 20, 2026
Signed-off-by: Jie Fang <jief@nvidia.com> Co-authored-by: Yongye Zhu <zyy1102000@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This PR optimizes the compressor 128 split cutedsl kernel which utilizes the
block_size=8of state_cache for dpsk v4.Summary
This PR optimizes the DeepSeek V4 C128 CuTeDSL sparse-attention compressor path.
The optimized path is intentionally scoped to the real vLLM C128 layout:
head_size = 512state_width = 512compress_ratio = 128overlap = False8For C4, this PR keeps using the existing fused CuTeDSL kernel path, since that is the path used in real vLLM inference and is faster than the split version for C4.
Changes
SparseAttnCompressC128Block8Kernel, specialized for the real DeepSeek V4 C128 state-cache layout.SparseAttnCompressNormRopeStoreC4Kernelpath.kv_cache_block_size == k_cache.shape[1].Why This Is Faster
The new C128 split compressor takes advantage of the real vLLM C128 layout where one C128 compression window maps to 16 state-cache rows with block size 8.
Compared with the generic split kernel, it avoids per-row dynamic block lookup and dynamic offset calculation. Each warp directly loads two consecutive state blocks from
block_table, processes 16 rows, and reduces across 8 warps for each 64-wide head tile. This reduces indexing overhead and improves memory access/reduction efficiency for the C128 decode-boundary path.Validation
Tested on NVIDIA B300.
Baseline for performance comparison: latest
upstream/mainatf91fb2fcf.Passed:
pre-commit run --files vllm/models/deepseek_v4/nvidia/ops/sparse_attn_compress_cutedsl.pypython -m pytest tests/kernels/test_compressor_kv_cache.py -qtests/kernels/test_compressor_kv_cache.py: 32 passedAdditional correctness coverage:
Representative correctness results:
3.35e-081.49e-07Performance
Measured on B300 with
warmup=50,iters=1000,bench_inputs=4.Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.