Skip to content

Commit 2f960af

Browse files
committed
Merge branch 'main' into ea/mpt_sdpa
2 parents 4f36b6f + b383ffb commit 2f960af

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

optimum/exporters/openvino/model_configs.py

+6
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,12 @@ class OrionOpenVINOConfig(TextDecoderWithPositionIdsOnnxConfig):
454454
NORMALIZED_CONFIG_CLASS = NormalizedTextConfig
455455

456456

457+
@register_in_tasks_manager("olmo", *["text-generation", "text-generation-with-past"], library_name="transformers")
458+
class OlmoOpenVINOConfig(TextDecoderWithPositionIdsOnnxConfig):
459+
DEFAULT_ONNX_OPSET = 14
460+
NORMALIZED_CONFIG_CLASS = NormalizedTextConfig
461+
462+
457463
@register_in_tasks_manager(
458464
"mpt", *["text-generation", "text-generation-with-past", "text-classification"], library_name="transformers"
459465
)

tests/openvino/test_modeling.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ class OVModelForCausalLMIntegrationTest(unittest.TestCase):
529529
"mistral",
530530
"mixtral",
531531
"mpt",
532+
"olmo",
532533
"opt",
533534
"pegasus",
534535
"qwen",
@@ -551,20 +552,19 @@ class OVModelForCausalLMIntegrationTest(unittest.TestCase):
551552
"jais",
552553
"qwen",
553554
"internlm2",
554-
"olmo",
555555
"orion",
556556
"phi3",
557557
)
558558

559559
@parameterized.expand(SUPPORTED_ARCHITECTURES)
560560
def test_compare_to_transformers(self, model_arch):
561561
model_id = MODEL_NAMES[model_arch]
562-
not_stateful = ["gpt_bigcode"]
562+
not_stateful = []
563563
if is_openvino_version("<", "2024.0"):
564564
not_stateful.append("mixtral")
565565

566566
if is_openvino_version("<", "2024.1"):
567-
not_stateful.extend(["llama", "gemma"])
567+
not_stateful.extend(["llama", "gemma", "gpt_bigcode"])
568568

569569
if "gptq" in model_arch:
570570
self.skipTest("GPTQ model loading unsupported with AutoModelForCausalLM")

tests/openvino/test_quantization.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ def preprocess_function(examples, tokenizer):
657657

658658

659659
class OVTrainerTest(unittest.TestCase):
660-
SUPPORTED_ARCHITECTURES_WITH_EXPECTED_QUANTIZED_MATMULS = (("distilbert-base-uncased", 50, 38),)
660+
SUPPORTED_ARCHITECTURES_WITH_EXPECTED_QUANTIZED_MATMULS = (("distilbert-base-uncased", 49, 38),)
661661

662662
@parameterized.expand(SUPPORTED_ARCHITECTURES_WITH_EXPECTED_QUANTIZED_MATMULS)
663663
def test_aware_training_quantization(self, model_name, expected_fake_quantize, expected_int8):

