-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Rope in float32 for mps or npu compatibility #12665
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
Conversation
| def rope(self, pos: torch.Tensor, dim: int, theta: int) -> torch.Tensor: | ||
| assert dim % 2 == 0 | ||
| scale = torch.arange(0, dim, 2, dtype=torch.float64, device=pos.device) / dim | ||
| scale = torch.arange(0, dim, 2, dtype=torch.float32, device=pos.device) / dim |
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.
Does it not affect any quality?
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.
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.
Hmm, just to be a bit more future-proof, WDYT the change from https://github.com/huggingface/diffusers/pull/11316/files?
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.
Sure, I changed for what was suggested.
613f87c to
d15c317
Compare
d15c317 to
c3c8e06
Compare
sayakpaul
left a comment
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.
Thanks!
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
Failing tests are unrelated. Thanks for the quick fix! |






What does this PR do?
Fixes #12653
(changing for Rope dtype for float32 does not degrade quality)
Who can review?
@sayakpaul