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

[AutoParallel] Add auto parallel moe layer #9886

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

pkuzyc
Copy link
Contributor

@pkuzyc pkuzyc commented Feb 17, 2025

PR types

New features

PR changes

Models

Description

Add auto parallel moe layer

Copy link

paddle-bot bot commented Feb 17, 2025

Thanks for your contribution!

Copy link

codecov bot commented Feb 17, 2025

Codecov Report

Attention: Patch coverage is 14.25960% with 469 lines in your changes missing coverage. Please review.

Project coverage is 51.17%. Comparing base (347d77c) to head (8bfa877).
Report is 6 commits behind head on develop.

Files with missing lines Patch % Lines
paddlenlp/transformers/moe_gate_auto.py 10.47% 282 Missing ⚠️
paddlenlp/transformers/moe_layer_auto.py 18.36% 120 Missing ⚠️
...addlenlp/transformers/deepseek_v2/modeling_auto.py 26.41% 39 Missing ⚠️
paddlenlp/transformers/auto_utils.py 12.50% 28 Missing ⚠️

❌ Your patch check has failed because the patch coverage (14.25%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project check has failed because the head coverage (51.17%) is below the target coverage (58.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9886      +/-   ##
===========================================
- Coverage    51.34%   51.17%   -0.18%     
===========================================
  Files          745      748       +3     
  Lines       118567   119129     +562     
===========================================
+ Hits         60877    60961      +84     
- Misses       57690    58168     +478     

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

me = paddle.stack(me_list).mean(0)
ce = paddle.stack(ce_list).mean(0)
aux_loss = paddle.sum(me * ce) * float(self.num_experts)
return aux_loss
Copy link
Collaborator

Choose a reason for hiding this comment

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

# Make sure the capacity value does not exceed the number of tokens.
capacity = int(min(new_capacity, paddle.tensor(mask1.size(0))))

l_aux = self._cal_aux_loss(gates, mask1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

2 participants