-
Notifications
You must be signed in to change notification settings - Fork 345
Add parq utility to create an optimizer #3165
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/3165
Note: Links to docs will display an error until the docs builds have been completed. ❗ 2 Active SEVsThere are 2 currently active SEVs. If your PR is affected, please view them below:
✅ No FailuresAs of commit 9b1df40 with merge base c96f2dd ( 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.
Looks great! I just had a few nits that might not be important
# Non-quantized group at end so that index in param_groups | ||
# is the index in the subset of quantized param groups, which is | ||
# used in defining group_quantizer_map |
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.
Standardizing the indices this way is a great idea
torchao/prototype/parq/api.py
Outdated
|
||
def create_optimizer( | ||
model, | ||
quant_configs_and_filter_fns, |
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.
Should we add a type hint here?
|
||
# If no match, add to no-quant group at last idx | ||
if matching_config is None: | ||
print("NONE") |
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.
Is this for debugging?
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.
After each parameter, it prints out config (bitwidth,groupsize or NONE)
Adds utility to create an optimizer like this:
The filter functions are (module, fqn) -> bool, e.g.,