-
Notifications
You must be signed in to change notification settings - Fork 971
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
[Big model loading] Correct GPU only loading #1121
Conversation
The documentation is not available anymore as the PR was closed or merged. |
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 for fixing the bug! I left a couple of comments.
tests/test_modeling_utils.py
Outdated
for k, v in device_map.items(): | ||
v = v if v != "disk" else "cpu" | ||
self.assertEqual(loaded_state_dict[k].device, torch.device(v)) |
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.
Let's use proper names here instead of k, v (like param, device).
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Merging as Sylvain has ✔️ -ed |
There was a bug when loading safetensors directly on GPU via
device_map="auto"
indiffusers
.The test shows the failure case.