-
Notifications
You must be signed in to change notification settings - Fork 28.8k
Define warmup allocator for torchao quantization #37764
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
base: main
Are you sure you want to change the base?
Conversation
Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the |
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 !
""" | ||
The factor to be used in `caching_allocator_warmup` to get the number of bytes to pre-allocate to warm up cuda. | ||
A factor of 2 means we allocate all bytes in the empty model (since we allocate in fp16), a factor of 4 means | ||
we allocate half the memory of the weights residing in the empty model, etc... | ||
""" |
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.
maybe explain a bit why we need to change for torchao
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.
Done
quant_type = self.quantization_config.quant_type | ||
if isinstance(quant_type, AOBaseConfig): |
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.
add a small comment for autoquant
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.
Done
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
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.
Thx
What does this PR do?
Since when computing the total number of bytes of a torchao quantized model using :
param_byte_count = param.numel() * param.element_size()
theparam.element_size()
is not correct, we need to account for that and have a factor of 4 forint8
models and a factor of8
forint4
models