-
Notifications
You must be signed in to change notification settings - Fork 482
improve MoE bias update logic in optimizer #1593
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! I left some comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, had some more comments.
cb4e41a
to
cb8c9b8
Compare
for moe ep usage and/or bias . Here we need to do smth like
and once we finalize RP#1578 for Moe model we can have
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Had some final comments.
f340bcb
to
9c35bc1
Compare
Removed the comment (for ep-usage) and added the early exit in the first loop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you! Please fix linting so we can merge.
We put all experts usage into a buffer such that we only need one reduce rather than #number-of-layers times Additionally handle cases where tokens per expert are counted twice during full recompute. (assume all moe layers have same number of experts)
9c35bc1
to
9a623b8
Compare
format fixed, thanks a lot for the discussion. It's important to know that this PR only improves the code on COMM parts -> reduced to only once. |
We put all experts' usage into a buffer such that we only need one reduce rather than #number-of-layers times
Additionally, handle cases where tokens per expert are counted twice during full recompute.