-
Notifications
You must be signed in to change notification settings - Fork 292
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
Enable autoquant for CPU userbenchmark #2547
base: main
Are you sure you want to change the base?
Conversation
change_linear_weights_to_int8_dqtensors, | ||
change_linear_weights_to_int8_woqtensors, | ||
) | ||
if model.device == "cuda": |
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.
Let's keep original behavior in here, suggest to change as
if model.device == "cpu":
xxx
else:
original path
if args.quantization == "auto_quant": | ||
module, example_inputs = model.get_module() | ||
with torch.no_grad(): | ||
module=torchao.autoquant(torch.compile(module, mode='max-autotune')) |
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.
why we need compile the module before autoquant? and why we need to hard code the compile mode as max-autotune
? Can we follow similar style with original part?
elif args.quantization == "int4weightonly": | ||
change_linear_weights_to_int4_woqtensors(module) | ||
elif model.device == "cpu" and model.test == "eval": | ||
if args.quantization == "auto_quant": |
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 else statement to warining that the other quant modes are still not support for cpu device
No description provided.