-
-
Notifications
You must be signed in to change notification settings - Fork 656
Fix MPS #3444
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
Fix MPS #3444
Conversation
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.
Pull Request Overview
This PR fixes an issue with MPS (Metal Performance Shaders) compatibility by adding detach() calls before moving tensors to CPU in the FID score calculation.
Key Changes
- Added
.detach()calls before.cpu()for mu1, mu2, sigma1, and sigma2 tensors to prevent gradient tracking issues when moving from GPU to CPU
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@goanpeca please post here the error you see without this PR to understand better why we need now to call detach |
|
@vfdev-5 it was a suggestion from copilot on the first PR to add the detach method before the CPU.
Is this something that could apply to mu1, mu2, sigma1, sigma2? |
5190667 to
55f3789
Compare
|
@vfdev-5 the error was something on so that is why we had to add a .numpy() call. For the detach see previous message, it was a suggestion from copilot, but if it does not apply, I can revert it! |
55f3789 to
1d7f83d
Compare
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 Gonzalo!
Fix MPS by detaching before moving to cpu and moving to numpy array