Skip to content

Modularize zero step function#7265

Open
karakusc wants to merge 5 commits into
pytorch:masterfrom
karakusc:step_refactor
Open

Modularize zero step function#7265
karakusc wants to merge 5 commits into
pytorch:masterfrom
karakusc:step_refactor

Conversation

@karakusc
Copy link
Copy Markdown
Contributor

(Re-opening earlier PR after fixes)

Refactor and (slightly) generalize step function of the zero redundancy optimizer, by breaking it into the following three high-level steps:

_reduce_gradients
_clip_grad_norm
_update_parameters
This makes it easier to sub-class and override specific behaviors of the zero optimizer in different contexts.
In addition, we introduce an additional optional parameter sharding_scheme, which allows us to customize steps 1 and 3 above, if needed.

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.

1 participant