Skip to content

Commit f172825

Browse files
authored
Merge branch 'main' into target-device
2 parents 37ddbe6 + 64651dc commit f172825

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# Copyright 2021-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# Redistribution and use in source and binary forms, with or without
44
# modification, are permitted provided that the following conditions
@@ -24,7 +24,7 @@
2424
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2525
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626

27-
cmake_minimum_required(VERSION 3.17)
27+
cmake_minimum_required(VERSION 3.31.8)
2828

2929
project(tritonopenvinobackend LANGUAGES C CXX)
3030

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Follow the steps below to build the backend shared library.
5757
```
5858
$ mkdir build
5959
$ cd build
60-
$ cmake -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/install -DTRITON_BUILD_OPENVINO_VERSION=2025.0.0 -DTRITON_BUILD_CONTAINER_VERSION=25.01 ..
60+
$ cmake -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/install -DTRITON_BUILD_OPENVINO_VERSION=2025.2.0 -DTRITON_BUILD_CONTAINER_VERSION=25.06 ..
6161
$ make install
6262
```
6363
The compiled backend will be added to `build/install/backends/openvino` folder.

src/openvino.cc

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
// Copyright 2021-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
//
33
// Redistribution and use in source and binary forms, with or without
44
// modification, are permitted provided that the following conditions
@@ -557,7 +557,7 @@ ModelState::ValidateInputs(const size_t expected_input_cnt)
557557
}
558558

