Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OpenVINO to 2024.5 #7857

Merged
merged 2 commits into from
Dec 11, 2024
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
4 changes: 2 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"triton_container_version": "24.12",
"upstream_container_version": "24.12",
"ort_version": "1.20.1",
"ort_openvino_version": "2024.4.0",
"standalone_openvino_version": "2024.4.0",
"ort_openvino_version": "2024.5.0",
"standalone_openvino_version": "2024.5.0",
"dcgm_version": "3.3.6",
"vllm_version": "0.5.5",
"rhel_py_version": "3.12.3",
Expand Down
28 changes: 15 additions & 13 deletions qa/common/gen_qa_dyna_sequence_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1292,26 +1292,27 @@ def create_openvino_modelfile(models_dir, model_version, max_batch, dtype, shape
)
model_version_dir = models_dir + "/" + model_name + "/" + str(model_version)

in0 = ov.opset1.parameter(shape=batch_dim + shape, dtype=dtype, name="INPUT")
start = ov.opset1.parameter(shape=batch_dim + shape, dtype=dtype, name="START")
end = ov.opset1.parameter(shape=batch_dim + shape, dtype=dtype, name="END")
ready = ov.opset1.parameter(shape=batch_dim + shape, dtype=dtype, name="READY")
corrid = ov.opset1.parameter(shape=batch_dim + shape, dtype=dtype, name="CORRID")
in0 = ng.parameter(shape=batch_dim + shape, dtype=dtype, name="INPUT")
start = ng.parameter(shape=batch_dim + shape, dtype=dtype, name="START")
end = ng.parameter(shape=batch_dim + shape, dtype=dtype, name="END")
ready = ng.parameter(shape=batch_dim + shape, dtype=dtype, name="READY")
corrid = ng.parameter(shape=batch_dim + shape, dtype=dtype, name="CORRID")

tmp1 = ov.opset1.add(in0, start)
tmp2 = ov.opset1.multiply(end, corrid)
tmp = ov.opset1.add(tmp1, tmp2)
op0 = ov.opset1.multiply(tmp, ready, name="OUTPUT")
tmp1 = ng.add(in0, start)
tmp2 = ng.multiply(end, corrid)
tmp = ng.add(tmp1, tmp2)
op0 = ng.multiply(tmp, ready, name="OUTPUT")

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

try:
os.makedirs(model_version_dir)
except OSError as ex:
pass # ignore existing dir

