Skip to content

[Feature]: Remove Chunking From FusedMoE#34086

Merged
ProExpertProg merged 16 commits intovllm-project:mainfrom
SouthWest7:feat/remove-chunk
Mar 12, 2026
Merged

[Feature]: Remove Chunking From FusedMoE#34086
ProExpertProg merged 16 commits intovllm-project:mainfrom
SouthWest7:feat/remove-chunk

Conversation

@SouthWest7
Copy link
Copy Markdown
Contributor

@SouthWest7 SouthWest7 commented Feb 8, 2026

Purpose

Remove the kernel-level chunking mechanism from FusedMoE.

Resolves #30620

Test Plan

pytest tests/kernels/moe/test_moe.py

Test Result

============================================== test session starts ===============================================
platform linux -- Python 3.12.4, pytest-9.0.2, pluggy-1.6.0
rootdir: /home/mxn/llm/vllm
configfile: pyproject.toml
plugins: anyio-4.12.1, asyncio-1.3.0
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 3551 items                                                                                             

tests/kernels/moe/test_moe.py ............................................................................ [  2%]
.......................................................................................................... [  5%]
.......................................................................................................... [  8%]
.......................................................................................................... [ 11%]
.......................................................................................................... [ 14%]
.......................................................................................................... [ 17%]
.......................................................................................................... [ 20%]
.......................................................................................................... [ 23%]
.......................................................................................................... [ 26%]
.......................................................................................................... [ 29%]
.......................................................................................................... [ 31%]
.......................................................................................................... [ 34%]
.......................................................................................................... [ 37%]
.......................................................................................................... [ 40%]
.......................................................................................................... [ 43%]
.......................................................................................................... [ 46%]
.......................................................................................................... [ 49%]
.......................................................................................................... [ 52%]
.......................................................................................................... [ 55%]
.......................................................................................................... [ 58%]
.......................................................................................................... [ 61%]
.......................................................................................................... [ 64%]
.......................................................................................................... [ 67%]
.......................................................................................................... [ 70%]
.......................................................................................................... [ 73%]
.......................................................................................................... [ 76%]
.......................................................................................................... [ 79%]
.......................................................................................................... [ 82%]
.......................................................................................................... [ 85%]
.......................................................................................................... [ 88%]
.......................................................................................................... [ 91%]
.......................................................................................................... [ 94%]
.......................................................................................................... [ 97%]
...ssssssss..s..........ss..s..s.................s.................................                              [100%]

Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@mergify
Copy link
Copy Markdown

mergify bot commented Feb 8, 2026

Documentation preview: https://vllm--34086.org.readthedocs.build/en/34086/

@mergify mergify bot added documentation Improvements or additions to documentation gpt-oss Related to GPT-OSS models nvidia rocm Related to AMD ROCm labels Feb 8, 2026
@github-project-automation github-project-automation bot moved this to Todo in AMD Feb 8, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the kernel-level chunking mechanism from FusedMoE, which simplifies the codebase significantly. The changes are mostly about removing code related to chunking and relying on the scheduler's chunked prefill to handle large inputs. A safety check has been added to the non-modular path to prevent illegal memory access with Triton kernels when the number of tokens is too large. However, my review identified that a similar safety check is missing in the modular kernel path for Triton-based experts, which could lead to memory corruption issues. I've added a critical comment to address this.

@ZJY0516
Copy link
Copy Markdown
Member

ZJY0516 commented Feb 10, 2026

Chunked prefill now guarantees that the scheduler never sends more tokens than ~65K in a single forward pass

Do we have any assertion for this?

@mergify
Copy link
Copy Markdown

mergify bot commented Feb 10, 2026

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @SouthWest7.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Feb 10, 2026
SouthWest7 added 2 commits February 12, 2026 00:52
Signed-off-by: SouthWest7 <am1ao@qq.com>
Signed-off-by: SouthWest7 <am1ao@qq.com>
@SouthWest7
Copy link
Copy Markdown
Contributor Author

Chunked prefill now guarantees that the scheduler never sends more tokens than ~65K in a single forward pass

Do we have any assertion for this?

Sorry, there is actually no related assertion — I misunderstood the original issue. I’ll be more careful in future changes.

# Conflicts:
#	tests/kernels/moe/test_flashinfer.py
#	vllm/model_executor/layers/fused_moe/fused_moe.py
#	vllm/model_executor/layers/fused_moe/modular_kernel.py
@mergify
Copy link
Copy Markdown

