Skip to content

Commit ac83ef3

Browse files
authored
[GSoC] Blockwise Quantization Tool (#265)
* Blockwise quantization tool * add missing type hints * add min python version check * refactoring
1 parent 912904c commit ac83ef3

File tree

3 files changed

+431
-1
lines changed

3 files changed

+431
-1
lines changed

tools/quantize/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Install dependencies before trying quantization:
77
pip install -r requirements.txt
88
```
99

10-
## Usage
10+
## Quantization Usage
1111

1212
Quantize all models in the Zoo:
1313
```shell
@@ -52,6 +52,16 @@ models = dict(
5252
python quantize-inc.py model1
5353
```
5454

55+
## Blockwise quantization usage
56+
57+
`block_quantize.py` requires Python>=3.7
58+
59+
To perform weight-only blockwise quantization:
60+
61+
```shell
62+
python block_quantize.py --input_model INPUT_MODEL.onnx --output_model OUTPUT_MODEL.onnx --block_size {block size} --bits {8,16}
63+
```
64+
5565
## Dataset
5666
Some models are quantized with extra datasets.
5767
- [MP-PalmDet](../../models/palm_detection_mediapipe) and [MP-HandPose](../../models/handpose_estimation_mediapipe) are quantized with evaluation set of [FreiHAND](https://lmb.informatik.uni-freiburg.de/resources/datasets/FreihandDataset.en.html). Download the dataset from [this link](https://lmb.informatik.uni-freiburg.de/data/freihand/FreiHAND_pub_v2_eval.zip). Unpack it and replace `path/to/dataset` with the path to `FreiHAND_pub_v2_eval/evaluation/rgb`.

0 commit comments

Comments
 (0)