Skip to content

Commit

Permalink
[CI] [GHA] Enable testing of Python 3.12 on Ubuntu 24 (#26466)
Browse files Browse the repository at this point in the history
### Tickets:
 - *151255*

---------

Co-authored-by: Anastasia Kuporosova <anastasia.kuporosova@intel.com>
  • Loading branch information
akashchi and akuporos authored Sep 12, 2024
1 parent deb702e commit 3f0bd0f
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 12 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/job_python_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ on:
description: 'Components that are affected by changes in the commit defined by the Smart CI Action'
type: string
required: true
python-version:
description: 'Python version to setup. E.g., "3.11"'
type: string
required: true

permissions: read-all

env:
PIP_CACHE_PATH: /mount/caches/pip/linux
PYTHON_VERSION: '3.11'

jobs:
Python_Unit_Tests:
Expand Down Expand Up @@ -77,10 +80,10 @@ jobs:
sparse-checkout-cone-mode: false
path: 'action_root'

- name: Setup Python ${{ env.PYTHON_VERSION }}
- name: Setup Python ${{ inputs.python-version }}
uses: ./action_root/.github/actions/setup_python
with:
version: ${{ env.PYTHON_VERSION }}
version: ${{ inputs.python-version }}
pip-cache-path: ${{ runner.os == 'Linux' && env.PIP_CACHE_PATH || '' }}
should-setup-pip-paths: ${{ runner.os == 'Linux' }}
self-hosted-runner: ${{ runner.os == 'Linux' }}
Expand Down Expand Up @@ -231,7 +234,7 @@ jobs:
PYTORCH_TRACING_MODE: TORCHFX

- name: ONNX Layer Tests
if: fromJSON(inputs.affected-components).ONNX_FE.test
if: ${{ fromJSON(inputs.affected-components).ONNX_FE.test }}
run: |
# requires 'unit_tests' from 'tools/mo'
export PYTHONPATH=${INSTALL_TEST_DIR}/mo:$PYTHONPATH
Expand Down Expand Up @@ -296,7 +299,7 @@ jobs:
python3 ${OPENVINO_REPO}/docs/articles_en/assets/snippets/main.py
- name: Python API Tests -- numpy>=2.0.0
if: ${{ fromJSON(inputs.affected-components).Python_API.test }}
if: ${{ fromJSON(inputs.affected-components).Python_API.test && inputs.python-version != '3.12' }} # Ticket: 152242
run: |
python3 -m pip uninstall -y numpy
python3 -m pip install "numpy>=2.0.0,<2.1.0"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ permissions: read-all

env:
PIP_CACHE_PATH: /mount/caches/pip/linux
PYTHON_VERSION: '3.11'

jobs:
Smart_CI:
Expand Down Expand Up @@ -388,6 +387,7 @@ jobs:
runner: 'aks-linux-16-cores-arm'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_20_04_arm64 }}", "volumes": ["/mount:/mount"]}'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.11'

TensorFlow_Layer_Tests:
name: TensorFlow Layer Tests
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ jobs:
with:
runner: 'macos-13'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.11'

TensorFlow_Layer_Tests:
name: TensorFlow Layer Tests
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mac_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ jobs:
with:
runner: 'macos-13-xlarge'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.11'

TensorFlow_Layer_Tests:
name: TensorFlow Layer Tests
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ubuntu_22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ jobs:
runner: 'aks-linux-4-cores-16gb'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_x64 }}", "volumes": ["/mount:/mount"]}'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.11'

TensorFlow_Layer_Tests:
name: TensorFlow Layer Tests
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/ubuntu_24.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ permissions: read-all

env:
PIP_CACHE_PATH: /mount/caches/pip/linux
PYTHON_VERSION: '3.11'

jobs:
Smart_CI:
Expand Down Expand Up @@ -115,9 +114,19 @@ jobs:
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64 }}", "volumes": ["/mount:/mount"]}'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}

Python_Unit_Tests:
name: Python unit tests
needs: [ Docker, Build, Smart_CI ]
uses: ./.github/workflows/job_python_unit_tests.yml
with:
runner: 'aks-linux-4-cores-16gb'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64 }}", "volumes": ["/mount:/mount"]}'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.12'

