Skip to content

Commit

Permalink
Add setuptools to fix issue with Python 3.12, add Windows to OpenVINO…
Browse files Browse the repository at this point in the history
… basic test (#747)

* Add Windows to basic test, update Python versions

* Remove auto-gptq dependency

auto-gptq install breaks with Python 3.12

* Run slow tests on Windows too
  • Loading branch information
helena-intel authored Jun 5, 2024
1 parent 8dd2a89 commit 2c79d98
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/test_openvino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.11]
python-version: ["3.8", "3.12"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -46,3 +46,4 @@ jobs:
pip install openvino-nightly
python -c "from optimum.intel import OVModelForCausalLM; OVModelForCausalLM.from_pretrained('hf-internal-testing/tiny-random-gpt2', export=True, compile=False)"
optimum-cli export openvino -m hf-internal-testing/tiny-random-gpt2 gpt2-ov
21 changes: 13 additions & 8 deletions .github/workflows/test_openvino_basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ jobs:
matrix:
# Testing lower and upper bound of supported Python versions
# This also ensures that the test fails if dependencies break for Python 3.7
python-version: ["3.8", "3.11"]
transformers: ['transformers']
python-version: ["3.8", "3.12"]
optimum: ['optimum', 'git+https://github.com/huggingface/optimum.git']
os: ["ubuntu-22.04", "windows-latest"]

runs-on: ubuntu-20.04
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -43,12 +43,17 @@ jobs:
# optimum or transformers to a specific version
# Install PyTorch CPU to prevent unnecessary downloading/installing of CUDA packages
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install .[tests] openvino onnx onnxruntime ${{ matrix.optimum}} ${{ matrix.transformers }}
pip install .[tests] openvino onnxruntime ${{ matrix.optimum}}
- name: Pip freeze
- name: Pip freeze
run: pip freeze

- name: Test with Pytest
run: |
pytest tests/openvino/test_modeling_basic.py
RUN_SLOW=1 pytest tests/openvino/test_modeling.py -s -m "run_slow" --durations=0
- name: Slow tests
run: |
pytest tests/openvino/test_modeling.py -s -m "run_slow" --durations=0
env:
RUN_SLOW: 1
2 changes: 1 addition & 1 deletion .github/workflows/test_openvino_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.11"]
python-version: ["3.8", "3.12"]

runs-on: ubuntu-22.04

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_openvino_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.11"]
python-version: ["3.8", "3.12"]

runs-on: ubuntu-22.04

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"optimum~=1.20",
"datasets>=1.4.0",
"sentencepiece",
"setuptools",
"scipy",
"onnx",
]
Expand All @@ -49,7 +50,6 @@
"rjieba",
"timm",
"invisible-watermark>=0.2.0",
"auto-gptq",
"transformers_stream_generator",
"einops",
"tiktoken",
Expand Down

0 comments on commit 2c79d98

Please sign in to comment.