-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Add CPU offloading to UnCLIP #1761
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
| ) | ||
|
|
||
| pipeline = UnCLIPPipeline.from_pretrained("kakaobrain/karlo-v1-alpha") | ||
| pipeline = UnCLIPPipeline.from_pretrained("kakaobrain/karlo-v1-alpha", torch_dtype=torch.float16) |
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.
No more OOMs on main for this test :)
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.
Very nice :-) Thanks a lot!
|
The documentation is not available anymore as the PR was closed or merged. |
| assert image.shape == (256, 256, 3) | ||
| assert np.abs(expected_image - image).max() < 1e-2 | ||
|
|
||
| def test_stable_diffusion_pipeline_with_sequential_cpu_offloading(self): |
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.
very cool!
|
|
||
| device = torch.device(f"cuda:{gpu_id}") | ||
|
|
||
| # TODO: self.prior.post_process_latents is not covered by the offload hooks, so it fails if added to the list |
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.
I had this problem with the safety checker as well I think. Totally fine as is!
patrickvonplaten
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.
Super cool :-)
pcuenca
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.
Awesome!
* Add CPU offloading to UnCLIP * use fp32 for testing the offload
* Add CPU offloading to UnCLIP * use fp32 for testing the offload
No description provided.