-
Notifications
You must be signed in to change notification settings - Fork 57
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
dpu #178
base: main
Are you sure you want to change the base?
dpu #178
Conversation
:Args: | ||
model: The model to be trained | ||
elastic_device_mesh: The elastic device mesh to be used | ||
dpu: Whether to use delayed parameter updates | ||
|
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.
Args have changed
Example usage: | ||
|
||
``` | ||
global_ddp = GlobalDDP(model, elastic_device_mesh) |
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.
Example changed
for micro_bs in range(num_micro_bs): | ||
optimizer.zero_grad() | ||
loss = model(batch) | ||
loss.backward() | ||
|
||
global_ddp.all_reduce() | ||
optimizer.step() | ||
diloco.step(model) |
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.
The optimizer zero grad is in the wrong place? This would make only the last micro batch have grad
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.
lol good catch
|
||
self.model = model | ||
|
||
self._staling_grad_work: list[AllReduceGradWork] | None = None |
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.
staling -> stalling
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.
staline gradient ?
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.
stalingrad
No description provided.