Skip to content

Commit 3823804

Browse files
Bump transformers version (#3272)
### Changes - Bumped `transformers` version to `>=4.48.0` - Bumped `optimum-intel` version to `>=1.22.0` (as it requires `transformers`) - Bumped `optimum` version to `>=1.24.0` (as it requires `transformers`) - Updated statistics caching test with `position_ids` to fix: >Exception from src/plugins/intel_cpu/src/node.cpp:769: [CPU] Concat node with name '__module.model.model.decoder.layers.0.self_attn/aten::cat/Concat' Check 'TRShape::merge_into(output_shape, in_copy)' failed at src/core/shape_inference/include/concat_shape_inference.hpp:43: While validating node 'opset1::Concat __module.model.model.decoder.layers.0.self_attn/aten::cat/Concat (opset1::Parameter Parameter_753753[0]:f32[?,4,?,4], opset1::Transpose __module.model.model.decoder.layers.0.self_attn/aten::transpose/Transpose_1[0]:f32[?,4,?,4]) -> (f32[?,4,?,4])' with friendly_name '__module.model.model.decoder.layers.0.self_attn/aten::cat/Concat': Shape inference input shapes {{1,4,0,4},{0,4,0,4}} Argument shapes are inconsistent; they must have the same rank, and must have equal dimension everywhere except on the concatenation axis (axis 2). - Bumped `accelerate` version to `>=1.1.0` to fix: > NotImplementedError: data_seed requires Accelerate version `accelerate` >= 1.1.0. This is not supported and we recommend you to update your version. - Added `num_items_in_batch` to `compute_loss` to fix: > TypeError: CompressionTrainer.compute_loss() got an unexpected keyword argument 'num_items_in_batch' - Bumped `_ONNX_DEFAULT_OPSET` from 13 to 14 to fix: > torch.onnx.errors.UnsupportedOperatorError: Exporting the operator 'aten::scaled_dot_product_attention' to ONNX opset version 13 is not supported. Support for this operator was added in version 14, try exporting with this version. - Updated sparsity/pruning/nas references for tests. ### Reason for changes - Security issues with `transformers<4.48` ### Related tickets - N/A ### Tests - install - https://github.com/openvinotoolkit/nncf/actions/runs/13393410660 - passed - weight compression - https://github.com/openvinotoolkit/nncf/actions/runs/13393412141 - passed - examples - https://github.com/openvinotoolkit/nncf/actions/runs/13393412919 - passed - PTQ - manual/job/post_training_quantization/622/ - passed - PTWC - manual/job/post_training_weight_compression/327/ - passed --------- Co-authored-by: Nikolay Lyalyushkin <[email protected]>
1 parent 1511f32 commit 3823804

File tree

29 files changed

+1286
-2666
lines changed

29 files changed

+1286
-2666
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
datasets
22
openvino==2024.6
3-
optimum-intel[openvino]
4-
transformers
3+
optimum-intel[openvino]>=1.22.0
4+
transformers>=4.48.0
55
onnx==1.17.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
transformers
1+
transformers>=4.48.0
22
datasets==2.14.7
33
openvino==2025.0
4-
optimum-intel[openvino]
4+
optimum-intel[openvino]>=1.22.0
55
onnx==1.17.0

examples/llm_compression/openvino/tiny_llama_find_hyperparams/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ datasets
22
whowhatbench @ git+https://github.com/openvinotoolkit/openvino.genai#subdirectory=tools/who_what_benchmark
33
numpy>=1.23.5,<2
44
openvino==2025.0
5-
optimum-intel>=1.13.0
6-
transformers>=4.35.2
5+
optimum-intel>=1.22.0
6+
transformers>=4.48.0
77
onnx==1.17.0

examples/llm_compression/openvino/tiny_llama_synthetic_data/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ torch==2.5.1
22
datasets==3.0.1
33
numpy>=1.23.5,<2
44
openvino==2025.0
5-
optimum-intel>=1.13.0
6-
transformers>=4.35.2
5+
optimum-intel>=1.22.0
6+
transformers>=4.48.0
77
onnx==1.17.0

nncf/torch/exporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class PTExporter(Exporter):
7171
This class provides export of the compressed model to the ONNX format.
7272
"""
7373

74-
_ONNX_DEFAULT_OPSET = 13
74+
_ONNX_DEFAULT_OPSET = 14
7575

7676
@staticmethod
7777
def parse_format(save_format: str) -> Tuple[str, dict]:

tests/openvino/native/quantization/test_weights_compression_statistics_caching.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from typing import Tuple
1515

1616
import datasets
17+
import numpy as np
1718
import openvino as ov
1819
from optimum.intel.openvino import OVModelForCausalLM
1920
from transformers import AutoTokenizer
@@ -37,6 +38,11 @@ def transform_fn(data, model=model, tokenizer=tokenizer):
3738
input_ids = tokenized_text["input_ids"]
3839
inputs = {"input_ids": input_ids, "attention_mask": tokenized_text["attention_mask"]}
3940

41+
if "position_ids" in model.input_names:
42+
position_ids = np.cumsum(inputs["attention_mask"], axis=1) - 1
43+
position_ids[inputs["attention_mask"] == 0] = 1
44+
inputs["position_ids"] = position_ids
45+
4046
batch_size = input_ids.shape[0]
4147
if hasattr(model, "key_value_input_names"):
4248
for input_name in model.key_value_input_names:

tests/openvino/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ addict>=2.4.0
1313
timm==0.9.2
1414
efficientnet_pytorch==0.7.1
1515
datasets==3.0.1
16-
transformers==4.45.2
17-
optimum-intel==1.20.0
18-
optimum==1.23.1
16+
transformers==4.48.3
17+
optimum-intel==1.22.0
18+
optimum==1.24.0

tests/post_training/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ pytest-split
1010

1111
librosa==0.10.0
1212
memory-profiler==0.61.0
13-
optimum-intel==1.21.0
14-
optimum==1.23.3
13+
optimum-intel==1.22.0
14+
optimum==1.24.0
1515
scikit-learn>=1.2.2,<=1.5.0
1616
soundfile==0.12.1
1717
tensorboard==2.13.0
1818
tensorflow-io==0.32.0
1919
timm==0.9.2
20-
transformers==4.46.3
20+
transformers==4.48.3
2121
whowhatbench @ git+https://github.com/openvinotoolkit/[email protected]#subdirectory=tools/who_what_benchmark
2222
datasets==3.1.0

tests/torch/data/experimental/sparsify_activations/dummy_llama_int8_sym_weights_sparse_activations.dot

Lines changed: 491 additions & 477 deletions
Large diffs are not rendered by default.

tests/torch/data/experimental/sparsify_activations/dummy_llama_sparse_activations.dot

Lines changed: 431 additions & 417 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)