Overall_Status:
name: ci/gha_overall_status_ubuntu_24
needs: [Smart_CI, Build, Debian_Packages, Samples]
needs: [Smart_CI, Build, Debian_Packages, Samples, Python_Unit_Tests]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
Expand Down
17 changes: 16 additions & 1 deletion tests/layer_tests/ovc_python_api_tests/test_ovc_cli_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ def test_ovc_tool_output_dir(self):
flag, msg = compare_functions(ov_model, create_ref_graph(), False)
assert flag, msg

@unittest.skipIf(
(sys.version_info[0], sys.version_info[1]) == (3, 12),
'Ticket: 152216'
)
def test_ovc_tool_saved_model_dir(self):
from openvino.runtime import Core
core = Core()
Expand All @@ -154,6 +158,10 @@ def test_ovc_tool_saved_model_dir(self):
flag, msg = compare_functions(ov_model, ref_model, False)
assert flag, msg

@unittest.skipIf(
(sys.version_info[0], sys.version_info[1]) == (3, 12),
'Ticket: 152216'
)
def test_ovc_tool_saved_model_dir_with_sep_at_path_end(self):
from openvino.runtime import Core
core = Core()
Expand All @@ -167,6 +175,10 @@ def test_ovc_tool_saved_model_dir_with_sep_at_path_end(self):
flag, msg = compare_functions(ov_model, ref_model, False)
assert flag, msg

@unittest.skipIf(
(sys.version_info[0], sys.version_info[1]) == (3, 12),
'Ticket: 152216'
)
def test_ovc_tool_non_existng_output_dir(self):
from openvino.runtime import Core
core = Core()
Expand All @@ -180,7 +192,10 @@ def test_ovc_tool_non_existng_output_dir(self):
flag, msg = compare_functions(ov_model, ref_model, False)
assert flag, msg


@unittest.skipIf(
(sys.version_info[0], sys.version_info[1]) == (3, 12),
'Ticket: 152216'
)
def test_ovc_tool_verbose(self):
from openvino.runtime import Core
core = Core()
Expand Down
9 changes: 9 additions & 0 deletions tests/layer_tests/ovc_python_api_tests/test_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import numpy as np
import openvino.runtime as ov
import os
import sys
import pytest
import tempfile
import tensorflow as tf
Expand Down Expand Up @@ -731,6 +732,10 @@ def test_mo_import_from_memory_tf_fe(self, create_model, ie_device, precision, i

@pytest.mark.nightly
@pytest.mark.precommit
@pytest.mark.skipif(
condition=(sys.version_info[0], sys.version_info[1]) == (3, 12),
reason='Ticket: 152216'
)
def test_unnamed_saved_model_dir(self, ie_device, precision, ir_version, temp_dir):
saved_model_dir, graph_ref = create_tf_saved_model_dir(temp_dir)

Expand Down Expand Up @@ -1148,6 +1153,10 @@ def test_tf1_from_memory_single_tensor_name(self):

@pytest.mark.nightly
@pytest.mark.precommit
@pytest.mark.skipif(
condition=(sys.version_info[0], sys.version_info[1]) == (3, 12),
reason='Ticket: 152216'
)
def test_tf2_from_file_single_tensor_name(self):
tf.keras.backend.clear_session()
tf.compat.v1.reset_default_graph()
Expand Down
6 changes: 3 additions & 3 deletions tools/mo/unit_tests/mo/ops/elementwise_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def test_first_input_const(self):

type_infer(graph)
const_node = Node(graph, 'const')
self.assertEquals(const_node.out_port(0).get_data_type(), np.float32)
self.assertEqual(const_node.out_port(0).get_data_type(), np.float32)

def test_second_input_const(self):
edges = [
Expand All @@ -126,7 +126,7 @@ def test_second_input_const(self):

type_infer(graph)
const_node = Node(graph, 'const')
self.assertEquals(const_node.out_port(0).get_data_type(), np.float32)
self.assertEqual(const_node.out_port(0).get_data_type(), np.float32)

def test_raises(self):
edges = [
Expand All @@ -148,4 +148,4 @@ def test_not_raises(self):

type_infer(graph)
add_node = Node(graph, 'add')
self.assertEquals(add_node.out_port(0).get_data_type(), np.float32)
self.assertEqual(add_node.out_port(0).get_data_type(), np.float32)

0 comments on commit 3f0bd0f

Please sign in to comment.