ov.serialize(
model, model_version_dir + "/model.xml", model_version_dir + "/model.bin"
ie_network.serialize(
model_version_dir + "/model.xml", model_version_dir + "/model.bin"
)


Expand Down Expand Up @@ -1559,7 +1560,8 @@ def create_models(models_dir, dtype, shape, no_batch=True):
import torch
from torch import nn
if FLAGS.openvino:
import openvino.runtime as ov
from openvino.inference_engine import IENetwork
import ngraph as ng

import test_util as tu

Expand Down
16 changes: 8 additions & 8 deletions qa/common/gen_qa_identity_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,18 +574,17 @@ def create_openvino_modelfile(
in_name = "INPUT{}".format(io_num)
out_name = "OUTPUT{}".format(io_num)
openvino_inputs.append(
ov.opset1.parameter(shape=batch_dim + shape, dtype=dtype, name=in_name)
)
openvino_outputs.append(
ov.opset1.result(openvino_inputs[io_num], name=out_name)
ng.parameter(shape=batch_dim + shape, dtype=dtype, name=in_name)
)
openvino_outputs.append(ng.result(openvino_inputs[io_num], name=out_name))

model = ov.Model(openvino_outputs, openvino_inputs, model_name)
function = ng.impl.Function(openvino_outputs, openvino_inputs, model_name)
ie_network = IENetwork(ng.impl.Function.to_capsule(function))

os.makedirs(model_version_dir, exist_ok=True)

ov.serialize(
model, model_version_dir + "/model.xml", model_version_dir + "/model.bin"
ie_network.serialize(
model_version_dir + "/model.xml", model_version_dir + "/model.bin"
)


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

import test_util as tu

Expand Down
2 changes: 1 addition & 1 deletion qa/common/gen_qa_model_repository
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ONNX_VERSION=1.16.1
ONNX_OPSET=0

# OPENVINO version
OPENVINO_VERSION=2024.4.0
OPENVINO_VERSION=2024.5.0

UBUNTU_IMAGE=${UBUNTU_IMAGE:=ubuntu:22.04}
PYTORCH_IMAGE=${PYTORCH_IMAGE:=nvcr.io/nvidia/pytorch:$TRITON_VERSION-py3}
Expand Down
30 changes: 14 additions & 16 deletions qa/common/gen_qa_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1809,31 +1809,28 @@ def create_openvino_modelfile(
)
model_version_dir = models_dir + "/" + model_name + "/" + str(model_version)

in0 = ov.opset1.parameter(
shape=batch_dim + input_shape, dtype=input_dtype, name="INPUT0"
)
in1 = ov.opset1.parameter(
shape=batch_dim + input_shape, dtype=input_dtype, name="INPUT1"
)
in0 = ng.parameter(shape=batch_dim + input_shape, dtype=input_dtype, name="INPUT0")
in1 = ng.parameter(shape=batch_dim + input_shape, dtype=input_dtype, name="INPUT1")

r0 = ov.opset1.add(in0, in1) if not swap else ov.opset1.subtract(in0, in1)
r1 = ov.opset1.subtract(in0, in1) if not swap else ov.opset1.add(in0, in1)
r0 = ng.add(in0, in1) if not swap else ng.subtract(in0, in1)
r1 = ng.subtract(in0, in1) if not swap else ng.add(in0, in1)

result0 = ov.opset1.reshape(r0, batch_dim + output0_shape, special_zero=False)
result1 = ov.opset1.reshape(r1, batch_dim + output1_shape, special_zero=False)
result0 = ng.reshape(r0, batch_dim + output0_shape, special_zero=False)
result1 = ng.reshape(r1, batch_dim + output1_shape, special_zero=False)

op0 = ov.opset1.convert(result0, destination_type=output0_dtype, name="OUTPUT0")
op1 = ov.opset1.convert(result1, destination_type=output1_dtype, name="OUTPUT1")
op0 = ng.convert(result0, destination_type=output0_dtype, name="OUTPUT0")
op1 = ng.convert(result1, destination_type=output1_dtype, name="OUTPUT1")

model = ov.Model([op0, op1], [in0, in1], model_name)
function = ng.impl.Function([op0, op1], [in0, in1], model_name)
ie_network = IENetwork(ng.impl.Function.to_capsule(function))

try:
os.makedirs(model_version_dir)
except OSError as ex:
pass # ignore existing dir

ov.serialize(
model, model_version_dir + "/model.xml", model_version_dir + "/model.bin"
ie_network.serialize(
model_version_dir + "/model.xml", model_version_dir + "/model.bin"
)


Expand Down Expand Up @@ -2489,7 +2486,8 @@ def create_fixed_models(
import torch
from torch import nn
if FLAGS.openvino:
import openvino.runtime as ov
from openvino.inference_engine import IENetwork
import ngraph as ng

import test_util as tu

Expand Down
14 changes: 8 additions & 6 deletions qa/common/gen_qa_reshape_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,29 +934,30 @@ def create_openvino_modelfile(
in_name = "INPUT{}".format(io_num)
out_name = "OUTPUT{}".format(io_num)
openvino_inputs.append(
ov.opset1.parameter(
ng.parameter(
shape=batch_dim + input_shapes[io_num], dtype=dtype, name=in_name
)
)

openvino_outputs.append(
ov.opset1.reshape(
ng.reshape(
openvino_inputs[io_num],
batch_dim + output_shapes[io_num],
name=out_name,
special_zero=False,
)
)

model = ov.Model(openvino_outputs, openvino_inputs, model_name)
function = ng.impl.Function(openvino_outputs, openvino_inputs, model_name)
ie_network = IENetwork(ng.impl.Function.to_capsule(function))

try:
os.makedirs(model_version_dir)
except OSError as ex:
pass # ignore existing dir

ov.serialize(
model, model_version_dir + "/model.xml", model_version_dir + "/model.bin"
ie_network.serialize(
model_version_dir + "/model.xml", model_version_dir + "/model.bin"
)


Expand Down Expand Up @@ -1462,7 +1463,8 @@ def create_openvino_models(
import torch
from torch import nn
if FLAGS.openvino:
import openvino.runtime as ov
from openvino.inference_engine import IENetwork
import ngraph as ng

import test_util as tu

Expand Down
20 changes: 11 additions & 9 deletions qa/common/gen_qa_sequence_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1145,22 +1145,23 @@ def create_openvino_modelfile(models_dir, model_version, max_batch, dtype, shape
)
model_version_dir = models_dir + "/" + model_name + "/" + str(model_version)

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

tmp = ov.opset1.add(in0, start)
op0 = ov.opset1.multiply(tmp, ready, name="OUTPUT")
tmp = ng.add(in0, start)
op0 = ng.multiply(tmp, ready, name="OUTPUT")

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

try:
os.makedirs(model_version_dir)
except OSError as ex:
pass # ignore existing dir

ov.serialize(
model, model_version_dir + "/model.xml", model_version_dir + "/model.bin"
ie_network.serialize(
model_version_dir + "/model.xml", model_version_dir + "/model.bin"
)


Expand Down Expand Up @@ -1420,7 +1421,8 @@ def create_models(models_dir, dtype, shape, no_batch=True):
import torch
from torch import nn
if FLAGS.openvino:
import openvino.runtime as ov
from openvino.inference_engine import IENetwork
import ngraph as ng

import test_util as tu

Expand Down