Reduce qwen tp process count to 2#177
Conversation
There was a problem hiding this comment.
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_tpfunction call intests/test_target_modeling/test_qwen3_tp.pyhas been updated to usenprocs=2andargs=(2, ...)instead ofnprocs=4andargs=(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
-
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. ↩
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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).
* 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>
Motivation
Modifications
Related Issues
Accuracy Test
Benchmark & Profiling
Checklist