Skip to content

Commit 5d21afd

Browse files
author
eladco
committed
add reuse flag to weights quantizers, change workflow to mctq nightly
1 parent 7bd8f49 commit 5d21afd

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.github/workflows/nightly.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,7 @@ jobs:
3636
pip install mct-nightly tensorflow torch
3737
version=$(python -c 'import model_compression_toolkit; print(model_compression_toolkit.__version__)')
3838
echo $version
39+
# Install mct-quantizers-nightly
40+
pip list
41+
[ "$(pip list | grep mct-quantizers-nightly | wc -l)" = "1" ] || (echo "not one line" && exit 1)
42+

model_compression_toolkit/exporter/model_wrapper/pytorch/builder/fully_quantized_model_builder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def fully_quantized_wrapper(node: common.BaseNode,
4545
"""
4646
weight_quantizers, _ = fw_impl.get_inferable_quantizers(node)
4747
if len(weight_quantizers) > 0:
48+
# Set reuse for weight quantizers if node is reused
49+
for _, quantizer in weight_quantizers.items():
50+
if node.reuse_group:
51+
quantizer.enable_reuse_quantizer()
4852
# for positional weights we need to extract the weight's value.
4953
weights_values = {attr: fw_impl.to_tensor(node.get_weights_by_keys(attr))
5054
for attr in weight_quantizers if isinstance(attr, int)}

0 commit comments

Comments
 (0)