From 3b887c81bba9780c0767673b1ec5d0b25d828f15 Mon Sep 17 00:00:00 2001 From: Dudi Lester Date: Wed, 21 Feb 2024 09:09:31 +0200 Subject: [PATCH 1/3] change quant conf example to use act_maxabs_pow2_weights_pcs_opt_pow2 --- .../act_maxabs_hw_weights_pcs_maxabs_pow2_quant.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/text-generation/quantization_config/act_maxabs_hw_weights_pcs_maxabs_pow2_quant.json b/examples/text-generation/quantization_config/act_maxabs_hw_weights_pcs_maxabs_pow2_quant.json index c83fa281f6..258848c946 100644 --- a/examples/text-generation/quantization_config/act_maxabs_hw_weights_pcs_maxabs_pow2_quant.json +++ b/examples/text-generation/quantization_config/act_maxabs_hw_weights_pcs_maxabs_pow2_quant.json @@ -2,7 +2,7 @@ "method": "HOOKS", "mode": "QUANTIZE", "observer": "maxabs", - "scale_method": "ACT_MAXABS_HW_WEIGHTS_PCS_MAXABS_POW2", + "scale_method": "ACT_MAXABS_POW2_WEIGHTS_PCS_OPT_POW2", "whitelist": {"types": [], "names": []}, "blacklist": {"types": [], "names": []}, "dump_stats_path": "./hqt_output/measure", From 38d9838699206e5679c7a550d1dd972cfd324270 Mon Sep 17 00:00:00 2001 From: Nir David <124874956+nirda7@users.noreply.github.com> Date: Wed, 28 Feb 2024 10:50:18 +0200 Subject: [PATCH 2/3] Rename whitelist & blacklist (#71) --- .../act_maxabs_hw_weights_pcs_maxabs_pow2_quant.json | 4 ++-- .../text-generation/quantization_config/maxabs_measure.json | 4 ++-- .../text-generation/quantization_config/maxabs_quant.json | 4 ++-- .../text-generation/quantization_config/unit_scale_quant.json | 4 ++-- tests/transformers/tests/test_modeling_common.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/text-generation/quantization_config/act_maxabs_hw_weights_pcs_maxabs_pow2_quant.json b/examples/text-generation/quantization_config/act_maxabs_hw_weights_pcs_maxabs_pow2_quant.json index 258848c946..602a147baa 100644 --- a/examples/text-generation/quantization_config/act_maxabs_hw_weights_pcs_maxabs_pow2_quant.json +++ b/examples/text-generation/quantization_config/act_maxabs_hw_weights_pcs_maxabs_pow2_quant.json @@ -3,8 +3,8 @@ "mode": "QUANTIZE", "observer": "maxabs", "scale_method": "ACT_MAXABS_POW2_WEIGHTS_PCS_OPT_POW2", - "whitelist": {"types": [], "names": []}, - "blacklist": {"types": [], "names": []}, + "allowlist": {"types": [], "names": []}, + "blocklist": {"types": [], "names": []}, "dump_stats_path": "./hqt_output/measure", "dump_stats_xlsx_path": "./hqt_output/measure/fp8stats.xlsx" } diff --git a/examples/text-generation/quantization_config/maxabs_measure.json b/examples/text-generation/quantization_config/maxabs_measure.json index 3715b506b6..3645fe743a 100644 --- a/examples/text-generation/quantization_config/maxabs_measure.json +++ b/examples/text-generation/quantization_config/maxabs_measure.json @@ -2,8 +2,8 @@ "method": "HOOKS", "mode": "MEASURE", "observer": "maxabs", - "whitelist": {"types": [], "names": []}, - "blacklist": {"types": [], "names": []}, + "allowlist": {"types": [], "names": []}, + "blocklist": {"types": [], "names": []}, "dump_stats_path": "./hqt_output/measure", "dump_stats_xlsx_path": "./hqt_output/measure/fp8stats.xlsx" } \ No newline at end of file diff --git a/examples/text-generation/quantization_config/maxabs_quant.json b/examples/text-generation/quantization_config/maxabs_quant.json index cb37e98a6e..02314a728e 100644 --- a/examples/text-generation/quantization_config/maxabs_quant.json +++ b/examples/text-generation/quantization_config/maxabs_quant.json @@ -3,8 +3,8 @@ "mode": "QUANTIZE", "observer": "maxabs", "scale_method": "maxabs_hw", - "whitelist": {"types": [], "names": []}, - "blacklist": {"types": [], "names": []}, + "allowlist": {"types": [], "names": []}, + "blocklist": {"types": [], "names": []}, "dump_stats_path": "./hqt_output/measure", "dump_stats_xlsx_path": "./hqt_output/measure/fp8stats.xlsx" } \ No newline at end of file diff --git a/examples/text-generation/quantization_config/unit_scale_quant.json b/examples/text-generation/quantization_config/unit_scale_quant.json index e2d709da61..caad4bb2a4 100644 --- a/examples/text-generation/quantization_config/unit_scale_quant.json +++ b/examples/text-generation/quantization_config/unit_scale_quant.json @@ -3,8 +3,8 @@ "mode": "QUANTIZE", "observer": "maxabs", "scale_method": "unit_scale", - "whitelist": {"types": [], "names": []}, - "blacklist": {"types": [], "names": []}, + "allowlist": {"types": [], "names": []}, + "blocklist": {"types": [], "names": []}, "dump_stats_path": "./hqt_output/measure", "dump_stats_xlsx_path": "./hqt_output/measure/fp8stats.xlsx" } diff --git a/tests/transformers/tests/test_modeling_common.py b/tests/transformers/tests/test_modeling_common.py index d33cf1e58d..e07b04d9e6 100755 --- a/tests/transformers/tests/test_modeling_common.py +++ b/tests/transformers/tests/test_modeling_common.py @@ -1883,8 +1883,8 @@ def test_multi_gpu_data_parallel_forward(self): # some params shouldn't be scattered by nn.DataParallel # so just remove them if they are present. - blacklist_non_batched_params = ["head_mask", "decoder_head_mask", "cross_attn_head_mask"] - for k in blacklist_non_batched_params: + blocklist_non_batched_params = ["head_mask", "decoder_head_mask", "cross_attn_head_mask"] + for k in blocklist_non_batched_params: inputs_dict.pop(k, None) # move input tensors to cuda:O From 8cb3fd68000e79a8aabf842d9d7d166732d52868 Mon Sep 17 00:00:00 2001 From: Danny Semiat Date: Thu, 7 Mar 2024 15:19:16 +0200 Subject: [PATCH 3/3] Revert blocklist change in test_modeling_common.py --- tests/transformers/tests/test_modeling_common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/transformers/tests/test_modeling_common.py b/tests/transformers/tests/test_modeling_common.py index e07b04d9e6..d33cf1e58d 100755 --- a/tests/transformers/tests/test_modeling_common.py +++ b/tests/transformers/tests/test_modeling_common.py @@ -1883,8 +1883,8 @@ def test_multi_gpu_data_parallel_forward(self): # some params shouldn't be scattered by nn.DataParallel # so just remove them if they are present. - blocklist_non_batched_params = ["head_mask", "decoder_head_mask", "cross_attn_head_mask"] - for k in blocklist_non_batched_params: + blacklist_non_batched_params = ["head_mask", "decoder_head_mask", "cross_attn_head_mask"] + for k in blacklist_non_batched_params: inputs_dict.pop(k, None) # move input tensors to cuda:O