1
- # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3
- name : Intel Neural Compressor - Test
1
+ name : INC - Test
4
2
5
3
on :
6
4
push :
@@ -20,31 +18,34 @@ jobs:
20
18
strategy :
21
19
fail-fast : false
22
20
matrix :
23
- python-version : ["3.9", "3.11"]
24
- os : [ubuntu-latest]
21
+ torch-version : ["2.2.0", "2.3.*", "2.4.*"]
22
+
23
+ runs-on : ubuntu-22.04
25
24
26
- runs-on : ${{ matrix.os }}
27
25
steps :
28
- - uses : actions/checkout@v2
29
- - name : Setup Python ${{ matrix.python-version }}
30
- uses : actions/setup-python@v2
31
- with :
32
- python-version : ${{ matrix.python-version }}
33
- - name : Install dependencies
34
- run : |
35
- python -m pip install --upgrade pip
36
- pip install cmake
37
- pip install py-cpuinfo
38
- pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cpu
39
- pip install intel-extension-for- pytorch==2.4.0
40
- pip install datasets==2.19.0
41
- pip install .[neural-compressor,diffusers,tests]
42
- pip install peft
43
-
44
- - name : Test with Pytest
45
- run : |
46
- pytest tests/neural_compressor/ --ignore tests/neural_compressor/test_ipex.py --durations=0
47
- - name : Test IPEX
48
- run : |
49
- pytest tests/neural_compressor/test_ipex.py
26
+ - name : Checkout code
27
+ uses : actions/checkout@v4
28
+
29
+ - name : Setup Python
30
+ uses : actions/setup-python@v5
31
+ with :
32
+ python-version : 3.9
33
+
34
+ - name : Install dependencies
35
+ run : |
36
+ pip install --upgrade pip
37
+ pip install torch==${{ matrix.torch-version }} torchaudio torchvision --index-url https://download. pytorch.org/whl/cpu
38
+ pip install .[neural-compressor,ipex,diffusers,peft,tests] transformers[testing] intel-extension-for-pytorch==${{ matrix.torch-version }}
39
+
40
+ - if : ${{ matrix.torch-version == '2.2.0' }}
41
+ name : Downgrade Numpy
42
+ run : pip install numpy==1.*
43
+
44
+ - name : Assert versions
45
+ run : |
46
+ python -c "import torch; print(torch.__version__); assert torch.__version__.startswith('${{ matrix.torch-version }}'.replace('.*', ''))"
47
+ python -c "import intel_extension_for_pytorch; print(intel_extension_for_pytorch.__version__); assert intel_extension_for_pytorch.__version__.startswith('${{ matrix.torch-version }}'.replace('.*', ''))"
50
48
49
+ - name : Test with Pytest
50
+ run : |
51
+ pytest tests/neural_compressor
0 commit comments