Skip to content

Reduce qwen tp process count to 2#177

Merged
yubofredwang merged 9 commits intosgl-project:devops/cifrom
yubofredwang:devops/ci
Aug 25, 2025
Merged

Reduce qwen tp process count to 2#177
yubofredwang merged 9 commits intosgl-project:devops/cifrom
yubofredwang:devops/ci

Conversation

@yubofredwang
Copy link
Collaborator

Motivation

Modifications

Related Issues

Accuracy Test

Benchmark & Profiling

Checklist

@yubofredwang yubofredwang merged commit 205a54e into sgl-project:devops/ci Aug 25, 2025
1 check passed
Copy link
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.

Summary of Changes

Hello @yubofredwang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request reduces the number of processes used for the Qwen3 MoE tensor parallelism test from 4 to 2. The primary motivation for this change is to align the test configuration with the available GPU resources in the Continuous Integration (CI) environment, ensuring the test can execute successfully where only 2 GPUs are present.

Highlights

  • Test Configuration Adjustment: The test_qwen3_moe_tp function call in tests/test_target_modeling/test_qwen3_tp.py has been updated to use nprocs=2 and args=(2, ...) instead of nprocs=4 and args=(4, ...). This change is made to accommodate environments with limited GPU resources, specifically the CI environment which has only 2 GPUs.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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 aims to reduce the tensor parallelism process count to 2 for the qwen3_moe test, likely to accommodate CI environments with fewer GPUs. However, the current change introduces a test failure due to a hardcoded tensor parallelism size in the test function. A critical issue has been identified that needs to be addressed for the test to pass with the new configuration.

def test_qwen3_moe_tp(self):
mp.spawn(test_qwen3_moe_tp, nprocs=4, args=(4, self.temp_dir.name))
# Set to 2 as only 2 GPU avaialble in CI
mp.spawn(test_qwen3_moe_tp, nprocs=2, args=(2, self.temp_dir.name))
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

While reducing nprocs to 2 is the goal, this change will cause the test to fail. The test_qwen3_moe_tp function called here has a hardcoded tp_size=4 on line 21. With nprocs=2, the world_size becomes 2, which is passed to the test function. This leads to an assertion failure in init_distributed because the world_size (2) is not divisible by tp_size (4).

To fix this, the test_qwen3_moe_tp function should be updated to use the world_size parameter for tp_size, for example: init_distributed(tp_size=world_size).

FrankLeeeee added a commit that referenced this pull request Aug 26, 2025
* added CI

* poslih

* poslih

* poslih

* poslih

* poslih

* fixed some broken tests

* fix broken test case and fix llama4.py

* precommit llama4.py

* add init to make test discoverable (#173)

* Devops/ci (#174)

* add init to make test discoverable

* lower atol rtol and fix random

* Devops/ci used normed tensor for testing, worked locally (#175)

* add init to make test discoverable

* lower atol rtol and fix random

* pass locally... why fail on ci

* done

* remove requires grad

* Reduce qwen tp process count to 2 (#177)

* add init to make test discoverable

* lower atol rtol and fix random

* pass locally... why fail on ci

* done

* remove requires grad

* fix qwen3 tp test

* remove dup

* Should pass CI without a problem (#178)

* add init to make test discoverable

* lower atol rtol and fix random

* pass locally... why fail on ci

* done

* remove requires grad

* fix qwen3 tp test

* remove dup

* fix tp size

* recursively search for tests

---------

Co-authored-by: ZhengHSI <zhenghsi@qq.com>
Co-authored-by: Yubo Wang <yubowang2019@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant