From 2c79d987b685ef5e87b2062518598e9c1cf64c78 Mon Sep 17 00:00:00 2001 From: Helena Kloosterman Date: Wed, 5 Jun 2024 16:57:45 +0200 Subject: [PATCH] Add setuptools to fix issue with Python 3.12, add Windows to OpenVINO 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 --- .github/workflows/test_openvino.yml | 7 ++++--- .github/workflows/test_openvino_basic.yml | 21 ++++++++++++------- .github/workflows/test_openvino_examples.yml | 2 +- .github/workflows/test_openvino_notebooks.yml | 2 +- setup.py | 2 +- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test_openvino.yml b/.github/workflows/test_openvino.yml index c7d20eb321..0411ca81f7 100644 --- a/.github/workflows/test_openvino.yml +++ b/.github/workflows/test_openvino.yml @@ -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 @@ -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 + diff --git a/.github/workflows/test_openvino_basic.yml b/.github/workflows/test_openvino_basic.yml index 3135e6c004..240428e70a 100644 --- a/.github/workflows/test_openvino_basic.yml +++ b/.github/workflows/test_openvino_basic.yml @@ -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 }} @@ -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 \ No newline at end of file + + - name: Slow tests + run: | + pytest tests/openvino/test_modeling.py -s -m "run_slow" --durations=0 + env: + RUN_SLOW: 1 diff --git a/.github/workflows/test_openvino_examples.yml b/.github/workflows/test_openvino_examples.yml index 747afa31b5..c76374e9ea 100644 --- a/.github/workflows/test_openvino_examples.yml +++ b/.github/workflows/test_openvino_examples.yml @@ -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 diff --git a/.github/workflows/test_openvino_notebooks.yml b/.github/workflows/test_openvino_notebooks.yml index ed77077e87..34017e0baf 100644 --- a/.github/workflows/test_openvino_notebooks.yml +++ b/.github/workflows/test_openvino_notebooks.yml @@ -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 diff --git a/setup.py b/setup.py index 02d7f28450..b8869f46ac 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,7 @@ "optimum~=1.20", "datasets>=1.4.0", "sentencepiece", + "setuptools", "scipy", "onnx", ] @@ -49,7 +50,6 @@ "rjieba", "timm", "invisible-watermark>=0.2.0", - "auto-gptq", "transformers_stream_generator", "einops", "tiktoken",