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

Zero2: avoid graph breaks in torch.compile by using param_idx #6803

Merged
merged 12 commits into from
Dec 20, 2024

Conversation

nelyahu
Copy link
Contributor

@nelyahu nelyahu commented Nov 28, 2024

inside reduce_independent_p_g_buckets_and_remove_grads and in reduce_ipg_grads which are being executed during the BWD hook in zero2, the model param is being stored inside params_in_ipg_bucket. torch.compile has hard time tracing parameters.
By using the param's static index inside the group the same logic can be maintain with less complexity.

inside reduce_independent_p_g_buckets_and_remove_grads and in
reduce_ipg_grads which are being executed during the BWD hook
in zero2, the model param is being stored inside params_in_ipg_bucket.
torch.compile has hard time tracing parameters.
By using the param's static index inside the group
the same logic can be maintain with less complexity.
nelyahu and others added 2 commits December 11, 2024 11:56
assign param according to the param idx

Co-authored-by: Olatunji Ruwase <olruwase@microsoft.com>
@loadams loadams merged commit 00ea0c4 into microsoft:master Dec 20, 2024
12 of 13 checks passed
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.

3 participants