-
Notifications
You must be signed in to change notification settings - Fork 305
[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
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 5394d1e with merge base 262b180 ( 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
torchao/quantization/autoquant.py
Outdated
@@ -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?
torchao/quantization/utils.py
Outdated
@@ -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
@jainapurva has imported this pull request. If you are a Meta employee, you can view this in D78827625. |
@jainapurva has imported this pull request. If you are a Meta employee, you can view this in D78827625. |
@jainapurva has imported this pull request. If you are a Meta employee, you can view this in D78827625. |
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
AUTOQUANT_CACHE
->_AUTOQUANT_CACHE
torchao/quantization/utils.py
guard_dtype_size
->_guard_dtype_size
quant_int8_per_token_matmul
->_quant_int8_per_token_matmul
quantize_activation_per_token_absmax
->_quantize_activation_per_token_absmax
quant_int8_dynamic_per_token_linear
->_quant_int8_dynamic_per_token_linear