Skip to content

[MoE Refactor] Add sequence parallel tests to test_moe_layer.py#41299

Merged
robertgshaw2-redhat merged 22 commits into
vllm-project:mainfrom
neuralmagic:sp-tests
May 13, 2026
Merged

[MoE Refactor] Add sequence parallel tests to test_moe_layer.py#41299
robertgshaw2-redhat merged 22 commits into
vllm-project:mainfrom
neuralmagic:sp-tests

Conversation

@bnellnm
Copy link
Copy Markdown
Collaborator

@bnellnm bnellnm commented Apr 29, 2026

Purpose

Add sequence parallel tests to test_moe_layer.py. Unfortunately, they require 4 gpus so I'm not sure we can run them in automation. At least they can be run locally when validating changes to MoE.

cc @yzong-rh

Test Plan

Ran by hand with 4 gpus.

Test Result


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.

bnellnm added 8 commits April 29, 2026 18:26
Signed-off-by: Bill Nell <bnell@redhat.com>
Signed-off-by: Bill Nell <bnell@redhat.com>
Signed-off-by: Bill Nell <bnell@redhat.com>
Signed-off-by: Bill Nell <bnell@redhat.com>
Signed-off-by: Bill Nell <bnell@redhat.com>
Signed-off-by: Bill Nell <bnell@redhat.com>
Signed-off-by: Bill Nell <bnell@redhat.com>
Signed-off-by: Bill Nell <bnell@redhat.com>
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

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 introduces support for sequence parallelism (SP) in MoE layer tests. Key changes include the addition of an sp_wrapper to handle sequence chunking and gathering, updates to test configurations and validation logic to support SP, and adjustments to weight chunking behavior when SP is enabled. Review feedback highlights a potential issue in the calculation of num_tokens_across_dp for sequence parallel configurations, which could lead to incorrect communication or out-of-bounds access. Additionally, there is a concern regarding the significant increase in FP8 quantization tolerance, which may reduce the effectiveness of correctness checks.

Comment thread tests/kernels/moe/test_moe_layer.py
Comment thread tests/kernels/moe/test_moe_layer.py Outdated
bnellnm and others added 2 commits April 30, 2026 00:06
Signed-off-by: Bill Nell <bnell@redhat.com>
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 30, 2026

Hi @bnellnm, the pre-commit checks have failed. Please run:

uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy failing?
mypy is run differently in CI. If the failure is related to this check, please use the following command to run it locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10

Copy link
Copy Markdown
Contributor

@yzong-rh yzong-rh left a comment

Choose a reason for hiding this comment

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

Also passed for me on 4xB200 on 0.20.2rc1.dev56+gf65376125.precompiled after merging with commit f6537612521df1156d8ac13f524e427aca908322 on main.

atol, rtol = 3.5e-2, 3.5e-2
elif quantization in ("fp8", "fp8_blocked", "modelopt_fp8"):
atol, rtol = 6e-2, 6e-2
atol, rtol = 6.5e-2, 6.5e-2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note: tolerance changed.

Comment thread tests/kernels/moe/test_moe_layer.py
Comment thread tests/kernels/moe/test_moe_layer.py
Comment thread tests/kernels/moe/test_moe_layer.py Outdated
@bnellnm bnellnm requested a review from pavanimajety as a code owner May 8, 2026 23:15
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 8, 2026

Hi @bnellnm, the pre-commit checks have failed. Please run:

uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy failing?
mypy is run differently in CI. If the failure is related to this check, please use the following command to run it locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10

Signed-off-by: Bill Nell <bnell@redhat.com>
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 8, 2026

Hi @bnellnm, the pre-commit checks have failed. Please run:

uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy failing?
mypy is run differently in CI. If the failure is related to this check, please use the following command to run it locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10

Signed-off-by: Bill Nell <bnell@redhat.com>
Comment thread vllm/distributed/device_communicators/all2all.py
@robertgshaw2-redhat robertgshaw2-redhat added the ready ONLY add when PR is ready to merge/full CI is needed label May 12, 2026
@robertgshaw2-redhat robertgshaw2-redhat enabled auto-merge (squash) May 12, 2026 17:41
@bnellnm bnellnm requested a review from zyongye as a code owner May 12, 2026 21:50
Signed-off-by: Bill Nell <bnell@redhat.com>
auto-merge was automatically disabled May 12, 2026 23:20

Head branch was pushed to by a user without write access

@robertgshaw2-redhat robertgshaw2-redhat merged commit 18f6bf5 into vllm-project:main May 13, 2026
2 of 5 checks passed
@github-project-automation github-project-automation Bot moved this to Done in NVIDIA May 13, 2026
mfylcek pushed a commit to mfylcek/vllm that referenced this pull request May 19, 2026
rishitdholakia13 pushed a commit to rishitdholakia13/vllm that referenced this pull request May 19, 2026
jhu960213 pushed a commit to jhu960213/vllm that referenced this pull request May 20, 2026
h1t35h pushed a commit to h1t35h/vllm that referenced this pull request May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nvidia ready ONLY add when PR is ready to merge/full CI is needed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants