-
Notifications
You must be signed in to change notification settings - Fork 209
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-source-id: 3c1199d84d316ae49d664b6a20ebed404734806e Pull Request resolved: #81
- Loading branch information
Showing
7 changed files
with
531 additions
and
20 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,28 @@ | ||
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, | ||
) | ||
from . import dtypes | ||
from .quantization.quant_api import apply_dynamic_quant | ||
from .quantization.quant_api import apply_weight_only_int8_quant | ||
|
||
__all__ = [ | ||
"dtypes", | ||
"apply_dynamic_quant", | ||
"dtypes", | ||
"apply_dynamic_quant", | ||
"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", | ||
"dtypes" | ||
] |
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
Oops, something went wrong.