Skip to content

Conversation

xhx1022
Copy link

@xhx1022 xhx1022 commented Aug 3, 2025

Added a new training example function demonstrating how to train the MoE model on a single GPU or multi GPUS using dummy data. #9

Copy link
Collaborator

@skydoorkai skydoorkai left a 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"
Copy link
Collaborator

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:
# 计算每个专家的负载
Copy link
Collaborator

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):
Copy link
Collaborator

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.

@xhx1022 xhx1022 changed the title Add Single-GPU Training Moe Example Code Add Naive Training Moe Example Code on Single GPU or Multi GPUs Aug 17, 2025
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