From 38c496287c9c1bb6a5ad3be83ada1d3c48209eaa Mon Sep 17 00:00:00 2001 From: "Raasz, Pawel" Date: Thu, 20 Mar 2025 13:16:47 +0000 Subject: [PATCH 1/8] Update tensor pointer cast Signed-off-by: Raasz, Pawel --- .../user_ie_extensions/calculate_grid.cpp | 2 +- .../user_ie_extensions/complex_mul.cpp | 4 ++-- modules/custom_operations/user_ie_extensions/fft.cpp | 5 +++-- .../user_ie_extensions/grid_sample.cpp | 4 ++-- .../user_ie_extensions/sparse_conv.cpp | 10 +++++----- .../user_ie_extensions/sparse_conv_transpose.cpp | 10 +++++----- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/modules/custom_operations/user_ie_extensions/calculate_grid.cpp b/modules/custom_operations/user_ie_extensions/calculate_grid.cpp index eada4b926..e2b163206 100644 --- a/modules/custom_operations/user_ie_extensions/calculate_grid.cpp +++ b/modules/custom_operations/user_ie_extensions/calculate_grid.cpp @@ -21,7 +21,7 @@ std::shared_ptr CalculateGrid::clone_with_new_inputs(const ov::OutputV } bool CalculateGrid::evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const { - const float* inpPos = reinterpret_cast(inputs[0].data()); + const float *inpPos = reinterpret_cast(inputs[0].data()); float* out = reinterpret_cast(outputs[0].data()); std::set > outPos; diff --git a/modules/custom_operations/user_ie_extensions/complex_mul.cpp b/modules/custom_operations/user_ie_extensions/complex_mul.cpp index 518966d68..a8c1c37bc 100644 --- a/modules/custom_operations/user_ie_extensions/complex_mul.cpp +++ b/modules/custom_operations/user_ie_extensions/complex_mul.cpp @@ -22,8 +22,8 @@ std::shared_ptr ComplexMultiplication::clone_with_new_inputs(const ov: } bool ComplexMultiplication::evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const { - const float* inp0 = reinterpret_cast(inputs[0].data()); - const float* inp1 = reinterpret_cast(inputs[1].data()); + const float *inp0 = reinterpret_cast(inputs[0].data()); + const float *inp1 = reinterpret_cast(inputs[1].data()); float* out = reinterpret_cast(outputs[0].data()); size_t channels0 = inputs[0].get_shape()[1]; diff --git a/modules/custom_operations/user_ie_extensions/fft.cpp b/modules/custom_operations/user_ie_extensions/fft.cpp index 8633c67f7..7f8a93e7d 100644 --- a/modules/custom_operations/user_ie_extensions/fft.cpp +++ b/modules/custom_operations/user_ie_extensions/fft.cpp @@ -127,12 +127,13 @@ bool FFT::visit_attributes(ov::AttributeVisitor& visitor) { } bool FFT::evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const { - float* inpData = reinterpret_cast(inputs[0].data()); + //const_cast because the cvSetData use user pointer as non-const, should be ok as it looks like input data + float *inpData = reinterpret_cast(const_cast(inputs[0].data())); if (inputs[1].get_element_type() != ov::element::i32) OPENVINO_THROW("Unexpected dims type: " + inputs[1].get_element_type().to_string()); - int32_t* signalDimsData = reinterpret_cast(inputs[1].data()); + const int32_t *signalDimsData = reinterpret_cast(inputs[1].data()); float* outData = reinterpret_cast(outputs[0].data()); std::vector dims = inputs[0].get_shape(); const size_t numSignalDims = inputs[1].get_shape()[0]; diff --git a/modules/custom_operations/user_ie_extensions/grid_sample.cpp b/modules/custom_operations/user_ie_extensions/grid_sample.cpp index 62891d7db..107bd90a1 100644 --- a/modules/custom_operations/user_ie_extensions/grid_sample.cpp +++ b/modules/custom_operations/user_ie_extensions/grid_sample.cpp @@ -26,8 +26,8 @@ std::shared_ptr GridSample::clone_with_new_inputs(const ov::OutputVect } bool GridSample::evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const { - const float* inpData = reinterpret_cast(inputs[0].data()); - const float* gridData = reinterpret_cast(inputs[1].data()); + const float *inpData = reinterpret_cast(inputs[0].data()); + const float *gridData = reinterpret_cast(inputs[1].data()); float* outData = reinterpret_cast(outputs[0].data()); std::vector inpDims = inputs[0].get_shape(); diff --git a/modules/custom_operations/user_ie_extensions/sparse_conv.cpp b/modules/custom_operations/user_ie_extensions/sparse_conv.cpp index b6f899444..bae7eb301 100644 --- a/modules/custom_operations/user_ie_extensions/sparse_conv.cpp +++ b/modules/custom_operations/user_ie_extensions/sparse_conv.cpp @@ -23,11 +23,11 @@ std::shared_ptr SparseConv::clone_with_new_inputs(const ov::OutputVect } bool SparseConv::evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const { - const float* features = reinterpret_cast(inputs[0].data()); - const float* inpPos = reinterpret_cast(inputs[1].data()); - const float* outPos = reinterpret_cast(inputs[2].data()); - const float* kernel = reinterpret_cast(inputs[3].data()); - const float* offset = reinterpret_cast(inputs[4].data()); + const float *features = reinterpret_cast(inputs[0].data()); + const float *inpPos = reinterpret_cast(inputs[1].data()); + const float *outPos = reinterpret_cast(inputs[2].data()); + const float *kernel = reinterpret_cast(inputs[3].data()); + const float *offset = reinterpret_cast(inputs[4].data()); float* out = reinterpret_cast(outputs[0].data()); memset(out, 0, outputs[0].get_byte_size()); diff --git a/modules/custom_operations/user_ie_extensions/sparse_conv_transpose.cpp b/modules/custom_operations/user_ie_extensions/sparse_conv_transpose.cpp index e493c842b..9ad164f5d 100644 --- a/modules/custom_operations/user_ie_extensions/sparse_conv_transpose.cpp +++ b/modules/custom_operations/user_ie_extensions/sparse_conv_transpose.cpp @@ -23,11 +23,11 @@ std::shared_ptr SparseConvTranspose::clone_with_new_inputs(const ov::O } bool SparseConvTranspose::evaluate(ov::TensorVector& outputs, const ov::TensorVector& inputs) const { - const float* features = reinterpret_cast(inputs[0].data()); - const float* inpPos = reinterpret_cast(inputs[1].data()); - const float* outPos = reinterpret_cast(inputs[2].data()); - const float* kernel = reinterpret_cast(inputs[3].data()); - const float* offset = reinterpret_cast(inputs[4].data()); + const float *features = reinterpret_cast(inputs[0].data()); + const float *inpPos = reinterpret_cast(inputs[1].data()); + const float *outPos = reinterpret_cast(inputs[2].data()); + const float *kernel = reinterpret_cast(inputs[3].data()); + const float *offset = reinterpret_cast(inputs[4].data()); float* out = reinterpret_cast(outputs[0].data()); memset(out, 0, outputs[0].get_byte_size()); From 4d791d6b190a772df36d4813104a06fc7a260474 Mon Sep 17 00:00:00 2001 From: "Raasz, Pawel" Date: Thu, 20 Mar 2025 13:29:10 +0000 Subject: [PATCH 2/8] Experiment with action cache Signed-off-by: Raasz, Pawel --- .github/workflows/linux.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 74a154ea6..96a62138a 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -99,7 +99,7 @@ jobs: run: python3 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt - name: Setup ccache - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + uses: actions/cache@v4 # v4.0.2 with: # Should save cache only if run in the master branch of the base repo # github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push @@ -156,7 +156,7 @@ jobs: run: | source ${INSTALL_DIR}/setupvars.sh gradle clean build --info - + for d in CPU HETERO:CPU; do gradle test -Prun_tests -DMODELS_PATH=${TEST_DATA} -Ddevice=$d --info; done @@ -177,7 +177,7 @@ jobs: pushd ${INSTALL_DIR} tar -czvf ${BUILD_DIR}/openvino_package.tar.gz * popd - + pushd ${DEVELOPER_PACKAGE_DIR} tar -czvf ${BUILD_DIR}/openvino_developer_package.tar.gz * popd @@ -265,7 +265,7 @@ jobs: pushd ${INSTALL_DIR} tar -xzf openvino_package.tar.gz -C ${INSTALL_DIR} popd - + pushd ${INSTALL_DIR} tar -xzf openvino_developer_package.tar.gz -C ${INSTALL_DIR} popd @@ -285,7 +285,7 @@ jobs: apt -y --no-install-recommends install software-properties-common curl - name: Setup ccache - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + uses: actions/cache@v4 with: # Should save cache only if run in the master branch of the base repo # github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push From 5726348a2843f84aff621d1ee8c96a19865a76b1 Mon Sep 17 00:00:00 2001 From: "Raasz, Pawel" Date: Thu, 20 Mar 2025 13:31:23 +0000 Subject: [PATCH 3/8] Update actions cache for mac and windows Signed-off-by: Raasz, Pawel --- .github/workflows/linux.yml | 2 +- .github/workflows/mac.yml | 2 +- .github/workflows/windows.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 96a62138a..69ec761aa 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -99,7 +99,7 @@ jobs: run: python3 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt - name: Setup ccache - uses: actions/cache@v4 # v4.0.2 + uses: actions/cache@v4 with: # Should save cache only if run in the master branch of the base repo # github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 000ca2e1e..86780f66e 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -84,7 +84,7 @@ jobs: # - name: Setup ccache - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + uses: actions/cache@v4 with: # Should save cache only if run in the master branch of the base repo # github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1ca03cb70..f6fcfc75d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -110,7 +110,7 @@ jobs: Add-Content -Path $env:GITHUB_PATH -Value "C:\ccache" - name: Setup ccache - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + uses: actions/cache@v4 with: # Should save cache only if run in the master branch of the base repo # github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push From 14bfecc3a0253ccb1c28c7cfed5ad56a563fdd4e Mon Sep 17 00:00:00 2001 From: "Raasz, Pawel" Date: Thu, 20 Mar 2025 15:38:19 +0000 Subject: [PATCH 4/8] Update java test Signed-off-by: Raasz, Pawel --- .../src/test/java/org/intel/openvino/CompiledModelTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/java_api/src/test/java/org/intel/openvino/CompiledModelTests.java b/modules/java_api/src/test/java/org/intel/openvino/CompiledModelTests.java index ce978ac4d..d3d6c2d41 100644 --- a/modules/java_api/src/test/java/org/intel/openvino/CompiledModelTests.java +++ b/modules/java_api/src/test/java/org/intel/openvino/CompiledModelTests.java @@ -34,7 +34,7 @@ public void testOutputs() { List outputs = model.outputs(); assertEquals("fc_out", outputs.get(0).get_any_name()); - assertEquals(ElementType.f32, outputs.get(0).get_element_type()); + assertEquals(ElementType.f16, outputs.get(0).get_element_type()); int[] shape = new int[] {1, 10}; assertArrayEquals("Shape", shape, outputs.get(0).get_shape()); From 7db1ff61d5c8465ce4a9520eb7e12ab64051872e Mon Sep 17 00:00:00 2001 From: "Raasz, Pawel" Date: Thu, 20 Mar 2025 16:24:32 +0000 Subject: [PATCH 5/8] Update java tests Signed-off-by: Raasz, Pawel --- .../src/test/java/org/intel/openvino/CompiledModelTests.java | 2 +- .../java_api/src/test/java/org/intel/openvino/ModelTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/java_api/src/test/java/org/intel/openvino/CompiledModelTests.java b/modules/java_api/src/test/java/org/intel/openvino/CompiledModelTests.java index d3d6c2d41..b85e9b1c9 100644 --- a/modules/java_api/src/test/java/org/intel/openvino/CompiledModelTests.java +++ b/modules/java_api/src/test/java/org/intel/openvino/CompiledModelTests.java @@ -23,7 +23,7 @@ public void testInputs() { List inputs = model.inputs(); assertEquals("data", inputs.get(0).get_any_name()); - assertEquals(ElementType.f32, inputs.get(0).get_element_type()); + assertEquals(ElementType.f16, inputs.get(0).get_element_type()); int[] shape = new int[] {1, 3, 32, 32}; assertArrayEquals("Shape", shape, inputs.get(0).get_shape()); diff --git a/modules/java_api/src/test/java/org/intel/openvino/ModelTests.java b/modules/java_api/src/test/java/org/intel/openvino/ModelTests.java index bb0ce5be7..afd46f5f3 100644 --- a/modules/java_api/src/test/java/org/intel/openvino/ModelTests.java +++ b/modules/java_api/src/test/java/org/intel/openvino/ModelTests.java @@ -34,7 +34,7 @@ public void testOutputName() { @Test public void testOutputType() { Output output = net.output(); - assertEquals("Output element type", ElementType.f32, output.get_element_type()); + assertEquals("Output element type", ElementType.f16, output.get_element_type()); } @Test From 9d9bc72166e804c964b823dec8c33304cb308429 Mon Sep 17 00:00:00 2001 From: "Raasz, Pawel" Date: Fri, 21 Mar 2025 08:16:16 +0000 Subject: [PATCH 6/8] Update code style Signed-off-by: Raasz, Pawel --- .github/workflows/code_style.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml index 3062416cb..eb59f75c9 100644 --- a/.github/workflows/code_style.yml +++ b/.github/workflows/code_style.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - name: Fix code java style - uses: axel-op/googlejavaformat-action@dbff853fb823671ec5781365233bf86543b13215 # v3 + uses: axel-op/googlejavaformat-action@v4 with: args: "--set-exit-if-changed -a -i" commit-message: "[github actions] Apply google-java-format code style fixes" From b0f3d6d78078a6c5215025b8d28df525d4009656 Mon Sep 17 00:00:00 2001 From: "Raasz, Pawel" Date: Fri, 21 Mar 2025 08:26:18 +0000 Subject: [PATCH 7/8] Update code_style flow Signed-off-by: Raasz, Pawel --- .github/workflows/code_style.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml index eb59f75c9..ba52357a4 100644 --- a/.github/workflows/code_style.yml +++ b/.github/workflows/code_style.yml @@ -20,4 +20,6 @@ jobs: uses: axel-op/googlejavaformat-action@v4 with: args: "--set-exit-if-changed -a -i" - commit-message: "[github actions] Apply google-java-format code style fixes" + skip-commit: true + - name: Print diffs + run: git --no-pager diff --exit-code From 3c4433992b4af72f8e8c39598de1e78cdad9915d Mon Sep 17 00:00:00 2001 From: "Raasz, Pawel" Date: Fri, 21 Mar 2025 08:28:41 +0000 Subject: [PATCH 8/8] Restore code style flow Signed-off-by: Raasz, Pawel --- .github/workflows/code_style.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml index ba52357a4..3062416cb 100644 --- a/.github/workflows/code_style.yml +++ b/.github/workflows/code_style.yml @@ -17,9 +17,7 @@ jobs: - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - name: Fix code java style - uses: axel-op/googlejavaformat-action@v4 + uses: axel-op/googlejavaformat-action@dbff853fb823671ec5781365233bf86543b13215 # v3 with: args: "--set-exit-if-changed -a -i" - skip-commit: true - - name: Print diffs - run: git --no-pager diff --exit-code + commit-message: "[github actions] Apply google-java-format code style fixes"