559559
auto openvino_element = ModelConfigDataTypeToOpenVINOElement(io_dtype);
560-
if (openvino_element == ov::element::undefined) {
560+
if (openvino_element == ov::element::dynamic) {
561561
return TRITONSERVER_ErrorNew(
562562
TRITONSERVER_ERROR_INTERNAL,
563563
(std::string("unsupported datatype ") + io_dtype + " for input '" +
@@ -658,7 +658,7 @@ ModelState::ValidateOutputs()
658658
}
659659

660660
auto openvino_element = ModelConfigDataTypeToOpenVINOElement(io_dtype);
661-
if (openvino_element == ov::element::undefined) {
661+
if (openvino_element == ov::element::dynamic) {
662662
return TRITONSERVER_ErrorNew(
663663
TRITONSERVER_ERROR_INTERNAL,
664664
(std::string("unsupported datatype ") + io_dtype + " for output '" +
@@ -703,7 +703,7 @@ ModelState::AutoCompleteConfig()
703703
RETURN_IF_ERROR(
704704
ModelConfig().MemberAsString("default_model_filename", &artifact_name));
705705
std::string model_path;
706-
THROW_IF_BACKEND_INSTANCE_ERROR(ReadModel(artifact_name, &model_path));
706+
RETURN_IF_ERROR(ReadModel(artifact_name, &model_path));
707707
model_read_ = false; // Re-read model after autocomplete
708708

709709
// Get OV model inputs and outputs
@@ -1279,7 +1279,9 @@ ModelInstanceState::SetInputTensors(
12791279
batchn_shape[0] = total_batch_size;
12801280
}
12811281

1282-
const int64_t batchn_byte_size = GetByteSize(input_datatype, batchn_shape);
1282+
int64_t batchn_byte_size = 0;
1283+
RETURN_IF_ERROR(
1284+
GetByteSize(input_datatype, batchn_shape, &batchn_byte_size));
12831285

12841286
if (batch_pad_size_ != 0) {
12851287
ov::Tensor input_tensor =
@@ -1293,7 +1295,7 @@ ModelInstanceState::SetInputTensors(
12931295
"batch_size equal to max_batch_size for better performance.")
12941296
.c_str());
12951297
}
1296-
char* dest = (char*)input_tensor.data(ov::element::undefined);
1298+
char* dest = (char*)input_tensor.data(ov::element::dynamic);
12971299
memset(dest, 0, input_tensor.get_byte_size());
12981300
collector.ProcessTensor(
12991301
input_name, dest, input_tensor.get_byte_size(),
@@ -1361,7 +1363,7 @@ ModelInstanceState::ReadOutputTensors(
13611363

13621364
responder.ProcessTensor(
13631365
name, ConvertFromOpenVINOElement(output_tensor.get_element_type()),
1364-
output_shape, (const char*)output_tensor.data(ov::element::undefined),
1366+
output_shape, (const char*)output_tensor.data(ov::element::dynamic),
13651367
TRITONSERVER_MEMORY_CPU, 0);
13661368
}
13671369

src/openvino_utils.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021-2022, NVIDIA CORPORATION. All rights reserved.
1+
// Copyright 2021-2025, NVIDIA CORPORATION. All rights reserved.
22
//
33
// Redistribution and use in source and binary forms, with or without
44
// modification, are permitted provided that the following conditions
@@ -68,8 +68,6 @@ ConvertFromOpenVINOElement(ov::element::Type openvino_element)
6868
case ov::element::u64:
6969
return TRITONSERVER_TYPE_UINT64;
7070
// The following types are not supported:
71-
// Unspecified value. Used by default
72-
case ov::element::undefined:
7371
// Dynamic value
7472
case ov::element::dynamic:
7573
// 16bit floating point value, 8 bit for exponent, 7 bit for mantisa
@@ -119,7 +117,7 @@ ConvertToOpenVINOElement(TRITONSERVER_DataType data_type)
119117
break;
120118
}
121119

122-
return ov::element::undefined;
120+
return ov::element::dynamic;
123121
}
124122

125123
ov::element::Type
@@ -162,7 +160,7 @@ ModelConfigDataTypeToOpenVINOElement(const std::string& data_type_str)
162160
}
163161
}
164162

165-
return ov::element::undefined;
163+
return ov::element::dynamic;
166164
}
167165

168166
std::string

tools/gen_openvino_dockerfile.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Copyright 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# Copyright 2021-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions
@@ -145,13 +145,13 @@ def dockerfile_for_windows(output_file):
145145
SHELL ["cmd", "/S", "/C"]
146146
147147
# Install instructions:
148-
# https://docs.openvino.ai/2024/get-started/install-openvino/install-openvino-archive-windows.html
148+
# https://docs.openvino.ai/2025/get-started/install-openvino/install-openvino-archive-windows.html
149149
150150
# The windows part is using pre-build archive, while the linux part is building
151151
# from source.
152152
# TODO: Unify build steps between windows and linux.
153153
154-
ARG OPENVINO_VERSION=2025.0.0
154+
ARG OPENVINO_VERSION=2025.2.0
155155
ARG OPENVINO_BUILD_TYPE
156156
157157
WORKDIR /workspace
@@ -161,7 +161,10 @@ def dockerfile_for_windows(output_file):
161161
RUN IF "%OPENVINO_VERSION%"=="2024.4.0" curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.4/windows/w_openvino_toolkit_windows_2024.4.0.16579.c3152d32c9c_x86_64.zip --output ov.zip
162162
RUN IF "%OPENVINO_VERSION%"=="2024.5.0" curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.5/windows/w_openvino_toolkit_windows_2024.5.0.17288.7975fa5da0c_x86_64.zip --output ov.zip
163163
RUN IF "%OPENVINO_VERSION%"=="2025.0.0" curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2025.0/windows/openvino_toolkit_windows_2025.0.0.17942.1f68be9f594_x86_64.zip --output ov.zip
164+
RUN IF "%OPENVINO_VERSION%"=="2025.1.0" curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2025.1/windows/openvino_toolkit_windows_2025.1.0.18503.6fec06580ab_x86_64.zip --output ov.zip
165+
RUN IF "%OPENVINO_VERSION%"=="2025.2.0" curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2025.2/windows/openvino_toolkit_windows_2025.2.0.19140.c01cd93e24d_x86_64.zip --output ov.zip
164166
RUN IF not exist ov.zip ( echo "OpenVINO version %OPENVINO_VERSION% not supported" && exit 1 )
167+
165168
RUN tar -xf ov.zip
166169
RUN powershell.exe "Get-ChildItem w_openvino_toolkit_windows_* | foreach { ren $_.fullname install }"
167170

0 commit comments

Comments
 (0)