Skip to content

Commit da9b153

Browse files
authored
Update OpenVINO to 2024.5 (#7857)
1 parent db9655e commit da9b153

7 files changed

+59
-55
lines changed

build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
"triton_container_version": "24.12",
7676
"upstream_container_version": "24.12",
7777
"ort_version": "1.20.1",
78-
"ort_openvino_version": "2024.4.0",
79-
"standalone_openvino_version": "2024.4.0",
78+
"ort_openvino_version": "2024.5.0",
79+
"standalone_openvino_version": "2024.5.0",
8080
"dcgm_version": "3.3.6",
8181
"vllm_version": "0.5.5",
8282
"rhel_py_version": "3.12.3",

qa/common/gen_qa_dyna_sequence_models.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,26 +1292,27 @@ def create_openvino_modelfile(models_dir, model_version, max_batch, dtype, shape
12921292
)
12931293
model_version_dir = models_dir + "/" + model_name + "/" + str(model_version)
12941294

1295-
in0 = ov.opset1.parameter(shape=batch_dim + shape, dtype=dtype, name="INPUT")
1296-
start = ov.opset1.parameter(shape=batch_dim + shape, dtype=dtype, name="START")
1297-
end = ov.opset1.parameter(shape=batch_dim + shape, dtype=dtype, name="END")
1298-
ready = ov.opset1.parameter(shape=batch_dim + shape, dtype=dtype, name="READY")
1299-
corrid = ov.opset1.parameter(shape=batch_dim + shape, dtype=dtype, name="CORRID")
1295+
in0 = ng.parameter(shape=batch_dim + shape, dtype=dtype, name="INPUT")
1296+
start = ng.parameter(shape=batch_dim + shape, dtype=dtype, name="START")
1297+
end = ng.parameter(shape=batch_dim + shape, dtype=dtype, name="END")
1298+
ready = ng.parameter(shape=batch_dim + shape, dtype=dtype, name="READY")
1299+
corrid = ng.parameter(shape=batch_dim + shape, dtype=dtype, name="CORRID")
13001300

1301-
tmp1 = ov.opset1.add(in0, start)
1302-
tmp2 = ov.opset1.multiply(end, corrid)
1303-
tmp = ov.opset1.add(tmp1, tmp2)
1304-
op0 = ov.opset1.multiply(tmp, ready, name="OUTPUT")
1301+
tmp1 = ng.add(in0, start)
1302+
tmp2 = ng.multiply(end, corrid)
1303+
tmp = ng.add(tmp1, tmp2)
1304+
op0 = ng.multiply(tmp, ready, name="OUTPUT")
13051305

1306-
model = ov.Model([op0], [in0, start, end, ready, corrid], model_name)
1306+
function = ng.impl.Function([op0], [in0, start, end, ready, corrid], model_name)
1307+
ie_network = IENetwork(ng.impl.Function.to_capsule(function))
13071308

13081309
try:
13091310
os.makedirs(model_version_dir)
13101311
except OSError as ex:
13111312
pass # ignore existing dir
13121313

1313-
ov.serialize(
1314-
model, model_version_dir + "/model.xml", model_version_dir + "/model.bin"
1314+
ie_network.serialize(
1315+
model_version_dir + "/model.xml", model_version_dir + "/model.bin"
13151316
)
13161317

13171318

@@ -1559,7 +1560,8 @@ def create_models(models_dir, dtype, shape, no_batch=True):
15591560
import torch
15601561
from torch import nn
15611562
if FLAGS.openvino:
1562-
import openvino.runtime as ov
1563+
from openvino.inference_engine import IENetwork
1564+
import ngraph as ng
15631565

15641566
import test_util as tu
15651567

qa/common/gen_qa_identity_models.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -574,18 +574,17 @@ def create_openvino_modelfile(
574574
in_name = "INPUT{}".format(io_num)
575575
out_name = "OUTPUT{}".format(io_num)
576576
openvino_inputs.append(
577-
ov.opset1.parameter(shape=batch_dim + shape, dtype=dtype, name=in_name)
578-
)
579-
openvino_outputs.append(
580-
ov.opset1.result(openvino_inputs[io_num], name=out_name)
577+
ng.parameter(shape=batch_dim + shape, dtype=dtype, name=in_name)
581578
)
579+
openvino_outputs.append(ng.result(openvino_inputs[io_num], name=out_name))
582580

583-
model = ov.Model(openvino_outputs, openvino_inputs, model_name)
581+
function = ng.impl.Function(openvino_outputs, openvino_inputs, model_name)
582+
ie_network = IENetwork(ng.impl.Function.to_capsule(function))
584583

585584
os.makedirs(model_version_dir, exist_ok=True)
586585

587-
ov.serialize(
588-
model, model_version_dir + "/model.xml", model_version_dir + "/model.bin"
586+
ie_network.serialize(
587+
model_version_dir + "/model.xml", model_version_dir + "/model.bin"
589588
)
590589

591590

@@ -1318,7 +1317,8 @@ def create_models(models_dir, dtype, shape, io_cnt=1, no_batch=True):
13181317
):
13191318
import tensorrt as trt
13201319
if FLAGS.openvino:
1321-
import openvino.runtime as ov
1320+
from openvino.inference_engine import IENetwork
1321+
import ngraph as ng
13221322

13231323
import test_util as tu
13241324

qa/common/gen_qa_model_repository

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ ONNX_VERSION=1.16.1
5555
ONNX_OPSET=0
5656

5757
# OPENVINO version
58-
OPENVINO_VERSION=2024.4.0
58+
OPENVINO_VERSION=2024.5.0
5959

6060
UBUNTU_IMAGE=${UBUNTU_IMAGE:=ubuntu:22.04}
6161
PYTORCH_IMAGE=${PYTORCH_IMAGE:=nvcr.io/nvidia/pytorch:$TRITON_VERSION-py3}

qa/common/gen_qa_models.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,31 +1809,28 @@ def create_openvino_modelfile(
18091809
)
18101810
model_version_dir = models_dir + "/" + model_name + "/" + str(model_version)
18111811

1812-
in0 = ov.opset1.parameter(
1813-
shape=batch_dim + input_shape, dtype=input_dtype, name="INPUT0"
1814-
)
1815-
in1 = ov.opset1.parameter(
1816-
shape=batch_dim + input_shape, dtype=input_dtype, name="INPUT1"
1817-
)
1812+
in0 = ng.parameter(shape=batch_dim + input_shape, dtype=input_dtype, name="INPUT0")
1813+
in1 = ng.parameter(shape=batch_dim + input_shape, dtype=input_dtype, name="INPUT1")
18181814

1819-
r0 = ov.opset1.add(in0, in1) if not swap else ov.opset1.subtract(in0, in1)
1820-
r1 = ov.opset1.subtract(in0, in1) if not swap else ov.opset1.add(in0, in1)
1815+
r0 = ng.add(in0, in1) if not swap else ng.subtract(in0, in1)
1816+
r1 = ng.subtract(in0, in1) if not swap else ng.add(in0, in1)
18211817

1822-
result0 = ov.opset1.reshape(r0, batch_dim + output0_shape, special_zero=False)
1823-
result1 = ov.opset1.reshape(r1, batch_dim + output1_shape, special_zero=False)
1818+
result0 = ng.reshape(r0, batch_dim + output0_shape, special_zero=False)
1819+
result1 = ng.reshape(r1, batch_dim + output1_shape, special_zero=False)
18241820

1825-
op0 = ov.opset1.convert(result0, destination_type=output0_dtype, name="OUTPUT0")
1826-
op1 = ov.opset1.convert(result1, destination_type=output1_dtype, name="OUTPUT1")
1821+
op0 = ng.convert(result0, destination_type=output0_dtype, name="OUTPUT0")
1822+
op1 = ng.convert(result1, destination_type=output1_dtype, name="OUTPUT1")
18271823

1828-
model = ov.Model([op0, op1], [in0, in1], model_name)
1824+
function = ng.impl.Function([op0, op1], [in0, in1], model_name)
1825+
ie_network = IENetwork(ng.impl.Function.to_capsule(function))
18291826

18301827
try:
18311828
os.makedirs(model_version_dir)
18321829
except OSError as ex:
18331830
pass # ignore existing dir
18341831

1835-
ov.serialize(
1836-
model, model_version_dir + "/model.xml", model_version_dir + "/model.bin"
1832+
ie_network.serialize(
1833+
model_version_dir + "/model.xml", model_version_dir + "/model.bin"
18371834
)
18381835

18391836

@@ -2489,7 +2486,8 @@ def create_fixed_models(
24892486
import torch
24902487
from torch import nn
24912488
if FLAGS.openvino:
2492-
import openvino.runtime as ov
2489+
from openvino.inference_engine import IENetwork
2490+
import ngraph as ng
24932491

24942492
import test_util as tu
24952493

qa/common/gen_qa_reshape_models.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -934,29 +934,30 @@ def create_openvino_modelfile(
934934
in_name = "INPUT{}".format(io_num)
935935
out_name = "OUTPUT{}".format(io_num)
936936
openvino_inputs.append(
937-
ov.opset1.parameter(
937+
ng.parameter(
938938
shape=batch_dim + input_shapes[io_num], dtype=dtype, name=in_name
939939
)
940940
)
941941

942942
openvino_outputs.append(
943-
ov.opset1.reshape(
943+
ng.reshape(
944944
openvino_inputs[io_num],
945945
batch_dim + output_shapes[io_num],
946946
name=out_name,
947947
special_zero=False,
948948
)
949949
)
950950

951-
model = ov.Model(openvino_outputs, openvino_inputs, model_name)
951+
function = ng.impl.Function(openvino_outputs, openvino_inputs, model_name)
952+
ie_network = IENetwork(ng.impl.Function.to_capsule(function))
952953

953954
try:
954955
os.makedirs(model_version_dir)
955956
except OSError as ex:
956957
pass # ignore existing dir
957958

958-
ov.serialize(
959-
model, model_version_dir + "/model.xml", model_version_dir + "/model.bin"
959+
ie_network.serialize(
960+
model_version_dir + "/model.xml", model_version_dir + "/model.bin"
960961
)
961962

962963

@@ -1462,7 +1463,8 @@ def create_openvino_models(
14621463
import torch
14631464
from torch import nn
14641465
if FLAGS.openvino:
1465-
import openvino.runtime as ov
1466+
from openvino.inference_engine import IENetwork
1467+
import ngraph as ng
14661468

14671469
import test_util as tu
14681470

qa/common/gen_qa_sequence_models.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,22 +1145,23 @@ def create_openvino_modelfile(models_dir, model_version, max_batch, dtype, shape
11451145
)
11461146
model_version_dir = models_dir + "/" + model_name + "/" + str(model_version)
11471147

1148-
in0 = ov.opset1.parameter(shape=batch_dim + shape, dtype=dtype, name="INPUT")
1149-
start = ov.opset1.parameter(shape=batch_dim + shape, dtype=dtype, name="START")
1150-
ready = ov.opset1.parameter(shape=batch_dim + shape, dtype=dtype, name="READY")
1148+
in0 = ng.parameter(shape=batch_dim + shape, dtype=dtype, name="INPUT")
1149+
start = ng.parameter(shape=batch_dim + shape, dtype=dtype, name="START")
1150+
ready = ng.parameter(shape=batch_dim + shape, dtype=dtype, name="READY")
11511151

1152-
tmp = ov.opset1.add(in0, start)
1153-
op0 = ov.opset1.multiply(tmp, ready, name="OUTPUT")
1152+
tmp = ng.add(in0, start)
1153+
op0 = ng.multiply(tmp, ready, name="OUTPUT")
11541154

1155-
model = ov.Model([op0], [in0, start, ready], model_name)
1155+
function = ng.impl.Function([op0], [in0, start, ready], model_name)
1156+
ie_network = IENetwork(ng.impl.Function.to_capsule(function))
11561157

11571158
try:
11581159
os.makedirs(model_version_dir)
11591160
except OSError as ex:
11601161
pass # ignore existing dir
11611162

1162-
ov.serialize(
1163-
model, model_version_dir + "/model.xml", model_version_dir + "/model.bin"
1163+
ie_network.serialize(
1164+
model_version_dir + "/model.xml", model_version_dir + "/model.bin"
11641165
)
11651166

11661167

@@ -1420,7 +1421,8 @@ def create_models(models_dir, dtype, shape, no_batch=True):
14201421
import torch
14211422
from torch import nn
14221423
if FLAGS.openvino:
1423-
import openvino.runtime as ov
1424+
from openvino.inference_engine import IENetwork
1425+
import ngraph as ng
14241426

14251427
import test_util as tu
14261428

0 commit comments

Comments
 (0)