Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MoE] fix expert parallel #9760

Merged
merged 3 commits into from
Jan 16, 2025
Merged

[MoE] fix expert parallel #9760

merged 3 commits into from
Jan 16, 2025

Conversation

DesmonDay
Copy link
Contributor

@DesmonDay DesmonDay commented Jan 9, 2025

PR types

Bug fixes

PR changes

Description

Fix MoE model using expert parallel.

Copy link

paddle-bot bot commented Jan 9, 2025

Thanks for your contribution!

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 52.38%. Comparing base (fb60645) to head (4d4c79e).
Report is 17 commits behind head on develop.

Files with missing lines Patch % Lines
paddlenlp/transformers/moe_layer.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9760      +/-   ##
===========================================
- Coverage    52.70%   52.38%   -0.33%     
===========================================
  Files          731      727       -4     
  Lines       117313   115146    -2167     
===========================================
- Hits         61827    60316    -1511     
+ Misses       55486    54830     -656     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -152,6 +152,9 @@ def main():
quantization_config=quantization_config,
)

if "Qwen2Moe" in str(model_config.architectures) and training_args.data_parallel_degree > 1:
training_args.use_expert_parallel = True
Copy link
Collaborator

Choose a reason for hiding this comment

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

不太好吧,万一用户的dp跟 expert_parallel degree对不上怎么办?

Copy link
Contributor Author

@DesmonDay DesmonDay Jan 10, 2025

Choose a reason for hiding this comment

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

moe layer写法就默认了是这个逻辑,expert_parallel_degree=dp_degree。觉得不好的话我把原来的逻辑改掉?

Copy link
Collaborator

Choose a reason for hiding this comment

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

我感觉只能默认和data_parallel_degree进行对齐,做all-to-all时是应该在数据并行组内进行

Copy link
Collaborator

@ZHUI ZHUI left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@ZHUI ZHUI left a comment

Choose a reason for hiding this comment

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

LGTM

@ZHUI ZHUI merged commit 13053a7 into PaddlePaddle:develop Jan 16, 2025
9 of 12 checks passed
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.

3 participants