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

Calling infer_auto_device_map() with max_memory=None throws an error in version 1.2.0 #3276

Closed
chmeyers opened this issue Dec 6, 2024 · 2 comments · Fixed by #3279
Closed

Comments

@chmeyers
Copy link

chmeyers commented Dec 6, 2024

System Info

accelerate==1.2.0

Reproduction

Bug is from this commit:
d7b1b36

max_memory initialization was moved into _init_infer_auto_device_map, which does not return the max_memory value.

So if max_memory=None is passed to infer_auto_device_map (the default value), then it will still be None at line 1415:

current_max_size = max_memory[device] if device != "disk" else None

Leading to error: TypeError: 'NoneType' object is not subscriptable

Expected behavior

max_memory=None when passed to infer_auto_device_map does not throw an error.

@chmeyers
Copy link
Author

chmeyers commented Dec 6, 2024

@Nech-C

@Nech-C
Copy link
Contributor

Nech-C commented Dec 7, 2024

Sorry for the oversight. I will fix it ASAP. Thanks for pointing it out!

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 a pull request may close this issue.

2 participants