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

Fix, pipeline model with moe cause error when send grad #7055

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wukong1992
Copy link
Contributor

@wukong1992 wukong1992 commented Feb 19, 2025

Fix, pipeline model with moe, send and recv grad use same buffer will cause error when moe loss not in position 1. Solution, activation and grad use diff buffer. BUG DETAIL: in forward, the grad_buf will allocate hidden_states,some
tensors(required_grad is false), moe_loss;in backward,only send act grad(floating point),so only hidden_states and moe loss's grads will be send, and forward and backward use same grad_buf. This will cause send and recv grad use diff dtype, and cause numerical error。

… cause error when moe loss not in position 1
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