-
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-source-id: 94089f74edf54f8e2122e91498b25306d322f3ab Pull Request resolved: #38
- Loading branch information
Showing
8 changed files
with
514 additions
and
14 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
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,5 +1,26 @@ | ||
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 | ||
|
||
__all__ = [ | ||
"dtypes" | ||
"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.