Skip to content

Commit f2355b0

Browse files
authored
Fix AutoRound scale dtype UT (#1688)
Signed-off-by: Kaihui-intel <kaihui.tang@intel.com>
1 parent 04e933f commit f2355b0

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

.azure-pipelines/scripts/ut/env_setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ elif [[ $(echo "${test_case}" | grep -c "tf pruning") != 0 ]]; then
9292
fi
9393

9494
if [[ $(echo "${test_case}" | grep -c "api") != 0 ]] || [[ $(echo "${test_case}" | grep -c "adaptor") != 0 ]]; then
95-
pip install git+https://github.com/intel/auto-round.git@d02f94d4b085523df3b313863fb07f83b2989cce
95+
pip install auto-round
9696
fi
9797

9898
# test deps

neural_compressor/adaptor/pytorch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4937,6 +4937,7 @@ def autoround_quantize(self, model, tune_cfg, dataloader):
49374937
dynamic_max_gap = self.recipes["autoround_args"].get("dynamic_max_gap", -1)
49384938
data_type = self.recipes["autoround_args"].get("data_type", "int") ##only support data_type
49394939
scale_dtype = self.recipes["autoround_args"].get("scale_dtype", "fp16")
4940+
amp = self.recipes["autoround_args"].get("amp", True)
49404941

49414942
model, autoround_config = autoround_quantize(
49424943
model=model,
@@ -4947,6 +4948,7 @@ def autoround_quantize(self, model, tune_cfg, dataloader):
49474948
weight_config=weight_config,
49484949
enable_full_range=enable_full_range,
49494950
batch_size=batch_size,
4951+
amp=amp,
49504952
lr_scheduler=lr_scheduler,
49514953
dataloader=dataloader,
49524954
dataset_name=dataset_name,

test/adaptor/pytorch_adaptor/test_weight_only_adaptor_pytorch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,6 @@ def test_AutoRound_quant(self):
756756
tokenizer, seqlen=10, seed=42, train_bs=8, dataset_split="train", dataset_name="NeelNanda/pile-10k"
757757
)
758758
fp32_model = copy.deepcopy(self.gptj)
759-
760759
conf = PostTrainingQuantConfig(
761760
approach="weight_only",
762761
op_type_dict={
@@ -781,6 +780,7 @@ def test_AutoRound_quant(self):
781780
"seq_len": 10,
782781
"iters": 10,
783782
"scale_dtype": "fp32",
783+
"amp": False,
784784
},
785785
},
786786
)

0 commit comments

Comments
 (0)