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

Fix a bug when parameters tied belong to the same module #1514

Merged
merged 3 commits into from
Jun 2, 2023

Conversation

sgugger
Copy link
Collaborator

@sgugger sgugger commented Jun 2, 2023

This fixes a edge case in infer_auto_device_map when two sets of parameters are tied and belong to the same module (see #1510 for a reproducer).

Fixes #1510

@sgugger sgugger requested a review from muellerzr June 2, 2023 18:23
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 2, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@muellerzr muellerzr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Any chance for a test too? :)

@@ -790,6 +794,7 @@ def infer_auto_device_map(
)
current_memory_used += module_size
device_map[name] = devices[current_device]
print(modules_to_treat)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arg!

@sgugger sgugger merged commit eba6eb7 into main Jun 2, 2023
@sgugger sgugger deleted the fix_infer_auto branch June 2, 2023 21:07
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.

[bug] infer_auto_device_map
3 participants