Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Fixed issue for T5 base model quantization issue with IPEX smoothquant #946

Merged
merged 8 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions examples/.config/pytorch_optimize.json
Original file line number Diff line number Diff line change
Expand Up @@ -2068,7 +2068,6 @@
"cmd": "bash run_tuning.sh",
"params": {
"topology": "flan-t5-large",
"task": "generation",
"approach": "static",
"backend": "ipex",
"output_model": "saved_results"
Expand All @@ -2078,7 +2077,7 @@
"cmd": "bash run_benchmark.sh",
"params": {
"topology": "flan-t5-large",
"task": "generation",
"lm_eval_tasks": "cnn_dailymail",
"approach": "static",
"backend": "ipex",
"mode": "benchmark",
Expand All @@ -2095,7 +2094,6 @@
"cmd": "bash run_tuning.sh",
"params": {
"topology": "t5-base-tag",
"task": "generation",
"approach": "static",
"backend": "ipex",
"output_model": "saved_results"
Expand All @@ -2105,7 +2103,7 @@
"cmd": "bash run_benchmark.sh",
"params": {
"topology": "t5-base-tag",
"task": "generation",
"lm_eval_tasks": "cnn_dailymail",
"approach": "static",
"backend": "ipex",
"mode": "benchmark",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ accelerate
sentencepiece != 0.1.92
protobuf
datasets
transformers==4.34.1
transformers
onnx
rouge-score
nltk
neural-compressor
optimum-intel
git+https://github.com/intel/intel-extension-for-pytorch.git
optimum-intel > 1.12.0
onnxruntime
intel-extension-for-pytorch
git+https://github.com/EleutherAI/lm-evaluation-harness.git@cc9778fbe4fa1a709be2abed9deb6180fd40e7e2
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function run_benchmark {
elif [[ ${int8} == "true" ]]; then
model_name_or_path=${tuned_checkpoint}
else
model_name_or_path="fabiochiu/t5-base-tag-generation"
model_name_or_path="t5-base"
fi
if [ "${backend}" = "ipex" ]; then
extra_cmd=$extra_cmd" --ipex"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ def set_seed(args):

def get_example_inputs(model):
onnx_config_class = TasksManager.get_exporter_config_constructor(model_type=model.config.model_type, exporter="onnx", task="text2text-generation")
onnx_config = onnx_config_class(model.config, use_past=model.config.use_cache)
onnx_config = onnx_config_class(model.config, use_past=model.config.use_cache, use_past_in_inputs=model.config.use_cache)
encoder_onnx_config = onnx_config.with_behavior("encoder")
decoder_onnx_config = onnx_config.with_behavior("decoder", use_past=False)
decoder_with_past_onnx_config = onnx_config.with_behavior("decoder", use_past=True)
decoder_with_past_onnx_config = onnx_config.with_behavior("decoder", use_past=True, use_past_in_inputs=model.config.use_cache)
encoder_dummy_inputs = encoder_onnx_config.generate_dummy_inputs(framework="pt")
decoder_dummy_inputs = decoder_onnx_config.generate_dummy_inputs(framework="pt")
decoder_dummy_inputs["encoder_outputs"] = tuple(decoder_dummy_inputs["encoder_outputs"][0:1])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function run_tuning {
if [ $input_model ];then
model_name_or_path=${input_model}
else
model_name_or_path="fabiochiu/t5-base-tag-generation"
model_name_or_path="t5-base"
fi
if [ "${backend}" = "ipex" ]; then
extra_cmd=$extra_cmd" --ipex"
Expand Down