-
Notifications
You must be signed in to change notification settings - Fork 6
Add Naive Training Moe Example Code on Single GPU or Multi GPUs #10
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
base: main
Are you sure you want to change the base?
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.
Is this example running with 4 GPUs?
Then the title Single-GPU Training is not correct.
@@ -0,0 +1,17 @@ | |||
__version__ = "1.0.0" |
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.
There are dualpipe codes, no need to be included.
In the README.md, explain how to clone the dualpipe codes, setup PYTHONPATH.
|
||
def apply_load_balancing_loss(self, router_probs, tokens_per_expert): | ||
if self.moe_aux_loss_coeff > 0 and self.training: | ||
# 计算每个专家的负载 |
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.
Use English for comments.
self.moe_z_loss_coeff = z_loss_coeff | ||
self.initializer_range = 0.02 | ||
|
||
class MoEAuxLossAutoScaler(torch.autograd.Function): |
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.
If these MOE model definition codes are copied/modified from other repo's codes, add comments stating the original code source.
Added a new training example function demonstrating how to train the MoE model on a single GPU or multi GPUS using dummy data. #9