From b040d784064ed8e8af34174c2cb35b3f4e02b34a Mon Sep 17 00:00:00 2001 From: IlyasMoutawwakil Date: Mon, 1 Jul 2024 20:07:06 +0200 Subject: [PATCH 1/3] inc only working with quantized models --- tests/configs/_inc_quant_.yaml | 3 +++ tests/configs/_text_decoders_.yaml | 2 +- ...u_inference_neural_compressor_inc_quant_text_decoders.yaml} | 1 + ...u_inference_neural_compressor_inc_quant_text_encoders.yaml} | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 tests/configs/_inc_quant_.yaml rename tests/configs/{cpu_inference_neural_compressor_text_decoders.yaml => cpu_inference_neural_compressor_inc_quant_text_decoders.yaml} (87%) rename tests/configs/{cpu_inference_neural_compressor_text_encoders.yaml => cpu_inference_neural_compressor_inc_quant_text_encoders.yaml} (87%) diff --git a/tests/configs/_inc_quant_.yaml b/tests/configs/_inc_quant_.yaml new file mode 100644 index 00000000..1347abfc --- /dev/null +++ b/tests/configs/_inc_quant_.yaml @@ -0,0 +1,3 @@ +backend: + ptq_quantization: true + calibration: true diff --git a/tests/configs/_text_decoders_.yaml b/tests/configs/_text_decoders_.yaml index 5c92a056..f32ec1ee 100644 --- a/tests/configs/_text_decoders_.yaml +++ b/tests/configs/_text_decoders_.yaml @@ -3,4 +3,4 @@ hydra: sweeper: params: backend.task: text-generation - backend.model: hf-internal-testing/tiny-random-gpt2,IlyasMoutawwakil/tiny-random-llama + backend.model: hf-internal-testing/tiny-random-GPT2LMHeadModel,hf-internal-testing/tiny-random-LlamaForCausalLM diff --git a/tests/configs/cpu_inference_neural_compressor_text_decoders.yaml b/tests/configs/cpu_inference_neural_compressor_inc_quant_text_decoders.yaml similarity index 87% rename from tests/configs/cpu_inference_neural_compressor_text_decoders.yaml rename to tests/configs/cpu_inference_neural_compressor_inc_quant_text_decoders.yaml index fb966c71..7865da6e 100644 --- a/tests/configs/cpu_inference_neural_compressor_text_decoders.yaml +++ b/tests/configs/cpu_inference_neural_compressor_inc_quant_text_decoders.yaml @@ -3,6 +3,7 @@ defaults: - _base_ # inherits from base config - _cpu_ # inherits from cpu config - _inference_ # inherits from inference config + - _inc_quant_ # inherits from incremental quantization config - _text_decoders_ # inherits from text decoders config - _no_weights_ # inherits from no weights config - _self_ # hydra 1.1 compatibility diff --git a/tests/configs/cpu_inference_neural_compressor_text_encoders.yaml b/tests/configs/cpu_inference_neural_compressor_inc_quant_text_encoders.yaml similarity index 87% rename from tests/configs/cpu_inference_neural_compressor_text_encoders.yaml rename to tests/configs/cpu_inference_neural_compressor_inc_quant_text_encoders.yaml index afbca904..91451cf1 100644 --- a/tests/configs/cpu_inference_neural_compressor_text_encoders.yaml +++ b/tests/configs/cpu_inference_neural_compressor_inc_quant_text_encoders.yaml @@ -3,6 +3,7 @@ defaults: - _base_ # inherits from base config - _cpu_ # inherits from cpu config - _inference_ # inherits from inference config + - _inc_quant_ # inherits from incremental quantization config - _text_encoders_ # inherits from text encoders config - _no_weights_ # inherits from no weights config - _self_ # hydra 1.1 compatibility From 3f0056a3d15d1808165119ff58dd7f6a91090c4a Mon Sep 17 00:00:00 2001 From: IlyasMoutawwakil Date: Tue, 2 Jul 2024 11:18:16 +0200 Subject: [PATCH 2/3] set save strat --- optimum_benchmark/scenarios/training/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/optimum_benchmark/scenarios/training/config.py b/optimum_benchmark/scenarios/training/config.py index 7fb3d049..ceca83d2 100644 --- a/optimum_benchmark/scenarios/training/config.py +++ b/optimum_benchmark/scenarios/training/config.py @@ -10,7 +10,8 @@ "per_device_train_batch_size": 2, "gradient_accumulation_steps": 1, "output_dir": "./trainer_output", - "evaluation_strategy": "no", + "eval_strategy": "no", + "save_strategy": "no", "do_train": True, "use_cpu": False, "max_steps": -1, From c85b7fe2cdd426c96bc90c18d9808ebaa8a10b1a Mon Sep 17 00:00:00 2001 From: IlyasMoutawwakil Date: Tue, 2 Jul 2024 11:42:19 +0200 Subject: [PATCH 3/3] fix for torch ort --- optimum_benchmark/scenarios/training/config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/optimum_benchmark/scenarios/training/config.py b/optimum_benchmark/scenarios/training/config.py index ceca83d2..89581e02 100644 --- a/optimum_benchmark/scenarios/training/config.py +++ b/optimum_benchmark/scenarios/training/config.py @@ -10,6 +10,7 @@ "per_device_train_batch_size": 2, "gradient_accumulation_steps": 1, "output_dir": "./trainer_output", + "evaluation_strategy": "no", "eval_strategy": "no", "save_strategy": "no", "do_train": True,