mergify bot commented Mar 3, 2026

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @SouthWest7.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Mar 3, 2026
Signed-off-by: SouthWest7 <am1ao@qq.com>

# Conflicts:
#	docs/design/fused_moe_modular_kernel.md
#	tests/kernels/moe/test_modular_kernel_combinations.py
#	vllm/model_executor/layers/fused_moe/modular_kernel.py
Copy link
Copy Markdown
Collaborator

@ProExpertProg ProExpertProg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm but let's wait for @robertgshaw2-redhat & bill's response for the 1 recent comment before merging

@github-project-automation github-project-automation bot moved this from To Triage to Ready in gpt-oss Issues & Enhancements Mar 8, 2026
@github-project-automation github-project-automation bot moved this to Ready in NVIDIA Mar 8, 2026
@SouthWest7
Copy link
Copy Markdown
Contributor Author

@ProExpertProg I marked the previous comment as resolved because reviewer said it was only related to chunking.

@ProExpertProg ProExpertProg enabled auto-merge (squash) March 11, 2026 17:08
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Mar 11, 2026
@ProExpertProg
Copy link
Copy Markdown
Collaborator

Thank you for the contribution! Let's hope CI passes

auto-merge was automatically disabled March 12, 2026 02:39

Head branch was pushed to by a user without write access

Signed-off-by: SouthWest7 <am1ao@qq.com>
@ProExpertProg ProExpertProg merged commit 2cdf922 into vllm-project:main Mar 12, 2026
61 of 62 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in AMD Mar 12, 2026
@github-project-automation github-project-automation bot moved this from Ready to Done in NVIDIA Mar 12, 2026
@SouthWest7 SouthWest7 deleted the feat/remove-chunk branch March 12, 2026 23:20
tlrmchlsmth added a commit to tlrmchlsmth/vllm that referenced this pull request Mar 15, 2026
Remove supports_chunking from test helpers to match main branch changes
from vllm-project#34086, and replace torch.cuda.device_count() with
torch.accelerator.device_count() per project policy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Tyler Michael Smith <tlrmchlsmth@gmail.com>
Lucaskabela pushed a commit to Lucaskabela/vllm that referenced this pull request Mar 17, 2026
Signed-off-by: SouthWest7 <am1ao@qq.com>
Signed-off-by: Southwest <1403572259@qq.com>
Signed-off-by: southwest <am1ao@qq.com>
Signed-off-by: Xinan Miao <1403572259@qq.com>
Co-authored-by: SouthWest7 <am1ao@qq.com>
wendyliu235 pushed a commit to wendyliu235/vllm-public that referenced this pull request Mar 18, 2026
Signed-off-by: SouthWest7 <am1ao@qq.com>
Signed-off-by: Southwest <1403572259@qq.com>
Signed-off-by: southwest <am1ao@qq.com>
Signed-off-by: Xinan Miao <1403572259@qq.com>
Co-authored-by: SouthWest7 <am1ao@qq.com>
fxdawnn pushed a commit to fxdawnn/vllm that referenced this pull request Mar 19, 2026
Signed-off-by: SouthWest7 <am1ao@qq.com>
Signed-off-by: Southwest <1403572259@qq.com>
Signed-off-by: southwest <am1ao@qq.com>
Signed-off-by: Xinan Miao <1403572259@qq.com>
Co-authored-by: SouthWest7 <am1ao@qq.com>
khairulkabir1661 pushed a commit to khairulkabir1661/vllm that referenced this pull request Mar 27, 2026
Signed-off-by: SouthWest7 <am1ao@qq.com>
Signed-off-by: Southwest <1403572259@qq.com>
Signed-off-by: southwest <am1ao@qq.com>
Signed-off-by: Xinan Miao <1403572259@qq.com>
Co-authored-by: SouthWest7 <am1ao@qq.com>
Monishver11 pushed a commit to Monishver11/vllm that referenced this pull request Mar 27, 2026
Signed-off-by: SouthWest7 <am1ao@qq.com>
Signed-off-by: Southwest <1403572259@qq.com>
Signed-off-by: southwest <am1ao@qq.com>
Signed-off-by: Xinan Miao <1403572259@qq.com>
Co-authored-by: SouthWest7 <am1ao@qq.com>
Signed-off-by: Monishver Chandrasekaran <monishverchandrasekaran@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation gpt-oss Related to GPT-OSS models nvidia ready ONLY add when PR is ready to merge/full CI is needed rocm Related to AMD ROCm

Projects

Status: Done
Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

[Feature]: Remove Chunking From FusedMoE

5 participants