Skip to content

Commit c567e43

Browse files
authored
Remove OpenVino support (#3153)
1 parent 9cd57b6 commit c567e43

File tree

7 files changed

+5
-81
lines changed

7 files changed

+5
-81
lines changed

.github/workflows/test-daily-integration.yml

-23
This file was deleted.

docs/huggingface_models.md

-14
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,3 @@ helm-run \
4747
--suite v1 \
4848
--max-eval-instances 10
4949
```
50-
51-
To use Optimum Intel, add `--openvino` flag to `helm-run`. Optimum Intel provides a simple interface to optimize Transformer models and convert them to OpenVINO™ Intermediate Representation format to accelerate end-to-end pipelines on Intel® architectures using OpenVINO™ runtime. It runs the model on the CPU.
52-
53-
Examples:
54-
55-
```bash
56-
# Run boolq on stanford-crfm/BioMedLM optimized by Optimum Intel OpenNIVO
57-
helm-run \
58-
--run-entries boolq:model=stanford-crfm/BioMedLM \
59-
--enable-huggingface-models stanford-crfm/BioMedLM \
60-
--suite v1 \
61-
--max-eval-instances 10 \
62-
--openvino
63-
```

requirements.txt

-3
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ open_clip_torch==2.26.1
180180
openai==1.48.0
181181
opencv-python==4.8.1.78
182182
opencv-python-headless==4.10.0.84
183-
openvino==2024.4.0
184-
openvino-telemetry==2024.1.0
185-
openvino-tokenizers==2024.4.0.0
186183
opt-einsum==3.3.0
187184
optax==0.2.3
188185
optimum==1.22.0

setup.cfg

-4
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@ aleph-alpha =
126126
aleph-alpha-client~=2.14.0
127127
tokenizers>=0.13.3
128128

129-
openvino =
130-
optimum[openvino]~=1.19
131-
132129
allenai =
133130
ai2-olmo~=0.2
134131

@@ -175,7 +172,6 @@ models =
175172
crfm-helm[reka]
176173
crfm-helm[together]
177174
crfm-helm[yandex]
178-
crfm-helm[openvino]
179175

180176
reka =
181177
reka-api~=2.0.0

src/helm/benchmark/huggingface_registration.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,10 @@ def register_huggingface_model(
2020
helm_model_name: str,
2121
pretrained_model_name_or_path: str,
2222
revision: Optional[str] = None,
23-
openvino: Optional[bool] = False,
2423
) -> None:
2524
object_spec_args: Dict[str, Union[str, bool]] = {"pretrained_model_name_or_path": pretrained_model_name_or_path}
2625
if revision:
2726
object_spec_args["revision"] = revision
28-
if openvino:
29-
object_spec_args["openvino"] = openvino
3027

3128
# Auto-infer model properties from the tokenizer.
3229
create_tokenizer_args: Dict[str, str] = {"pretrained_model_name_or_path": pretrained_model_name_or_path}
@@ -79,7 +76,7 @@ def register_huggingface_model(
7976
register_tokenizer_config(tokenizer_config)
8077

8178

82-
def register_huggingface_hub_model_from_flag_value(raw_model_string: str, openvino=False) -> None:
79+
def register_huggingface_hub_model_from_flag_value(raw_model_string: str) -> None:
8380
raw_model_string_parts = raw_model_string.split("@")
8481
pretrained_model_name_or_path: str
8582
revision: Optional[str]
@@ -96,17 +93,15 @@ def register_huggingface_hub_model_from_flag_value(raw_model_string: str, openvi
9693
helm_model_name=raw_model_string,
9794
pretrained_model_name_or_path=pretrained_model_name_or_path,
9895
revision=revision,
99-
openvino=openvino,
10096
)
10197

10298

103-
def register_huggingface_local_model_from_flag_value(path: str, openvino=False) -> None:
99+
def register_huggingface_local_model_from_flag_value(path: str) -> None:
104100
if not path:
105101
raise ValueError("Path to Hugging Face model must be non-empty")
106102
path_parts = os.path.split(path)
107103
helm_model_name = f"huggingface/{path_parts[-1]}"
108104
register_huggingface_model(
109105
helm_model_name=helm_model_name,
110106
pretrained_model_name_or_path=path,
111-
openvino=openvino,
112107
)

src/helm/benchmark/run.py

+2-15
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,6 @@ def main():
266266
default=None,
267267
help="Full class name of the Runner class to use. If unset, uses the default Runner.",
268268
)
269-
parser.add_argument(
270-
"--openvino",
271-
action="store_true",
272-
default=False,
273-
help="Experimental: Apply openvino optimization to Hugging Face AutoModelForCausalLM models "
274-
"specified with the --enable-huggingface-models and --enable-local-huggingface-models flags.",
275-
)
276269
add_run_args(parser)
277270
args = parser.parse_args()
278271
validate_args(args)
@@ -284,19 +277,13 @@ def main():
284277
from helm.benchmark.huggingface_registration import register_huggingface_hub_model_from_flag_value
285278

286279
for huggingface_model_name in args.enable_huggingface_models:
287-
if args.openvino:
288-
register_huggingface_hub_model_from_flag_value(huggingface_model_name, args.openvino)
289-
else:
290-
register_huggingface_hub_model_from_flag_value(huggingface_model_name)
280+
register_huggingface_hub_model_from_flag_value(huggingface_model_name)
291281

292282
if args.enable_local_huggingface_models:
293283
from helm.benchmark.huggingface_registration import register_huggingface_local_model_from_flag_value
294284

295285
for huggingface_model_path in args.enable_local_huggingface_models:
296-
if args.openvino:
297-
register_huggingface_local_model_from_flag_value(huggingface_model_path, args.openvino)
298-
else:
299-
register_huggingface_local_model_from_flag_value(huggingface_model_path)
286+
register_huggingface_local_model_from_flag_value(huggingface_model_path)
300287

301288
run_entries: List[RunEntry] = []
302289
if args.conf_paths:

src/helm/clients/huggingface_client.py

+1-15
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def __init__(
5959
self,
6060
pretrained_model_name_or_path: str,
6161
wrapped_tokenizer: WrappedPreTrainedTokenizer,
62-
openvino: bool = False,
6362
**kwargs,
6463
):
6564
self.device: Optional[str]
@@ -92,20 +91,7 @@ def __init__(
9291

9392
with htrack_block(f"Loading Hugging Face model {pretrained_model_name_or_path}"):
9493
# WARNING this may fail if your GPU does not have enough memory
95-
if openvino:
96-
# Optimum Intel provides a simple interface to optimize Transformer models and convert them to \
97-
# OpenVINO™ Intermediate Representation (IR) format to accelerate end-to-end pipelines on \
98-
# Intel® architectures using OpenVINO™ runtime.
99-
try:
100-
from optimum.intel.openvino import OVModelForCausalLM
101-
except ModuleNotFoundError as e:
102-
handle_module_not_found_error(e, ["openvino"])
103-
104-
self.device = "cpu"
105-
self.model = OVModelForCausalLM.from_pretrained(
106-
pretrained_model_name_or_path, export=True, **kwargs
107-
).to(self.device)
108-
elif self.device is None:
94+
if self.device is None:
10995
# kwargs contains device_map=auto
11096
# Do not call to() because accelerate will take care of model device placement.
11197
self.model = AutoModelForCausalLM.from_pretrained(pretrained_model_name_or_path, **kwargs)

0 commit comments

Comments
 (0)