Skip to content

Commit 8078411

Browse files
authored
tests
1 parent c5ad33c commit 8078411

6 files changed

+597
-12
lines changed

.github/workflows/call_precommit1.yml

+264
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
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+
common:
24+
# timeout-minutes: 40
25+
runs-on: ubuntu-latest
26+
defaults:
27+
run:
28+
shell: bash
29+
steps:
30+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31+
with:
32+
lfs: true
33+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.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/common/requirements.txt
42+
- name: Print installed modules
43+
run: pip list
44+
- name: Run common precommit test scope
45+
run: make test-common
46+
env:
47+
NUM_WORKERS: 2
48+
49+
onnx:
50+
# timeout-minutes: 40
51+
# runs-on: ubuntu-latest-8-cores
52+
runs-on: ubuntu-latest
53+
defaults:
54+
run:
55+
shell: bash
56+
steps:
57+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58+
with:
59+
lfs: true
60+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
61+
with:
62+
python-version: ${{ inputs.python_version }}
63+
- name: Override constraints
64+
if: ${{ inputs.override_requirements != '' }}
65+
run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}"
66+
shell: bash
67+
- name: Install NNCF and test requirements
68+
run: pip install . -r tests/onnx/requirements.txt
69+
- name: Print installed modules
70+
run: pip list
71+
- name: Run ONNX precommit test scope
72+
run: make test-onnx
73+
env:
74+
NUM_WORKERS: 4
75+
76+
openvino:
77+
# timeout-minutes: 40
78+
# runs-on: ubuntu-latest-8-cores
79+
runs-on: ubuntu-latest
80+
defaults:
81+
run:
82+
shell: bash
83+
steps:
84+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
85+
with:
86+
lfs: true
87+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
88+
with:
89+
python-version: ${{ inputs.python_version }}
90+
- name: Override constraints
91+
if: ${{ inputs.override_requirements != '' }}
92+
run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}"
93+
shell: bash
94+
- name: Install NNCF and test requirements
95+
run: pip install . -r tests/openvino/requirements.txt
96+
- name: Print installed modules
97+
run: pip list
98+
- name: Run OV precommit test scope
99+
run: make test-openvino
100+
env:
101+
NUM_WORKERS: 4
102+
103+
pytorch-cpu:
104+
# timeout-minutes: 40
105+
# runs-on: ubuntu-latest-8-cores
106+
runs-on: ubuntu-latest
107+
defaults:
108+
run:
109+
shell: bash
110+
env:
111+
DEBIAN_FRONTEND: noninteractive
112+
steps:
113+
- name: Install dependencies
114+
run : |
115+
sudo apt-get update
116+
sudo apt-get --assume-yes install gcc g++ build-essential ninja-build libgl1-mesa-dev libglib2.0-0
117+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
118+
with:
119+
lfs: true
120+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
121+
with:
122+
python-version: ${{ inputs.python_version }}
123+
- name: Runner info
124+
continue-on-error: true
125+
run: |
126+
cat /etc/*release
127+
cat /proc/cpuinfo
128+
- name: Override constraints
129+
if: ${{ inputs.override_requirements != '' }}
130+
run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}"
131+
shell: bash
132+
- name: Install NNCF and test requirements
133+
run: pip install . -r tests/torch/requirements.txt
134+
- name: Print installed modules
135+
run: pip list
136+
- name: Run PyTorch precommit test scope
137+
run: |
138+
make test-torch-cpu
139+
env:
140+
NUM_WORKERS: 4
141+
142+
# pytorch-cuda:
143+
# timeout-minutes: 40
144+
# runs-on: aks-linux-4-cores-28gb-gpu-tesla-t4
145+
# if: ${{ inputs.gpu_enabled == true }}
146+
# defaults:
147+
# run:
148+
# shell: bash
149+
# env:
150+
# DEBIAN_FRONTEND: noninteractive
151+
# steps:
152+
# - name: Install dependencies
153+
# run : |
154+
# sudo apt-get update
155+
# sudo apt-get --assume-yes install build-essential ninja-build libgl1-mesa-dev libglib2.0-0 wget make
156+
# - name: Download CUDA
157+
# run: |
158+
# wget -q https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_550.54.14_linux.run
159+
# sudo sh cuda_12.4.0_550.54.14_linux.run --toolkit --silent
160+
# - name: Runner info
161+
# continue-on-error: true
162+
# run: |
163+
# export PATH=/usr/local/cuda-12.4/bin${PATH:+:${PATH}}
164+
# export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
165+
# nvidia-smi
166+
# cat /proc/cpuinfo
167+
# nvcc --version
168+
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
169+
# with:
170+
# lfs: true
171+
# - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
172+
# with:
173+
# python-version: ${{ inputs.python_version }}
174+
# - name: Override constraints
175+
# if: ${{ inputs.override_requirements != '' }}
176+
# run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}"
177+
# shell: bash
178+
# - name: Install NNCF and test requirements
179+
# run: pip install . -r tests/torch/requirements.txt
180+
# - name: Print installed modules
181+
# run: pip list
182+
# - name: Check CUDA
183+
# run: |
184+
# python -c "import torch; print(torch.cuda.is_available())"
185+
# - name: Run PyTorch precommit test scope
186+
# run: |
187+
# export PATH=/usr/local/cuda-12.4/bin${PATH:+:${PATH}}
188+
# export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
189+
# make test-torch-cuda
190+
191+
tensorflow:
192+
# timeout-minutes: 40
193+
# runs-on: ubuntu-latest-8-cores
194+
runs-on: ubuntu-latest
195+
if: ${{ inputs.python_version != '3.12' }}
196+
defaults:
197+
run:
198+
shell: bash
199+
env:
200+
DEBIAN_FRONTEND: noninteractive
201+
steps:
202+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
203+
with:
204+
lfs: true
205+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
206+
with:
207+
python-version: ${{ inputs.python_version }}
208+
- name: Override constraints
209+
if: ${{ inputs.override_requirements != '' }}
210+
run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}"
211+
shell: bash
212+
- name: Install NNCF and test requirements
213+
run: pip install . -r tests/tensorflow/requirements.txt
214+
- name: Print installed modules
215+
run: pip list
216+
- name: Run TensorFlow precommit test scope
217+
run: make test-tensorflow
218+
env:
219+
NUM_WORKERS: 6
220+
221+
tools:
222+
# timeout-minutes: 40
223+
runs-on: ubuntu-latest
224+
defaults:
225+
run:
226+
shell: bash
227+
steps:
228+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
229+
with:
230+
lfs: true
231+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
232+
with:
233+
python-version: ${{ inputs.python_version }}
234+
- name: Install test requirements
235+
run: pip install -r tests/tools/requirements.txt
236+
- name: Print installed modules
237+
run: pip list
238+
- name: Run tools precommit test scope
239+
run: pytest -ra tests/tools
240+
241+
pytorch2-cpu:
242+
# timeout-minutes: 40
243+
runs-on: ubuntu-latest
244+
defaults:
245+
run:
246+
shell: bash
247+
steps:
248+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
249+
with:
250+
lfs: true
251+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
252+
with:
253+
python-version: ${{ inputs.python_version }}
254+
- name: Override constraints
255+
if: ${{ inputs.override_requirements != '' }}
256+
run: python .github/scripts/override_constraints.py "${{ inputs.override_requirements }}"
257+
shell: bash
258+
- name: Install NNCF and test requirements
259+
run: |
260+
pip install . -r tests/torch2/requirements.txt
261+
- name: Print installed modules
262+
run: pip list
263+
- name: Run torch2 precommit test scope
264+
run: pytest -ra tests/torch2 -m "not cuda"

0 commit comments

Comments
 (0)