-
Notifications
You must be signed in to change notification settings - Fork 303
[BE] Convert quantization internal methods private #2568
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2568
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 9b6df39 with merge base 460aaed ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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, seems like there may be more functions in these two files that can be privatized
@@ -66,11 +66,11 @@ | |||
AUTOQUANT_CACHE = {} |
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.
can you also make this one private?
@@ -33,10 +32,8 @@ | |||
|
|||
__all__ = [ | |||
"compute_error", | |||
"_apply_logging_hook", | |||
"quantize_activation_per_token_absmax", | |||
"quant_int8_dynamic_per_token_linear", |
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.
which other functions in this list can also be privatized? Looks like these 2 at least aren't used outside of torchao (and I don't think we intend them to be). Seems like there are a few more
As a part of clean code, we're converting internal implementations private and removing old deprecated APIs.
torchao/quantization/autoquant.py
check_cache
->_check_cache
update_cache
->_update_cache
torchao/quantization/utils.py
guard_dtype_size
->_guard_dtype_size
quant_int8_per_token_matmul
->_quant_int8_per_token_matmul