From f08731fc71d231e0686627adf126e13d735b946e Mon Sep 17 00:00:00 2001 From: shumaari <shumaari2022@gmail.com> Date: Sun, 9 Mar 2025 10:33:20 +0530 Subject: [PATCH 1/4] actions1: modify mypy.yml --- .github/workflows/mypy.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index ba2dc684c71..d19d2a27df7 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -1,12 +1,14 @@ -name: mypy +# name: mypy +name: manual_mypy permissions: read-all on: - pull_request: - types: - - opened - - reopened - - synchronize + # pull_request: + # types: + # - opened + # - reopened + # - synchronize + workflow_dispatch: paths: - '.github/workflows/mypy.yml' - 'pyproject.toml' From 88725a4e29992e01b18e220aa8e0e44fdcc515be Mon Sep 17 00:00:00 2001 From: shumaari <shumaari2022@gmail.com> Date: Sun, 9 Mar 2025 10:50:05 +0530 Subject: [PATCH 2/4] actions2: modify pre-commit-linters.yml --- .github/workflows/pre-commit-linters.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pre-commit-linters.yml b/.github/workflows/pre-commit-linters.yml index 403d6b2220a..2f8087e94f3 100644 --- a/.github/workflows/pre-commit-linters.yml +++ b/.github/workflows/pre-commit-linters.yml @@ -1,12 +1,14 @@ -name: pre-commit-linters +# name: pre-commit-linters +name: manual-pre-commit-linters permissions: read-all on: - pull_request: - types: - - opened - - reopened - - synchronize + # pull_request: + # types: + # - opened + # - reopened + # - synchronize + workflow_dispatch: jobs: pre-commit: From 86dbbf39dc76148f5a061e03280039249671909a Mon Sep 17 00:00:00 2001 From: shumaari <shumaari2022@gmail.com> Date: Sun, 9 Mar 2025 14:14:46 +0530 Subject: [PATCH 3/4] actions3: create precommit1.yml and call_precommit1.yml - created call_precommit1.yml from call_precommit.yml, removed timeout, standard runners, removed cuda runner - created precommit1.yml from precommit.yml, which calls call_precommit1.yml --- .github/workflows/call_precommit1.yml | 264 ++++++++++++++++++++++++++ .github/workflows/precommit1.yml | 26 +++ 2 files changed, 290 insertions(+) create mode 100644 .github/workflows/call_precommit1.yml create mode 100644 .github/workflows/precommit1.yml diff --git a/.github/workflows/call_precommit1.yml b/.github/workflows/call_precommit1.yml new file mode 100644 index 00000000000..6ca5923614b --- /dev/null +++ b/.github/workflows/call_precommit1.yml @@ -0,0 +1,264 @@ +name: call-precommit +permissions: read-all + +on: + workflow_call: + inputs: + python_version: + description: 'Python version' + type: string + required: true + gpu_enabled: + description: 'Enable gpu tests' + type: boolean + default: false + required: true + override_requirements: + description: 'Override requirements' + default: '' + type: string + required: false + +jobs: + common: + # timeout-minutes: 40 + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: ${{ inputs.python_version }} + - name: Override constraints + if: ${{ inputs.override_requirements != '' }} + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" + shell: bash + - name: Install NNCF and test requirements + run: pip install . -r tests/common/requirements.txt + - name: Print installed modules + run: pip list + - name: Run common precommit test scope + run: make test-common + env: + NUM_WORKERS: 2 + + onnx: + # timeout-minutes: 40 + # runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: ${{ inputs.python_version }} + - name: Override constraints + if: ${{ inputs.override_requirements != '' }} + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" + shell: bash + - name: Install NNCF and test requirements + run: pip install . -r tests/onnx/requirements.txt + - name: Print installed modules + run: pip list + - name: Run ONNX precommit test scope + run: make test-onnx + env: + NUM_WORKERS: 4 + + openvino: + # timeout-minutes: 40 + # runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: ${{ inputs.python_version }} + - name: Override constraints + if: ${{ inputs.override_requirements != '' }} + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" + shell: bash + - name: Install NNCF and test requirements + run: pip install . -r tests/openvino/requirements.txt + - name: Print installed modules + run: pip list + - name: Run OV precommit test scope + run: make test-openvino + env: + NUM_WORKERS: 4 + + pytorch-cpu: + # timeout-minutes: 40 + # runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest + defaults: + run: + shell: bash + env: + DEBIAN_FRONTEND: noninteractive + steps: + - name: Install dependencies + run : | + sudo apt-get update + sudo apt-get --assume-yes install gcc g++ build-essential ninja-build libgl1-mesa-dev libglib2.0-0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: ${{ inputs.python_version }} + - name: Runner info + continue-on-error: true + run: | + cat /etc/*release + cat /proc/cpuinfo + - name: Override constraints + if: ${{ inputs.override_requirements != '' }} + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" + shell: bash + - name: Install NNCF and test requirements + run: pip install . -r tests/torch/requirements.txt + - name: Print installed modules + run: pip list + - name: Run PyTorch precommit test scope + run: | + make test-torch-cpu + env: + NUM_WORKERS: 4 + + # pytorch-cuda: + # timeout-minutes: 40 + # runs-on: aks-linux-4-cores-28gb-gpu-tesla-t4 + # if: ${{ inputs.gpu_enabled == true }} + # defaults: + # run: + # shell: bash + # 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + # with: + # lfs: true + # - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + # with: + # python-version: ${{ inputs.python_version }} + # - name: Override constraints + # if: ${{ inputs.override_requirements != '' }} + # run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" + # shell: bash + # - name: Install NNCF and test requirements + # run: pip install . -r tests/torch/requirements.txt + # - name: Print installed modules + # run: pip list + # - name: Check CUDA + # run: | + # python -c "import torch; print(torch.cuda.is_available())" + # - 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}} + # make test-torch-cuda + + tensorflow: + # timeout-minutes: 40 + # runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest + if: ${{ inputs.python_version != '3.12' }} + defaults: + run: + shell: bash + env: + DEBIAN_FRONTEND: noninteractive + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: ${{ inputs.python_version }} + - name: Override constraints + if: ${{ inputs.override_requirements != '' }} + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" + shell: bash + - name: Install NNCF and test requirements + run: pip install . -r tests/tensorflow/requirements.txt + - name: Print installed modules + run: pip list + - name: Run TensorFlow precommit test scope + run: make test-tensorflow + env: + NUM_WORKERS: 6 + + tools: + # timeout-minutes: 40 + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: ${{ inputs.python_version }} + - name: Install test requirements + run: pip install -r tests/tools/requirements.txt + - name: Print installed modules + run: pip list + - name: Run tools precommit test scope + run: pytest -ra tests/tools + + pytorch2-cpu: + # timeout-minutes: 40 + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: ${{ inputs.python_version }} + - name: Override constraints + if: ${{ inputs.override_requirements != '' }} + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" + shell: bash + - name: Install NNCF and test requirements + run: | + pip install . -r tests/torch2/requirements.txt + - name: Print installed modules + run: pip list + - name: Run torch2 precommit test scope + run: pytest -ra tests/torch2 -m "not cuda" diff --git a/.github/workflows/precommit1.yml b/.github/workflows/precommit1.yml new file mode 100644 index 00000000000..dea44a68619 --- /dev/null +++ b/.github/workflows/precommit1.yml @@ -0,0 +1,26 @@ +# name: precommit +name: manual-precommit +permissions: read-all + +on: + # pull_request: + # types: + # - opened + # - reopened + # - synchronize + workflow_dispatch: + # paths-ignore: + # - '**/*.md' + # - 'docs/**/*' + # - 'tests/post_training/*' # post_training tests runs on Jenkins + # - 'tests/torch/sota_checkpoints_eval.json' # reference for PT e2e + # - 'tests/tensorflow/sota_checkpoints_eval.json' # reference for TF e2e + # - 'tests/cross_fw/examples/*' # examples tests runs in separate workflow + +jobs: + pytest: + # uses: ./.github/workflows/call_precommit.yml + uses: ./.github/workflows/call_precommit1.yml + with: + python_version: "3.10.14" + gpu_enabled: true From 25f78c6a7321ff4e5767b92d9b155ca9be981d9c Mon Sep 17 00:00:00 2001 From: shumaari <shumaari2022@gmail.com> Date: Sun, 9 Mar 2025 14:16:37 +0530 Subject: [PATCH 4/4] actions4: create precommit2.yml and call_precommit2.yml - created call_precommit2.yml from call_precommit1.yml, removed timeout, standard runners, removed cuda runner - created precommit2.yml from precommit1.yml, which calls call_precommit1.yml - list detailed failed tests in relevant sections of call_precommit2.yml and then run precommit2.yml --- .github/workflows/call_precommit2.yml | 265 ++++++++++++++++++++++++++ .github/workflows/precommit2.yml | 26 +++ 2 files changed, 291 insertions(+) create mode 100644 .github/workflows/call_precommit2.yml create mode 100644 .github/workflows/precommit2.yml diff --git a/.github/workflows/call_precommit2.yml b/.github/workflows/call_precommit2.yml new file mode 100644 index 00000000000..eac01907f92 --- /dev/null +++ b/.github/workflows/call_precommit2.yml @@ -0,0 +1,265 @@ +# list detailed failed tests in relevant sections as needed +name: call-precommit +permissions: read-all + +on: + workflow_call: + inputs: + python_version: + description: 'Python version' + type: string + required: true + gpu_enabled: + description: 'Enable gpu tests' + type: boolean + default: false + required: true + override_requirements: + description: 'Override requirements' + default: '' + type: string + required: false + +jobs: + common: + # timeout-minutes: 40 + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: ${{ inputs.python_version }} + - name: Override constraints + if: ${{ inputs.override_requirements != '' }} + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" + shell: bash + - name: Install NNCF and test requirements + run: pip install . -r tests/common/requirements.txt + - name: Print installed modules + run: pip list + - name: Run common precommit test scope + run: make test-common + env: + NUM_WORKERS: 2 + + onnx: + # timeout-minutes: 40 + # runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: ${{ inputs.python_version }} + - name: Override constraints + if: ${{ inputs.override_requirements != '' }} + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" + shell: bash + - name: Install NNCF and test requirements + run: pip install . -r tests/onnx/requirements.txt + - name: Print installed modules + run: pip list + - name: Run ONNX precommit test scope + run: make test-onnx + env: + NUM_WORKERS: 4 + + openvino: + # timeout-minutes: 40 + # runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: ${{ inputs.python_version }} + - name: Override constraints + if: ${{ inputs.override_requirements != '' }} + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" + shell: bash + - name: Install NNCF and test requirements + run: pip install . -r tests/openvino/requirements.txt + - name: Print installed modules + run: pip list + - name: Run OV precommit test scope + run: make test-openvino + env: + NUM_WORKERS: 4 + + pytorch-cpu: + # timeout-minutes: 40 + # runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest + defaults: + run: + shell: bash + env: + DEBIAN_FRONTEND: noninteractive + steps: + - name: Install dependencies + run : | + sudo apt-get update + sudo apt-get --assume-yes install gcc g++ build-essential ninja-build libgl1-mesa-dev libglib2.0-0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: ${{ inputs.python_version }} + - name: Runner info + continue-on-error: true + run: | + cat /etc/*release + cat /proc/cpuinfo + - name: Override constraints + if: ${{ inputs.override_requirements != '' }} + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" + shell: bash + - name: Install NNCF and test requirements + run: pip install . -r tests/torch/requirements.txt + - name: Print installed modules + run: pip list + - name: Run PyTorch precommit test scope + run: | + make test-torch-cpu + env: + NUM_WORKERS: 4 + + # pytorch-cuda: + # timeout-minutes: 40 + # runs-on: aks-linux-4-cores-28gb-gpu-tesla-t4 + # if: ${{ inputs.gpu_enabled == true }} + # defaults: + # run: + # shell: bash + # 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + # with: + # lfs: true + # - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + # with: + # python-version: ${{ inputs.python_version }} + # - name: Override constraints + # if: ${{ inputs.override_requirements != '' }} + # run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" + # shell: bash + # - name: Install NNCF and test requirements + # run: pip install . -r tests/torch/requirements.txt + # - name: Print installed modules + # run: pip list + # - name: Check CUDA + # run: | + # python -c "import torch; print(torch.cuda.is_available())" + # - 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}} + # make test-torch-cuda + + tensorflow: + # timeout-minutes: 40 + # runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest + if: ${{ inputs.python_version != '3.12' }} + defaults: + run: + shell: bash + env: + DEBIAN_FRONTEND: noninteractive + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: ${{ inputs.python_version }} + - name: Override constraints + if: ${{ inputs.override_requirements != '' }} + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" + shell: bash + - name: Install NNCF and test requirements + run: pip install . -r tests/tensorflow/requirements.txt + - name: Print installed modules + run: pip list + - name: Run TensorFlow precommit test scope + run: make test-tensorflow + env: + NUM_WORKERS: 6 + + tools: + # timeout-minutes: 40 + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: ${{ inputs.python_version }} + - name: Install test requirements + run: pip install -r tests/tools/requirements.txt + - name: Print installed modules + run: pip list + - name: Run tools precommit test scope + run: pytest -ra tests/tools + + pytorch2-cpu: + # timeout-minutes: 40 + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + lfs: true + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: ${{ inputs.python_version }} + - name: Override constraints + if: ${{ inputs.override_requirements != '' }} + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" + shell: bash + - name: Install NNCF and test requirements + run: | + pip install . -r tests/torch2/requirements.txt + - name: Print installed modules + run: pip list + - name: Run torch2 precommit test scope + run: pytest -ra tests/torch2 -m "not cuda" diff --git a/.github/workflows/precommit2.yml b/.github/workflows/precommit2.yml new file mode 100644 index 00000000000..b9b931f3268 --- /dev/null +++ b/.github/workflows/precommit2.yml @@ -0,0 +1,26 @@ +# name: precommit +name: retry-failed-precommit +permissions: read-all + +on: + # pull_request: + # types: + # - opened + # - reopened + # - synchronize + workflow_dispatch: + # paths-ignore: + # - '**/*.md' + # - 'docs/**/*' + # - 'tests/post_training/*' # post_training tests runs on Jenkins + # - 'tests/torch/sota_checkpoints_eval.json' # reference for PT e2e + # - 'tests/tensorflow/sota_checkpoints_eval.json' # reference for TF e2e + # - 'tests/cross_fw/examples/*' # examples tests runs in separate workflow + +jobs: + pytest: + # uses: ./.github/workflows/call_precommit.yml + uses: ./.github/workflows/call_precommit2.yml + with: + python_version: "3.10.14" + gpu_enabled: true