tests/openvino/test_training.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -322,30 +322,30 @@ def tearDown(self):
322322
"default_quantization": OVTrainerTestDescriptor(
323323
model_id="hf-internal-testing/tiny-random-bert",
324324
nncf_compression_config=DEFAULT_QUANTIZATION_CONFIG,
325-
expected_fake_quantize=44,
325+
expected_fake_quantize=34,
326326
expected_int8=32,
327327
compression_metrics=["compression_loss"],
328328
),
329329
"distillation,default_quantization": OVTrainerTestDescriptor(
330330
model_id="hf-internal-testing/tiny-random-bert",
331331
teacher_model_id="hf-internal-testing/tiny-random-bert",
332332
nncf_compression_config=DEFAULT_QUANTIZATION_CONFIG,
333-
expected_fake_quantize=44,
333+
expected_fake_quantize=34,
334334
expected_int8=32,
335335
compression_metrics=["compression_loss", "distillation_loss", "task_loss"],
336336
),
337337
"customized_quantization": OVTrainerTestDescriptor(
338338
model_id="hf-internal-testing/tiny-random-bert",
339339
nncf_compression_config=CUSTOMIZED_QUANTIZATION_CONFIG,
340-
expected_fake_quantize=44,
340+
expected_fake_quantize=34,
341341
expected_int8=32,
342342
compression_metrics=["compression_loss"],
343343
),
344344
"distillation,customized_quantization": OVTrainerTestDescriptor(
345345
model_id="hf-internal-testing/tiny-random-bert",
346346
teacher_model_id="hf-internal-testing/tiny-random-bert",
347347
nncf_compression_config=CUSTOMIZED_QUANTIZATION_CONFIG,
348-
expected_fake_quantize=44,
348+
expected_fake_quantize=34,
349349
expected_int8=32,
350350
compression_metrics=["compression_loss", "distillation_loss", "task_loss"],
351351
),
@@ -418,7 +418,7 @@ def tearDown(self):
418418
"default_quantization,unstructured_movement_sparsity": OVTrainerTestDescriptor(
419419
model_id="hf-internal-testing/tiny-random-bert",
420420
nncf_compression_config=[DEFAULT_QUANTIZATION_CONFIG, UNSTRUCTURED_MOVEMENT_SPARSITY_CONFIG_FOR_BERT],
421-
expected_fake_quantize=44,
421+
expected_fake_quantize=34,
422422
expected_int8=32,
423423
expected_binary_masks=60,
424424
compression_metrics=["compression_loss"],
@@ -429,7 +429,7 @@ def tearDown(self):
429429
CUSTOMIZED_QUANTIZATION_CONFIG,
430430
UNSTRUCTURED_MOVEMENT_SPARSITY_CONFIG_FOR_BERT,
431431
],
432-
expected_fake_quantize=44,
432+
expected_fake_quantize=34,
433433
expected_int8=32,
434434
expected_binary_masks=60,
435435
compression_metrics=["compression_loss"],
@@ -438,7 +438,7 @@ def tearDown(self):
438438
model_id="hf-internal-testing/tiny-random-bert",
439439
teacher_model_id="hf-internal-testing/tiny-random-bert",
440440
nncf_compression_config=[DEFAULT_QUANTIZATION_CONFIG, UNSTRUCTURED_MOVEMENT_SPARSITY_CONFIG_FOR_BERT],
441-
expected_fake_quantize=44,
441+
expected_fake_quantize=34,
442442
expected_int8=32,
443443
expected_binary_masks=60,
444444
compression_metrics=["compression_loss", "distillation_loss", "task_loss"],
@@ -450,7 +450,7 @@ def tearDown(self):
450450
CUSTOMIZED_QUANTIZATION_CONFIG,
451451
UNSTRUCTURED_MOVEMENT_SPARSITY_CONFIG_FOR_BERT,
452452
],
453-
expected_fake_quantize=44,
453+
expected_fake_quantize=34,
454454
expected_int8=32,
455455
expected_binary_masks=60,
456456
compression_metrics=["compression_loss", "distillation_loss", "task_loss"],
@@ -730,7 +730,7 @@ def check_ovmodel_reshaping(self, ovmodel: OVModel):
730730
"quantization": OVTrainerTestDescriptor(
731731
model_id="hf-internal-testing/tiny-random-Wav2Vec2Model",
732732
nncf_compression_config=[QUANTIZATION_CONFIG_FOR_WAV2VEC2],
733-
expected_fake_quantize=48,
733+
expected_fake_quantize=40,
734734
expected_int8=30,
735735
compression_metrics=["compression_loss"],
736736
),
@@ -757,7 +757,7 @@ def check_ovmodel_reshaping(self, ovmodel: OVModel):
757757
"quantization,unstructured_movement_sparsity": OVTrainerTestDescriptor(
758758
model_id="hf-internal-testing/tiny-random-Wav2Vec2Model",
759759
nncf_compression_config=[QUANTIZATION_CONFIG_FOR_WAV2VEC2, UNSTRUCTURED_MOVEMENT_SPARSITY_CONFIG_FOR_WAV2VEC2],
760-
expected_fake_quantize=48,
760+
expected_fake_quantize=40,
761761
expected_int8=30,
762762
expected_binary_masks=48,
763763
compression_metrics=["compression_loss"],
@@ -775,7 +775,7 @@ def check_ovmodel_reshaping(self, ovmodel: OVModel):
775775
model_id="hf-internal-testing/tiny-random-Wav2Vec2Model",
776776
teacher_model_id="hf-internal-testing/tiny-random-Wav2Vec2Model",
777777
nncf_compression_config=[QUANTIZATION_CONFIG_FOR_WAV2VEC2, UNSTRUCTURED_MOVEMENT_SPARSITY_CONFIG_FOR_WAV2VEC2],
778-
expected_fake_quantize=48,
778+
expected_fake_quantize=40,
779779
expected_int8=30,
780780
expected_binary_masks=48,
781781
compression_metrics=["compression_loss", "distillation_loss", "task_loss"],

tests/openvino/utils_tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"mpt": "hf-internal-testing/tiny-random-MptForCausalLM",
7575
"mt5": "stas/mt5-tiny-random",
7676
"nystromformer": "hf-internal-testing/tiny-random-NystromformerModel",
77-
"olmo": "katuni4ka/tiny-random-olmo",
77+
"olmo": "katuni4ka/tiny-random-olmo-hf",
7878
"orion": "katuni4ka/tiny-random-orion",
7979
"pegasus": "hf-internal-testing/tiny-random-pegasus",
8080
"pix2struct": "fxmarty/pix2struct-tiny-random",

0 commit comments

Comments
 (0)