|
| 1 | +name: call-precommit |
| 2 | +permissions: read-all |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_call: |
| 6 | + inputs: |
| 7 | + python_version: |
| 8 | + description: 'Python version' |
| 9 | + type: string |
| 10 | + required: true |
| 11 | + gpu_enabled: |
| 12 | + description: 'Enable gpu tests' |
| 13 | + type: boolean |
| 14 | + default: false |
| 15 | + required: true |
| 16 | + override_requirements: |
| 17 | + description: 'Override requirements' |
| 18 | + default: '' |
| 19 | + type: string |
| 20 | + required: false |
| 21 | + |
| 22 | +jobs: |
| 23 | + onnx: |
| 24 | + timeout-minutes: 40 |
| 25 | + runs-on: ubuntu-22.04-8-cores |
| 26 | + defaults: |
| 27 | + run: |
| 28 | + shell: bash |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 |
| 31 | + with: |
| 32 | + lfs: true |
| 33 | + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 |
| 34 | + with: |
| 35 | + python-version: ${{ inputs.python_version }} |
| 36 | + - name: Override constraints |
| 37 | + if: ${{ inputs.override_requirements != '' }} |
| 38 | + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" |
| 39 | + shell: bash |
| 40 | + - name: Install NNCF and test requirements |
| 41 | + run: pip install . -r tests/onnx/requirements.txt |
| 42 | + - name: Print installed modules |
| 43 | + run: pip list |
| 44 | + - name: Run ONNX precommit test scope |
| 45 | + run: make test-onnx |
| 46 | + env: |
| 47 | + NUM_WORKERS: 4 |
| 48 | + |
| 49 | + openvino: |
| 50 | + timeout-minutes: 40 |
| 51 | + runs-on: ubuntu-22.04-8-cores |
| 52 | + defaults: |
| 53 | + run: |
| 54 | + shell: bash |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 |
| 57 | + with: |
| 58 | + lfs: true |
| 59 | + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 |
| 60 | + with: |
| 61 | + python-version: ${{ inputs.python_version }} |
| 62 | + - name: Override constraints |
| 63 | + if: ${{ inputs.override_requirements != '' }} |
| 64 | + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" |
| 65 | + shell: bash |
| 66 | + - name: Install NNCF and test requirements |
| 67 | + run: pip install . -r tests/openvino/requirements.txt |
| 68 | + - name: Print installed modules |
| 69 | + run: pip list |
| 70 | + - name: Run OV precommit test scope |
| 71 | + run: make test-openvino |
| 72 | + env: |
| 73 | + NUM_WORKERS: 4 |
| 74 | + |
| 75 | + pytorch-cpu: |
| 76 | + timeout-minutes: 40 |
| 77 | + runs-on: ubuntu-22.04-8-cores |
| 78 | + defaults: |
| 79 | + run: |
| 80 | + shell: bash |
| 81 | + env: |
| 82 | + DEBIAN_FRONTEND: noninteractive |
| 83 | + steps: |
| 84 | + - name: Install dependencies |
| 85 | + run : | |
| 86 | + sudo apt-get update |
| 87 | + sudo apt-get --assume-yes install gcc g++ build-essential ninja-build libgl1-mesa-dev libglib2.0-0 |
| 88 | + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 |
| 89 | + with: |
| 90 | + lfs: true |
| 91 | + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 |
| 92 | + with: |
| 93 | + python-version: ${{ inputs.python_version }} |
| 94 | + - name: Runner info |
| 95 | + continue-on-error: true |
| 96 | + run: | |
| 97 | + cat /etc/*release |
| 98 | + cat /proc/cpuinfo |
| 99 | + - name: Override constraints |
| 100 | + if: ${{ inputs.override_requirements != '' }} |
| 101 | + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" |
| 102 | + shell: bash |
| 103 | + - name: Install NNCF and test requirements |
| 104 | + run: pip install . -r tests/torch/requirements.txt |
| 105 | + - name: Print installed modules |
| 106 | + run: pip list |
| 107 | + - name: Run PyTorch precommit test scope |
| 108 | + run: | |
| 109 | + make test-torch-cpu |
| 110 | + env: |
| 111 | + NUM_WORKERS: 4 |
| 112 | + |
| 113 | + pytorch-cuda: |
| 114 | + timeout-minutes: 40 |
| 115 | + runs-on: aks-linux-4-cores-28gb-gpu-tesla-t4 |
| 116 | + if: ${{ inputs.gpu_enabled == true }} |
| 117 | + defaults: |
| 118 | + run: |
| 119 | + shell: bash |
| 120 | + env: |
| 121 | + DEBIAN_FRONTEND: noninteractive |
| 122 | + steps: |
| 123 | + - name: Install dependencies |
| 124 | + run : | |
| 125 | + sudo apt-get update |
| 126 | + sudo apt-get --assume-yes install build-essential ninja-build libgl1-mesa-dev libglib2.0-0 wget make |
| 127 | + - name: Download CUDA |
| 128 | + run: | |
| 129 | + wget -q https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_550.54.14_linux.run |
| 130 | + sudo sh cuda_12.4.0_550.54.14_linux.run --toolkit --silent |
| 131 | + - name: Runner info |
| 132 | + continue-on-error: true |
| 133 | + run: | |
| 134 | + export PATH=/usr/local/cuda-12.4/bin${PATH:+:${PATH}} |
| 135 | + export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} |
| 136 | + nvidia-smi |
| 137 | + cat /proc/cpuinfo |
| 138 | + nvcc --version |
| 139 | + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 |
| 140 | + with: |
| 141 | + lfs: true |
| 142 | + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 |
| 143 | + with: |
| 144 | + python-version: ${{ inputs.python_version }} |
| 145 | + - name: Override constraints |
| 146 | + if: ${{ inputs.override_requirements != '' }} |
| 147 | + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" |
| 148 | + shell: bash |
| 149 | + - name: Install NNCF and test requirements |
| 150 | + run: pip install . -r tests/torch/requirements.txt |
| 151 | + - name: Print installed modules |
| 152 | + run: pip list |
| 153 | + - name: Check CUDA |
| 154 | + run: | |
| 155 | + python -c "import torch; print(torch.cuda.is_available())" |
| 156 | + - name: Run PyTorch precommit test scope |
| 157 | + run: | |
| 158 | + export PATH=/usr/local/cuda-12.4/bin${PATH:+:${PATH}} |
| 159 | + export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} |
| 160 | + make test-torch-cuda |
| 161 | +
|
| 162 | + tensorflow: |
| 163 | + timeout-minutes: 40 |
| 164 | + runs-on: ubuntu-22.04-8-cores |
| 165 | + if: ${{ inputs.python_version != '3.12' }} |
| 166 | + defaults: |
| 167 | + run: |
| 168 | + shell: bash |
| 169 | + env: |
| 170 | + DEBIAN_FRONTEND: noninteractive |
| 171 | + steps: |
| 172 | + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 |
| 173 | + with: |
| 174 | + lfs: true |
| 175 | + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 |
| 176 | + with: |
| 177 | + python-version: ${{ inputs.python_version }} |
| 178 | + - name: Override constraints |
| 179 | + if: ${{ inputs.override_requirements != '' }} |
| 180 | + run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}" |
| 181 | + shell: bash |
| 182 | + - name: Install NNCF and test requirements |
| 183 | + run: pip install . -r tests/tensorflow/requirements.txt |
| 184 | + - name: Print installed modules |
| 185 | + run: pip list |
| 186 | + - name: Run TensorFlow precommit test scope |
| 187 | + run: make test-tensorflow |
| 188 | + env: |
| 189 | + NUM_WORKERS: 6 |
| 190 | + |
0 commit comments