From 09be114258aa74791594a734c0912058abd0f8e5 Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Wed, 13 Nov 2024 01:26:11 +0200 Subject: [PATCH 01/15] test install --- .github/workflows/install.yml | 78 +++++++++++++++++++++++++++++++++ .github/workflows/precommit.yml | 4 +- 2 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/install.yml diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml new file mode 100644 index 00000000000..e0d19f40174 --- /dev/null +++ b/.github/workflows/install.yml @@ -0,0 +1,78 @@ +name: Test install +permissions: read-all + +on: + pull_request: ## TODO: remove + +jobs: + install-cpu: + name: Test install [${{ matrix.backend }}] + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + backend: ["torch", "tf", "onnx", "openvino"] + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + with: + lfs: true + fetch-depth: 0 # Fetch full history to allow checking out any branch or PR + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 + with: + python-version: 3.10.14 + cache: pip + - name: Install NNCF and test requirements + run: | + pip install -e . + pip install -r tests/cross_fw/examples/requirements.txt + - name: Print installed modules + run: pip list + - name: Run examples test scope + run: pytest tests/cross_fw/install -s --host-configuration cpu --backend ${{ matrix.backend }} + + install-torch-gpu: + name: Test install [torch-gpu] + defaults: + run: + shell: bash + runs-on: aks-linux-4-cores-28gb-gpu-tesla-t4 + env: + DEBIAN_FRONTEND: noninteractive + steps: + - name: Install dependencies + run : | + sudo apt-get update + sudo apt-get --assume-yes install build-essential ninja-build libgl1-mesa-dev libglib2.0-0 wget make + - name: Download CUDA + run: | + wget -q https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_550.54.14_linux.run + sudo sh cuda_12.4.0_550.54.14_linux.run --toolkit --silent + - name: Runner info + continue-on-error: true + run: | + export PATH=/usr/local/cuda-12.4/bin${PATH:+:${PATH}} + export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} + nvidia-smi + cat /proc/cpuinfo + nvcc --version + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + with: + lfs: true + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 + with: + python-version: 3.10.14 + cache: pip + - name: Install NNCF and test requirements + run: | + pip install -e . + pip install -r tests/cross_fw/examples/requirements.txt + - name: Print installed modules + run: pip list + - name: Run PyTorch precommit test scope + run: | + export PATH=/usr/local/cuda-12.4/bin${PATH:+:${PATH}} + export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} + pytest tests/cross_fw/install -s --host-configuration gpu --backend torch diff --git a/.github/workflows/precommit.yml b/.github/workflows/precommit.yml index 6dd6bff293d..70e58cd68c2 100644 --- a/.github/workflows/precommit.yml +++ b/.github/workflows/precommit.yml @@ -4,9 +4,9 @@ permissions: read-all on: pull_request: types: - - opened + # - opened - reopened - - synchronize + # - synchronize paths-ignore: - '**/*.md' - 'docs/**/*' From 4be264d2c45e836adf2e09159432151d50b0eb99 Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Wed, 13 Nov 2024 01:43:55 +0200 Subject: [PATCH 02/15] 8-cores --- .github/workflows/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index e0d19f40174..3aa016f7e0c 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -7,7 +7,7 @@ on: jobs: install-cpu: name: Test install [${{ matrix.backend }}] - runs-on: ubuntu-22.04 + runs-on: ubuntu-22.04-8-cores strategy: fail-fast: false matrix: From 14ca5e26de319f55706e79e32212f387aa53d67d Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Wed, 13 Nov 2024 02:19:35 +0200 Subject: [PATCH 03/15] not virtualenv --- .github/workflows/install.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 3aa016f7e0c..f7bd91eb352 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -31,7 +31,7 @@ jobs: - name: Print installed modules run: pip list - name: Run examples test scope - run: pytest tests/cross_fw/install -s --host-configuration cpu --backend ${{ matrix.backend }} + run: pytest tests/cross_fw/install -s --host-configuration cpu --backend ${{ matrix.backend }} -k "not virtualenv" install-torch-gpu: name: Test install [torch-gpu] @@ -45,7 +45,7 @@ jobs: - name: Install dependencies run : | sudo apt-get update - sudo apt-get --assume-yes install build-essential ninja-build libgl1-mesa-dev libglib2.0-0 wget make + sudo apt-get --assume-yes install build-essential ninja-build libgl1-mesa-dev libglib2.0-0 wget make virtualenv - name: Download CUDA run: | wget -q https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_550.54.14_linux.run @@ -75,4 +75,4 @@ jobs: run: | export PATH=/usr/local/cuda-12.4/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} - pytest tests/cross_fw/install -s --host-configuration gpu --backend torch + pytest tests/cross_fw/install -s --host-configuration gpu --backend torch -k "not virtualenv" From 92ba9af03ca02acdab83ece43f673e1db498e8df Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Wed, 13 Nov 2024 02:53:18 +0200 Subject: [PATCH 04/15] ubuntu-22.04 --- .github/workflows/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index f7bd91eb352..f815b5e64c4 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -7,7 +7,7 @@ on: jobs: install-cpu: name: Test install [${{ matrix.backend }}] - runs-on: ubuntu-22.04-8-cores + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: From c75c7bcdf487aa6c32fc6895757f006d1b90a6ae Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Wed, 13 Nov 2024 03:03:48 +0200 Subject: [PATCH 05/15] Revert "ubuntu-22.04" This reverts commit 92ba9af03ca02acdab83ece43f673e1db498e8df. --- .github/workflows/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index f815b5e64c4..f7bd91eb352 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -7,7 +7,7 @@ on: jobs: install-cpu: name: Test install [${{ matrix.backend }}] - runs-on: ubuntu-22.04 + runs-on: ubuntu-22.04-8-cores strategy: fail-fast: false matrix: From 24406f78a7ede33b575b6f27e2d60e5c350ccec2 Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Wed, 13 Nov 2024 03:13:32 +0200 Subject: [PATCH 06/15] trigger --- .github/workflows/install.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index f7bd91eb352..c3e9f23ef6b 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -2,7 +2,14 @@ name: Test install permissions: read-all on: - pull_request: ## TODO: remove + workflow_dispatch: + push: + branches: + - develop + - release_v* + paths-ignore: + - '**/*.md' + - 'docs/**/*' jobs: install-cpu: From 876535a3651ec757c97bc8a3cd5a8d34ac1c2b4d Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Wed, 13 Nov 2024 03:16:57 +0200 Subject: [PATCH 07/15] revert --- .github/workflows/precommit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/precommit.yml b/.github/workflows/precommit.yml index 70e58cd68c2..6dd6bff293d 100644 --- a/.github/workflows/precommit.yml +++ b/.github/workflows/precommit.yml @@ -4,9 +4,9 @@ permissions: read-all on: pull_request: types: - # - opened + - opened - reopened - # - synchronize + - synchronize paths-ignore: - '**/*.md' - 'docs/**/*' From 6c145a2a97ca94908dcabce6470ef558c20aacf9 Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Wed, 13 Nov 2024 16:43:21 +0200 Subject: [PATCH 08/15] clean --- .github/workflows/install.yml | 7 ++-- tests/cross_fw/install/test_install.py | 49 +++++++------------------- 2 files changed, 16 insertions(+), 40 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index c3e9f23ef6b..b78b0464240 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -2,6 +2,7 @@ name: Test install permissions: read-all on: + pull_request: # remove workflow_dispatch: push: branches: @@ -14,7 +15,7 @@ on: jobs: install-cpu: name: Test install [${{ matrix.backend }}] - runs-on: ubuntu-22.04-8-cores + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -38,7 +39,7 @@ jobs: - name: Print installed modules run: pip list - name: Run examples test scope - run: pytest tests/cross_fw/install -s --host-configuration cpu --backend ${{ matrix.backend }} -k "not virtualenv" + run: pytest tests/cross_fw/install -s --host-configuration cpu --backend ${{ matrix.backend }} install-torch-gpu: name: Test install [torch-gpu] @@ -82,4 +83,4 @@ jobs: run: | export PATH=/usr/local/cuda-12.4/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} - pytest tests/cross_fw/install -s --host-configuration gpu --backend torch -k "not virtualenv" + pytest tests/cross_fw/install -s --host-configuration gpu --backend torch diff --git a/tests/cross_fw/install/test_install.py b/tests/cross_fw/install/test_install.py index 7d43a71df82..d5b78ec7ef0 100644 --- a/tests/cross_fw/install/test_install.py +++ b/tests/cross_fw/install/test_install.py @@ -18,8 +18,6 @@ import pytest import nncf -from nncf.common.utils.os import is_linux -from nncf.common.utils.os import is_windows from tests.cross_fw.install.conftest import TESTED_BACKENDS from tests.cross_fw.shared.case_collection import skip_if_backend_not_selected from tests.cross_fw.shared.helpers import create_venv_with_nncf @@ -69,16 +67,17 @@ def find_file_by_extension(directory: Path, extension: str) -> str: ) -@pytest.fixture(name="venv_type", params=["virtualenv", "venv"]) -def venv_type_(request): +@pytest.fixture(name="package_type", params=["pip_local", "pip_git_develop", "pip_pypi", "build_s", "build_w"]) +def package_type_(request): return request.param -@pytest.fixture( - name="package_type", params=["pip_local", "pip_e_local", "pip_git_develop", "pip_pypi", "build_s", "build_w"] -) -def package_type_(request): - return request.param +@pytest.fixture +def removable_tmp_path(tmp_path: Path): + # The default tmp_path is automatically removed after some time, + # but we need to remove the venv after each test to avoid exceeding the space limit. + yield tmp_path + shutil.rmtree(tmp_path) @pytest.fixture(name="backend_to_test") @@ -96,9 +95,8 @@ def backend_to_test_(request, backend_clopt: List[str]): class TestInstall: @staticmethod def test_install( - tmp_path: Path, + removable_tmp_path: Path, backend: str, - venv_type: str, package_type: str, backend_clopt: List[str], host_configuration_clopt: str, @@ -107,34 +105,11 @@ def test_install( skip_if_backend_not_selected(backend, backend_clopt) if "pypi" in package_type: pytest.xfail("Disabled until NNCF is exposed in a release") - venv_path = create_venv_with_nncf(tmp_path, package_type, venv_type, {backend}) + venv_path = create_venv_with_nncf(removable_tmp_path, package_type, "venv", {backend}) if ov_version_override is not None: pip_with_venv = get_pip_executable_with_venv(venv_path) ov_version_cmd_line = f"{pip_with_venv} install {ov_version_override}" subprocess.run(ov_version_cmd_line, check=True, shell=True) - run_install_checks(venv_path, tmp_path, package_type, backend=backend, install_type=host_configuration_clopt) - - @staticmethod - def test_install_with_tests_requirements( - tmp_path: Path, - backend: str, - venv_type: str, - package_type: str, - backend_clopt: List[str], - host_configuration_clopt: str, - ): - skip_if_backend_not_selected(backend, backend_clopt) - if "pypi" in package_type: - pytest.xfail("Disabled until NNCF is exposed in a release") - venv_path = create_venv_with_nncf(tmp_path, package_type, venv_type, backends={backend}) - - if is_linux(): - pip_with_venv = f". {venv_path}/bin/activate && {venv_path}/bin/pip" - elif is_windows(): - pip_with_venv = f" {venv_path}\\Scripts\\activate && python -m pip" - - backend_name = "tensorflow" if backend == "tf" else backend - subprocess.check_call( - f"{pip_with_venv} install -r {PROJECT_ROOT}/tests/{backend_name}/requirements.txt", shell=True + run_install_checks( + venv_path, removable_tmp_path, package_type, backend=backend, install_type=host_configuration_clopt ) - run_install_checks(venv_path, tmp_path, package_type, backend=backend, install_type=host_configuration_clopt) From 3129cde04a782b4efd14d633e2f3b3ea084adaf7 Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Wed, 13 Nov 2024 17:09:53 +0200 Subject: [PATCH 09/15] ra --- .github/workflows/install.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index b78b0464240..17033d730f3 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -38,8 +38,8 @@ jobs: pip install -r tests/cross_fw/examples/requirements.txt - name: Print installed modules run: pip list - - name: Run examples test scope - run: pytest tests/cross_fw/install -s --host-configuration cpu --backend ${{ matrix.backend }} + - name: Run install test scope + run: pytest tests/cross_fw/install -rA -s --host-configuration cpu --backend ${{ matrix.backend }} install-torch-gpu: name: Test install [torch-gpu] @@ -79,8 +79,8 @@ jobs: pip install -r tests/cross_fw/examples/requirements.txt - name: Print installed modules run: pip list - - name: Run PyTorch precommit test scope + - name: Run install test scope run: | export PATH=/usr/local/cuda-12.4/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} - pytest tests/cross_fw/install -s --host-configuration gpu --backend torch + pytest tests/cross_fw/install -rA -s --host-configuration gpu --backend torch From e9df6b0d63d59d3df243d9c651f60ad1fbf3d756 Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Wed, 13 Nov 2024 17:50:21 +0200 Subject: [PATCH 10/15] cl --- .github/workflows/install.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 17033d730f3..11a93cc86b4 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -2,7 +2,6 @@ name: Test install permissions: read-all on: - pull_request: # remove workflow_dispatch: push: branches: From 8651188a894c6f14f82860c2175721c999dd09d3 Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Wed, 13 Nov 2024 17:58:50 +0200 Subject: [PATCH 11/15] pr --- .github/workflows/install.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 11a93cc86b4..bee9b1f6240 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -3,6 +3,10 @@ permissions: read-all on: workflow_dispatch: + inputs: + pull_request_number: + description: 'The pull request number' + default: '' push: branches: - develop @@ -27,6 +31,11 @@ jobs: with: lfs: true fetch-depth: 0 # Fetch full history to allow checking out any branch or PR + - name: Fetch and Checkout the Pull Request Branch + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.pull_request_number != '' }} + run: | + git fetch origin pull/${{ github.event.inputs.pull_request_number }}/head:pr-${{ github.event.inputs.pull_request_number }} + git checkout pr-${{ github.event.inputs.pull_request_number }} - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 with: python-version: 3.10.14 @@ -68,6 +77,11 @@ jobs: - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 with: lfs: true + - name: Fetch and Checkout the Pull Request Branch + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.pull_request_number != '' }} + run: | + git fetch origin pull/${{ github.event.inputs.pull_request_number }}/head:pr-${{ github.event.inputs.pull_request_number }} + git checkout pr-${{ github.event.inputs.pull_request_number }} - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 with: python-version: 3.10.14 From 2c7fcbef55c29806ddb3dd7913ecbf3e0fca7b9e Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Mon, 25 Nov 2024 04:08:56 +0200 Subject: [PATCH 12/15] win --- .github/workflows/install.yml | 58 ++++++++++++++++++++++---- .github/workflows/precommit.yml | 1 + tests/cross_fw/install/test_install.py | 21 +--------- tests/cross_fw/shared/helpers.py | 37 +++++++++++++--- 4 files changed, 82 insertions(+), 35 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index bee9b1f6240..07d6e3402b9 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -7,13 +7,16 @@ on: pull_request_number: description: 'The pull request number' default: '' - push: - branches: - - develop - - release_v* + pull_request: + types: + - opened + - reopened + - synchronize paths-ignore: + - '*' # TODO: remove - '**/*.md' - 'docs/**/*' + - 'tests/*' jobs: install-cpu: @@ -40,14 +43,17 @@ jobs: with: python-version: 3.10.14 cache: pip - - name: Install NNCF and test requirements + - name: Install test requirements run: | - pip install -e . pip install -r tests/cross_fw/examples/requirements.txt - name: Print installed modules run: pip list - - name: Run install test scope + - name: Run install test scope (all) + if: github.event_name != 'pull_request' run: pytest tests/cross_fw/install -rA -s --host-configuration cpu --backend ${{ matrix.backend }} + - name: Run install test scope (fast) + if: github.event_name == 'pull_request' + run: pytest tests/cross_fw/install -rA -s --host-configuration cpu --backend ${{ matrix.backend }} -k build_w install-torch-gpu: name: Test install [torch-gpu] @@ -55,6 +61,7 @@ jobs: run: shell: bash runs-on: aks-linux-4-cores-28gb-gpu-tesla-t4 + if: github.event_name != 'pull_request' env: DEBIAN_FRONTEND: noninteractive steps: @@ -86,9 +93,8 @@ jobs: with: python-version: 3.10.14 cache: pip - - name: Install NNCF and test requirements + - name: Install test requirements run: | - pip install -e . pip install -r tests/cross_fw/examples/requirements.txt - name: Print installed modules run: pip list @@ -97,3 +103,37 @@ jobs: export PATH=/usr/local/cuda-12.4/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} pytest tests/cross_fw/install -rA -s --host-configuration gpu --backend torch + + install-cpu-win: + name: Test install windows [${{ matrix.backend }}] + runs-on: windows-latest + # TODO: != + if: github.event_name == 'pull_request' + strategy: + fail-fast: false + matrix: + backend: ["torch", "tf", "onnx", "openvino"] + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + with: + lfs: true + fetch-depth: 0 # Fetch full history to allow checking out any branch or PR + - name: Fetch and Checkout the Pull Request Branch + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.pull_request_number != '' }} + run: | + git fetch origin pull/${{ github.event.inputs.pull_request_number }}/head:pr-${{ github.event.inputs.pull_request_number }} + git checkout pr-${{ github.event.inputs.pull_request_number }} + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 + with: + python-version: 3.10 + cache: pip + - name: Install test requirements + run: | + pip install -r tests/cross_fw/examples/requirements.txt + - name: Print installed modules + run: pip list + - name: Run install test scope (all) + run: pytest tests/cross_fw/install -rA -s --host-configuration cpu --backend ${{ matrix.backend }} diff --git a/.github/workflows/precommit.yml b/.github/workflows/precommit.yml index 6dd6bff293d..16e84857fa2 100644 --- a/.github/workflows/precommit.yml +++ b/.github/workflows/precommit.yml @@ -8,6 +8,7 @@ on: - reopened - synchronize paths-ignore: + - '*' # TODO: remove - '**/*.md' - 'docs/**/*' - 'tests/post_training/*' # post_training tests runs on Jenkins diff --git a/tests/cross_fw/install/test_install.py b/tests/cross_fw/install/test_install.py index d5b78ec7ef0..e335c357c67 100644 --- a/tests/cross_fw/install/test_install.py +++ b/tests/cross_fw/install/test_install.py @@ -17,7 +17,6 @@ import pytest -import nncf from tests.cross_fw.install.conftest import TESTED_BACKENDS from tests.cross_fw.shared.case_collection import skip_if_backend_not_selected from tests.cross_fw.shared.helpers import create_venv_with_nncf @@ -29,27 +28,9 @@ def run_install_checks(venv_path: Path, tmp_path: Path, package_type: str, backend: str, install_type: str): if install_type.lower() not in ["cpu", "gpu"]: - raise nncf.ValidationError("Unknown installation mode - must be either 'cpu' or 'gpu'") + raise ValueError("Unknown installation mode - must be either 'cpu' or 'gpu'") python_executable_with_venv = get_python_executable_with_venv(venv_path) - pip_with_venv = get_pip_executable_with_venv(venv_path) - - if package_type in ["build_s", "build_w"]: - # Do additional install step for sdist/bdist packages - def find_file_by_extension(directory: Path, extension: str) -> str: - for file_path in directory.iterdir(): - file_path_str = str(file_path) - if file_path_str.endswith(extension): - return file_path_str - raise FileNotFoundError("NNCF package not found") - - if package_type == "build_s": - package_path = find_file_by_extension(PROJECT_ROOT / "dist", ".tar.gz") - elif package_type == "build_w": - package_path = find_file_by_extension(PROJECT_ROOT / "dist", ".whl") - - run_cmd_line = f"{pip_with_venv} install {package_path}" - subprocess.run(run_cmd_line, check=True, shell=True) run_path = tmp_path / "run" install_checks_py_name = f"install_checks_{backend}.py" diff --git a/tests/cross_fw/shared/helpers.py b/tests/cross_fw/shared/helpers.py index 1b9b9ef2d66..2f56d36cc6f 100644 --- a/tests/cross_fw/shared/helpers.py +++ b/tests/cross_fw/shared/helpers.py @@ -19,15 +19,20 @@ import numpy as np -import nncf -from nncf.common.utils.os import is_linux -from nncf.common.utils.os import is_windows from tests.cross_fw.shared.paths import GITHUB_REPO_URL from tests.cross_fw.shared.paths import PROJECT_ROOT TensorType = TypeVar("TensorType") +def is_windows() -> bool: + return "win32" in sys.platform + + +def is_linux() -> bool: + return "linux" in sys.platform + + def get_cli_dict_args(args): cli_args = {} for key, val in args.items(): @@ -46,6 +51,14 @@ def get_cli_dict_args(args): } +def find_file_by_extension(directory: Path, extension: str) -> str: + for file_path in directory.iterdir(): + file_path_str = str(file_path) + if file_path_str.endswith(extension): + return file_path_str + raise FileNotFoundError("NNCF package not found") + + def create_venv_with_nncf(tmp_path: Path, package_type: str, venv_type: str, backends: Set[str] = None): venv_path = tmp_path / "venv" venv_path.mkdir() @@ -70,6 +83,12 @@ def create_venv_with_nncf(tmp_path: Path, package_type: str, venv_type: str, bac run_path = tmp_path / "run" run_path.mkdir() + if package_type in ["build_s", "build_w"]: + dist_path = tmp_path / "dist" + dist_path.mkdir(exist_ok=True) + build_path = tmp_path / "build" + build_path.mkdir(exist_ok=True) + if package_type == "pip_pypi": run_cmd_line = f"{pip_with_venv} install nncf" elif package_type == "pip_local": @@ -79,13 +98,19 @@ def create_venv_with_nncf(tmp_path: Path, package_type: str, venv_type: str, bac elif package_type == "pip_git_develop": run_cmd_line = f"{pip_with_venv} install git+{GITHUB_REPO_URL}@develop#egg=nncf" elif package_type == "build_s": - run_cmd_line = f"{python_executable_with_venv} -m build -s" + run_cmd_line = f"{python_executable_with_venv} -m build -s --outdir {dist_path}" elif package_type == "build_w": - run_cmd_line = f"{python_executable_with_venv} -m build -w" + run_cmd_line = f"{python_executable_with_venv} -m build -w --outdir {dist_path}" else: - raise nncf.ValidationError(f"Invalid package type: {package_type}") + raise ValueError(f"Invalid package type: {package_type}") subprocess.run(run_cmd_line, check=True, shell=True, cwd=PROJECT_ROOT) + + if package_type in ["build_s", "build_w"]: + package_path = find_file_by_extension(dist_path, ".tar.gz" if package_type == "build_s" else ".whl") + cmd_install_package = f"{pip_with_venv} install {package_path}" + subprocess.run(cmd_install_package, check=True, shell=True) + if backends: # Install backend specific packages with according version from constraints.txt packages = [item for b in backends for item in MAP_BACKEND_PACKAGES[b]] From b0aa54677c797e1035e781496be2b4ab98ae3321 Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Mon, 25 Nov 2024 04:49:20 +0200 Subject: [PATCH 13/15] split helper --- tests/cross_fw/examples/test_examples.py | 2 +- tests/cross_fw/shared/comparator.py | 92 +++++++++++++++ tests/cross_fw/shared/helpers.py | 107 +----------------- tests/cross_fw/shared/json.py | 39 +++++++ .../test_calculate_quantizer_parameters.py | 4 +- .../test_qdq_params_calculation.py | 4 +- .../test_fq_params_calculation.py | 4 +- .../quantization/test_weights_compression.py | 6 +- tests/tensorflow/helpers.py | 2 +- tests/torch/helpers.py | 2 +- tests/torch/ptq/test_fq_params_calculation.py | 4 +- tests/torch/test_dataset_generators.py | 2 +- 12 files changed, 147 insertions(+), 121 deletions(-) create mode 100644 tests/cross_fw/shared/comparator.py create mode 100644 tests/cross_fw/shared/json.py diff --git a/tests/cross_fw/examples/test_examples.py b/tests/cross_fw/examples/test_examples.py index 486a20aa45f..bbfe1cbe6ac 100644 --- a/tests/cross_fw/examples/test_examples.py +++ b/tests/cross_fw/examples/test_examples.py @@ -22,7 +22,7 @@ from tests.cross_fw.shared.helpers import create_venv_with_nncf from tests.cross_fw.shared.helpers import get_pip_executable_with_venv from tests.cross_fw.shared.helpers import get_python_executable_with_venv -from tests.cross_fw.shared.helpers import load_json +from tests.cross_fw.shared.json import load_json from tests.cross_fw.shared.paths import PROJECT_ROOT from tests.cross_fw.shared.paths import TEST_ROOT diff --git a/tests/cross_fw/shared/comparator.py b/tests/cross_fw/shared/comparator.py new file mode 100644 index 00000000000..a3378a6ecd2 --- /dev/null +++ b/tests/cross_fw/shared/comparator.py @@ -0,0 +1,92 @@ +# Copyright (c) 2024 Intel Corporation +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from abc import ABC +from abc import abstractmethod +from typing import Callable, Dict, List, TypeVar, Union + +import numpy as np + +TensorType = TypeVar("TensorType") + + +class BaseTensorListComparator(ABC): + @classmethod + @abstractmethod + def _to_numpy(cls, tensor: TensorType) -> np.ndarray: + pass + + @classmethod + def _check_assertion( + cls, + test: Union[TensorType, List[TensorType]], + reference: Union[TensorType, List[TensorType]], + assert_fn: Callable[[np.ndarray, np.ndarray], bool], + ): + if not isinstance(test, list): + test = [test] + if not isinstance(reference, list): + reference = [reference] + assert len(test) == len(reference) + + for x, y in zip(test, reference): + x = cls._to_numpy(x) + y = cls._to_numpy(y) + assert_fn(x, y) + + @classmethod + def check_equal( + cls, + test: Union[TensorType, List[TensorType]], + reference: Union[TensorType, List[TensorType]], + rtol: float = 1e-1, + atol=0, + ): + cls._check_assertion(test, reference, lambda x, y: np.testing.assert_allclose(x, y, rtol=rtol, atol=atol)) + + @classmethod + def check_not_equal( + cls, + test: Union[TensorType, List[TensorType]], + reference: Union[TensorType, List[TensorType]], + rtol: float = 1e-4, + ): + cls._check_assertion( + test, + reference, + lambda x, y: np.testing.assert_raises(AssertionError, np.testing.assert_allclose, x, y, rtol=rtol), + ) + + @classmethod + def check_less( + cls, test: Union[TensorType, List[TensorType]], reference: Union[TensorType, List[TensorType]], rtol=1e-4 + ): + cls.check_not_equal(test, reference, rtol=rtol) + cls._check_assertion(test, reference, np.testing.assert_array_less) + + @classmethod + def check_greater( + cls, test: Union[TensorType, List[TensorType]], reference: Union[TensorType, List[TensorType]], rtol=1e-4 + ): + cls.check_not_equal(test, reference, rtol=rtol) + cls._check_assertion( + test, reference, lambda x, y: np.testing.assert_raises(AssertionError, np.testing.assert_array_less, x, y) + ) + + +def compare_stats(expected: Dict[str, np.ndarray], actual: Dict[str, np.ndarray]): + assert len(expected) == len(actual) + for ref_node_name, ref_stats in expected.items(): + actual_stats = actual[ref_node_name] + for param_name, ref_param in ref_stats.items(): + actual_param = actual_stats.get(param_name) + assert np.array(ref_param).shape == np.array(actual_param).shape + assert np.allclose(ref_param, actual_param, atol=1e-5) diff --git a/tests/cross_fw/shared/helpers.py b/tests/cross_fw/shared/helpers.py index 2f56d36cc6f..eebe822973c 100644 --- a/tests/cross_fw/shared/helpers.py +++ b/tests/cross_fw/shared/helpers.py @@ -8,22 +8,14 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import json import subprocess import sys -from abc import ABC -from abc import abstractmethod -from copy import deepcopy from pathlib import Path -from typing import Callable, Dict, List, Set, TypeVar, Union - -import numpy as np +from typing import Callable, Set from tests.cross_fw.shared.paths import GITHUB_REPO_URL from tests.cross_fw.shared.paths import PROJECT_ROOT -TensorType = TypeVar("TensorType") - def is_windows() -> bool: return "win32" in sys.platform @@ -125,70 +117,6 @@ def create_venv_with_nncf(tmp_path: Path, package_type: str, venv_type: str, bac return venv_path -class BaseTensorListComparator(ABC): - @classmethod - @abstractmethod - def _to_numpy(cls, tensor: TensorType) -> np.ndarray: - pass - - @classmethod - def _check_assertion( - cls, - test: Union[TensorType, List[TensorType]], - reference: Union[TensorType, List[TensorType]], - assert_fn: Callable[[np.ndarray, np.ndarray], bool], - ): - if not isinstance(test, list): - test = [test] - if not isinstance(reference, list): - reference = [reference] - assert len(test) == len(reference) - - for x, y in zip(test, reference): - x = cls._to_numpy(x) - y = cls._to_numpy(y) - assert_fn(x, y) - - @classmethod - def check_equal( - cls, - test: Union[TensorType, List[TensorType]], - reference: Union[TensorType, List[TensorType]], - rtol: float = 1e-1, - atol=0, - ): - cls._check_assertion(test, reference, lambda x, y: np.testing.assert_allclose(x, y, rtol=rtol, atol=atol)) - - @classmethod - def check_not_equal( - cls, - test: Union[TensorType, List[TensorType]], - reference: Union[TensorType, List[TensorType]], - rtol: float = 1e-4, - ): - cls._check_assertion( - test, - reference, - lambda x, y: np.testing.assert_raises(AssertionError, np.testing.assert_allclose, x, y, rtol=rtol), - ) - - @classmethod - def check_less( - cls, test: Union[TensorType, List[TensorType]], reference: Union[TensorType, List[TensorType]], rtol=1e-4 - ): - cls.check_not_equal(test, reference, rtol=rtol) - cls._check_assertion(test, reference, np.testing.assert_array_less) - - @classmethod - def check_greater( - cls, test: Union[TensorType, List[TensorType]], reference: Union[TensorType, List[TensorType]], rtol=1e-4 - ): - cls.check_not_equal(test, reference, rtol=rtol) - cls._check_assertion( - test, reference, lambda x, y: np.testing.assert_raises(AssertionError, np.testing.assert_array_less, x, y) - ) - - def telemetry_send_event_test_driver(mocker, use_nncf_fn: Callable): from nncf.telemetry import telemetry @@ -197,39 +125,6 @@ def telemetry_send_event_test_driver(mocker, use_nncf_fn: Callable): telemetry_send_event_spy.assert_called() -def load_json(stats_path: Path): - with open(stats_path, "r", encoding="utf8") as json_file: - return json.load(json_file) - - -class NumpyEncoder(json.JSONEncoder): - """Special json encoder for numpy types""" - - def default(self, o): - if isinstance(o, np.integer): - return int(o) - if isinstance(o, np.floating): - return float(o) - if isinstance(o, np.ndarray): - return o.tolist() - return json.JSONEncoder.default(self, o) - - -def dump_to_json(local_path: Path, data: Dict[str, np.ndarray]): - with open(local_path, "w", encoding="utf8") as file: - json.dump(deepcopy(data), file, indent=4, cls=NumpyEncoder) - - -def compare_stats(expected: Dict[str, np.ndarray], actual: Dict[str, np.ndarray]): - assert len(expected) == len(actual) - for ref_node_name, ref_stats in expected.items(): - actual_stats = actual[ref_node_name] - for param_name, ref_param in ref_stats.items(): - actual_param = actual_stats.get(param_name) - assert np.array(ref_param).shape == np.array(actual_param).shape - assert np.allclose(ref_param, actual_param, atol=1e-5) - - def get_python_executable_with_venv(venv_path: Path) -> str: if is_linux(): python_executable_with_venv = f". {venv_path}/bin/activate && {venv_path}/bin/python" diff --git a/tests/cross_fw/shared/json.py b/tests/cross_fw/shared/json.py new file mode 100644 index 00000000000..263a00870f9 --- /dev/null +++ b/tests/cross_fw/shared/json.py @@ -0,0 +1,39 @@ +# Copyright (c) 2024 Intel Corporation +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import json +from copy import deepcopy +from pathlib import Path +from typing import Dict + +import numpy as np + + +def load_json(stats_path: Path): + with open(stats_path, "r", encoding="utf8") as json_file: + return json.load(json_file) + + +class NumpyEncoder(json.JSONEncoder): + """Special json encoder for numpy types""" + + def default(self, o): + if isinstance(o, np.integer): + return int(o) + if isinstance(o, np.floating): + return float(o) + if isinstance(o, np.ndarray): + return o.tolist() + return json.JSONEncoder.default(self, o) + + +def dump_to_json(local_path: Path, data: Dict[str, np.ndarray]): + with open(local_path, "w", encoding="utf8") as file: + json.dump(deepcopy(data), file, indent=4, cls=NumpyEncoder) diff --git a/tests/cross_fw/test_templates/test_calculate_quantizer_parameters.py b/tests/cross_fw/test_templates/test_calculate_quantizer_parameters.py index 791cdfad629..6c0169d8911 100644 --- a/tests/cross_fw/test_templates/test_calculate_quantizer_parameters.py +++ b/tests/cross_fw/test_templates/test_calculate_quantizer_parameters.py @@ -25,8 +25,8 @@ from nncf.quantization.fake_quantize import FakeQuantizeParameters from nncf.quantization.fake_quantize import calculate_quantizer_parameters from nncf.tensor import functions as fns -from tests.cross_fw.shared.helpers import dump_to_json -from tests.cross_fw.shared.helpers import load_json +from tests.cross_fw.shared.json import dump_to_json +from tests.cross_fw.shared.json import load_json FQ_CALCULATED_PARAMETERS_PATH = Path(__file__).parent / "fq_params" / "fq_params.json" diff --git a/tests/onnx/quantization/test_qdq_params_calculation.py b/tests/onnx/quantization/test_qdq_params_calculation.py index 9968706ecbd..c62f2d6afcc 100644 --- a/tests/onnx/quantization/test_qdq_params_calculation.py +++ b/tests/onnx/quantization/test_qdq_params_calculation.py @@ -18,8 +18,8 @@ from nncf.onnx.graph.onnx_helper import get_tensor_value from nncf.quantization.advanced_parameters import AdvancedQuantizationParameters from nncf.quantization.advanced_parameters import OverflowFix -from tests.cross_fw.shared.helpers import compare_stats -from tests.cross_fw.shared.helpers import load_json +from tests.cross_fw.shared.comparator import compare_stats +from tests.cross_fw.shared.json import load_json from tests.onnx.conftest import ONNX_TEST_ROOT from tests.onnx.models import EmbeddingModel from tests.onnx.models import GEMMTransposeWeightModel diff --git a/tests/openvino/native/quantization/test_fq_params_calculation.py b/tests/openvino/native/quantization/test_fq_params_calculation.py index 3053330cc77..5751a34f39b 100644 --- a/tests/openvino/native/quantization/test_fq_params_calculation.py +++ b/tests/openvino/native/quantization/test_fq_params_calculation.py @@ -21,8 +21,8 @@ from nncf.parameters import QuantizationMode from nncf.quantization.advanced_parameters import OverflowFix from nncf.quantization.algorithms.min_max.algorithm import MinMaxQuantization -from tests.cross_fw.shared.helpers import compare_stats -from tests.cross_fw.shared.helpers import load_json +from tests.cross_fw.shared.comparator import compare_stats +from tests.cross_fw.shared.json import load_json from tests.openvino.native.common import convert_torch_model from tests.openvino.native.common import get_actual_reference_for_current_openvino from tests.openvino.native.common import get_dataset_for_test diff --git a/tests/openvino/native/quantization/test_weights_compression.py b/tests/openvino/native/quantization/test_weights_compression.py index 541b8a386e5..7f8ccea21ec 100644 --- a/tests/openvino/native/quantization/test_weights_compression.py +++ b/tests/openvino/native/quantization/test_weights_compression.py @@ -44,9 +44,9 @@ from nncf.scopes import IgnoredScope from nncf.tensor import Tensor from nncf.tensor import TensorDataType -from tests.cross_fw.shared.helpers import compare_stats -from tests.cross_fw.shared.helpers import dump_to_json -from tests.cross_fw.shared.helpers import load_json +from tests.cross_fw.shared.comparator import compare_stats +from tests.cross_fw.shared.json import dump_to_json +from tests.cross_fw.shared.json import load_json from tests.openvino.native.common import get_actual_reference_for_current_openvino from tests.openvino.native.models import AWQActMatmulModel from tests.openvino.native.models import AWQMatmulModel diff --git a/tests/tensorflow/helpers.py b/tests/tensorflow/helpers.py index a7ab7e26803..83f783e6b84 100644 --- a/tests/tensorflow/helpers.py +++ b/tests/tensorflow/helpers.py @@ -20,7 +20,7 @@ from nncf import NNCFConfig from nncf.common.compression import BaseCompressionAlgorithmController from nncf.tensorflow.helpers.model_creation import create_compressed_model -from tests.cross_fw.shared.helpers import BaseTensorListComparator +from tests.cross_fw.shared.comparator import BaseTensorListComparator TensorType = Union[tf.Tensor, tf.Variable, np.ndarray, numbers.Number] diff --git a/tests/torch/helpers.py b/tests/torch/helpers.py index 1e3d102f2ed..f13492c8b7c 100644 --- a/tests/torch/helpers.py +++ b/tests/torch/helpers.py @@ -51,7 +51,7 @@ from nncf.torch.nncf_network import NNCFNetwork from nncf.torch.utils import get_all_modules_by_type from tests.cross_fw.shared.command import Command as BaseCommand -from tests.cross_fw.shared.helpers import BaseTensorListComparator +from tests.cross_fw.shared.comparator import BaseTensorListComparator TensorType = Union[torch.Tensor, np.ndarray, numbers.Number] diff --git a/tests/torch/ptq/test_fq_params_calculation.py b/tests/torch/ptq/test_fq_params_calculation.py index af5d061262b..6d71760cd33 100644 --- a/tests/torch/ptq/test_fq_params_calculation.py +++ b/tests/torch/ptq/test_fq_params_calculation.py @@ -25,8 +25,8 @@ from nncf.torch.nncf_network import NNCFNetwork from nncf.torch.quantization.layers import QUANTIZATION_MODULES from nncf.torch.utils import get_all_modules_by_type -from tests.cross_fw.shared.helpers import compare_stats -from tests.cross_fw.shared.helpers import load_json +from tests.cross_fw.shared.comparator import compare_stats +from tests.cross_fw.shared.json import load_json from tests.cross_fw.shared.paths import TEST_ROOT from tests.torch.helpers import TwoConvTestModel from tests.torch.helpers import create_random_mock_dataloader diff --git a/tests/torch/test_dataset_generators.py b/tests/torch/test_dataset_generators.py index 6e888232c5f..64447e55b87 100644 --- a/tests/torch/test_dataset_generators.py +++ b/tests/torch/test_dataset_generators.py @@ -15,7 +15,7 @@ import nncf from nncf.data import generate_text_data -from tests.cross_fw.shared.helpers import load_json +from tests.cross_fw.shared.json import load_json from tests.cross_fw.shared.paths import TEST_ROOT from tests.torch.helpers import set_torch_seed From 2c58e7e0e2ea8f8f1e08a8f9c4f62db529a8b2af Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Mon, 25 Nov 2024 05:07:55 +0200 Subject: [PATCH 14/15] w --- .github/workflows/install.yml | 61 +++++------------------------------ 1 file changed, 8 insertions(+), 53 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 07d6e3402b9..398fb93ab0e 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -7,25 +7,19 @@ on: pull_request_number: description: 'The pull request number' default: '' - pull_request: - types: - - opened - - reopened - - synchronize - paths-ignore: - - '*' # TODO: remove - - '**/*.md' - - 'docs/**/*' - - 'tests/*' + schedule: + - cron: '0 0 * * *' + pull_request: # TODO: remove jobs: install-cpu: - name: Test install [${{ matrix.backend }}] - runs-on: ubuntu-22.04 + name: Test install [${{ matrix.backend }} - ${{ matrix.runner }}] + runs-on: ${{ matrix.runner }} strategy: fail-fast: false matrix: backend: ["torch", "tf", "onnx", "openvino"] + runner: ["windows-latest", "ubuntu-22.04"] defaults: run: shell: bash @@ -41,19 +35,15 @@ jobs: git checkout pr-${{ github.event.inputs.pull_request_number }} - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 with: - python-version: 3.10.14 + python-version: "3.10" cache: pip - name: Install test requirements run: | pip install -r tests/cross_fw/examples/requirements.txt - name: Print installed modules run: pip list - - name: Run install test scope (all) - if: github.event_name != 'pull_request' + - name: Run install test scope run: pytest tests/cross_fw/install -rA -s --host-configuration cpu --backend ${{ matrix.backend }} - - name: Run install test scope (fast) - if: github.event_name == 'pull_request' - run: pytest tests/cross_fw/install -rA -s --host-configuration cpu --backend ${{ matrix.backend }} -k build_w install-torch-gpu: name: Test install [torch-gpu] @@ -61,7 +51,6 @@ jobs: run: shell: bash runs-on: aks-linux-4-cores-28gb-gpu-tesla-t4 - if: github.event_name != 'pull_request' env: DEBIAN_FRONTEND: noninteractive steps: @@ -103,37 +92,3 @@ jobs: export PATH=/usr/local/cuda-12.4/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} pytest tests/cross_fw/install -rA -s --host-configuration gpu --backend torch - - install-cpu-win: - name: Test install windows [${{ matrix.backend }}] - runs-on: windows-latest - # TODO: != - if: github.event_name == 'pull_request' - strategy: - fail-fast: false - matrix: - backend: ["torch", "tf", "onnx", "openvino"] - defaults: - run: - shell: bash - steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - with: - lfs: true - fetch-depth: 0 # Fetch full history to allow checking out any branch or PR - - name: Fetch and Checkout the Pull Request Branch - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.pull_request_number != '' }} - run: | - git fetch origin pull/${{ github.event.inputs.pull_request_number }}/head:pr-${{ github.event.inputs.pull_request_number }} - git checkout pr-${{ github.event.inputs.pull_request_number }} - - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 - with: - python-version: 3.10 - cache: pip - - name: Install test requirements - run: | - pip install -r tests/cross_fw/examples/requirements.txt - - name: Print installed modules - run: pip list - - name: Run install test scope (all) - run: pytest tests/cross_fw/install -rA -s --host-configuration cpu --backend ${{ matrix.backend }} From 7018ed65930a5df7f565f0ee5f2c6f630b868deb Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Mon, 25 Nov 2024 05:35:18 +0200 Subject: [PATCH 15/15] f --- .github/workflows/install.yml | 3 +-- .github/workflows/precommit.yml | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 398fb93ab0e..c12491a5f75 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -9,7 +9,6 @@ on: default: '' schedule: - cron: '0 0 * * *' - pull_request: # TODO: remove jobs: install-cpu: @@ -46,7 +45,7 @@ jobs: run: pytest tests/cross_fw/install -rA -s --host-configuration cpu --backend ${{ matrix.backend }} install-torch-gpu: - name: Test install [torch-gpu] + name: Test install [torch - ubuntu-gpu] defaults: run: shell: bash diff --git a/.github/workflows/precommit.yml b/.github/workflows/precommit.yml index 16e84857fa2..6dd6bff293d 100644 --- a/.github/workflows/precommit.yml +++ b/.github/workflows/precommit.yml @@ -8,7 +8,6 @@ on: - reopened - synchronize paths-ignore: - - '*' # TODO: remove - '**/*.md' - 'docs/**/*' - 'tests/post_training/*' # post_training tests runs on Jenkins