-
Notifications
You must be signed in to change notification settings - Fork 52
[WIP] porting sq to autoround #761
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
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
for more information, see https://pre-commit.ci
sq = SmoothQuant(model, dataloader, device=model.device, group_size=-1) | ||
model = sq.transform_model( | ||
alpha=0.5, | ||
# alpha="auto", |
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.
when using auto alpha, layer_config and all the quantization config like data type must know
|
||
import torch | ||
|
||
from auto_round.data_type.utils import reshape_pad_tensor_by_group_size |
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.
move to auto-round/alg_ext?
|
||
return save_input_hook | ||
|
||
@torch.no_grad() |
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.
prioritize to use torch.inference_mode first, if there are any issues, fallback to no_grad
No description provided.