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

Fixed optim update error with non-contiguous grads/params #1187

Merged

Conversation

Edenzzzz
Copy link
Contributor

@Edenzzzz Edenzzzz commented Apr 23, 2024

Fixes #1185
Non-contiguous params/gradients resulting from torch.chunk and all_gather etc. are ubiquitous in distributed training frameworks such as ZeRO. This avoids update errors as the C++ kernels assume row-major inputs.

image cc @Titus-von-Koeller

@matthewdouglas
Copy link
Member

@Edenzzzz Thanks for the PR! This looks good to me!
cc: @Titus-von-Koeller

@Titus-von-Koeller
Copy link
Collaborator

Just ran the optimizer test suite as well, everything passing.

Thanks @Edenzzzz and @matthewdouglas for tracking this down and providing a fix 🙌🏻 🚀, this was really helpful!

@Titus-von-Koeller Titus-von-Koeller merged commit a3f55ce into bitsandbytes-foundation:main Jul 22, 2024
22 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.

32 bit optimizer update error despite gradients being the same
3 participants