-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Adding autoquantization functionality, using hte do_quant api we can test kernel speeds and pick the best quantization type (or no quantization) for each layer. Test Plan: python test/test.py -k "autoquant" also tested on SAM and SDXL pytorch-labs/segment-anything-fast#114 HDCharles/sdxl-fast@8d9942a Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
- Loading branch information
Showing
7 changed files
with
120 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from torchao.quantization import ( | ||
apply_weight_only_int8_quant, | ||
apply_dynamic_quant, | ||
change_linear_weights_to_int8_dqtensors, | ||
change_linear_weights_to_int8_woqtensors, | ||
change_linear_weights_to_int4_woqtensors, | ||
swap_conv2d_1x1_to_linear, | ||
autoquant, | ||
change_linears_to_autoquantizable, | ||
change_autoquantizable_to_quantized, | ||
) | ||
|
||
__all__ = [ | ||
"apply_weight_only_int8_quant", | ||
"apply_dynamic_quant", | ||
"change_linear_weights_to_int8_dqtensors", | ||
"change_linear_weights_to_int8_woqtensors", | ||
"change_linear_weights_to_int4_woqtensors", | ||
"swap_conv2d_1x1_to_linear" | ||
"safe_int_mm", | ||
"autoquant", | ||
"change_linears_to_autoquantizable", | ||
"change_autoquantizable_to_quantized", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters