Skip to content

Commit dedf185

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

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.github/workflows/nightly.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ jobs:
3131
- name: Publish nightly
3232
run: |
3333
twine upload --repository pypi dist/* --verbose -u __token__ -p ${{ secrets.PYPI_API_SSI_DEV_NIGHTLY_KEY }}
34+
- name: Edit requirements mct-quantizers name # Remove the entire line in requirements.txt so no need special care for the specified version
35+
run: |
36+
sed -i "/mct-quantizers/c\mct-quantizers-nightly" requirements.txt
3437
- name: Post publish import test
3538
run: |
3639
pip install mct-nightly tensorflow torch
3740
version=$(python -c 'import model_compression_toolkit; print(model_compression_toolkit.__version__)')
38-
echo $version
41+
echo $version

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)