From c61825ed7acfef1c0f5fe18991f8a6e3abb5d7c6 Mon Sep 17 00:00:00 2001 From: Helena Date: Wed, 5 Jun 2024 10:53:55 +0000 Subject: [PATCH 1/3] Add Windows to basic test, update Python versions --- .github/workflows/test_openvino.yml | 6 +++--- .github/workflows/test_openvino_basic.yml | 20 +++++++++++-------- .github/workflows/test_openvino_examples.yml | 2 +- .github/workflows/test_openvino_notebooks.yml | 2 +- setup.py | 1 + 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test_openvino.yml b/.github/workflows/test_openvino.yml index c7d20eb321..a8509eef9c 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 diff --git a/.github/workflows/test_openvino_basic.yml b/.github/workflows/test_openvino_basic.yml index 3135e6c004..fcf4fed260 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,16 @@ 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 (Linux) + run: | + RUN_SLOW=1 pytest tests/openvino/test_modeling.py -s -m "run_slow" --durations=0 + if: runner.os == 'Linux' 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..eee2614cf7 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,7 @@ "optimum~=1.20", "datasets>=1.4.0", "sentencepiece", + "setuptools", "scipy", "onnx", ] From 6e4d5a8a0fddc313866b91aed2ac76500bbd61de Mon Sep 17 00:00:00 2001 From: Helena Date: Wed, 5 Jun 2024 11:01:48 +0000 Subject: [PATCH 2/3] Remove auto-gptq dependency auto-gptq install breaks with Python 3.12 --- .github/workflows/test_openvino.yml | 3 ++- .github/workflows/test_openvino_basic.yml | 1 + setup.py | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_openvino.yml b/.github/workflows/test_openvino.yml index a8509eef9c..0411ca81f7 100644 --- a/.github/workflows/test_openvino.yml +++ b/.github/workflows/test_openvino.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.8, 3.12] + python-version: ["3.8", "3.12"] os: [ubuntu-latest] runs-on: ${{ matrix.os }} @@ -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 fcf4fed260..4cf603ee85 100644 --- a/.github/workflows/test_openvino_basic.yml +++ b/.github/workflows/test_openvino_basic.yml @@ -56,3 +56,4 @@ jobs: run: | RUN_SLOW=1 pytest tests/openvino/test_modeling.py -s -m "run_slow" --durations=0 if: runner.os == 'Linux' + diff --git a/setup.py b/setup.py index eee2614cf7..b8869f46ac 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,6 @@ "rjieba", "timm", "invisible-watermark>=0.2.0", - "auto-gptq", "transformers_stream_generator", "einops", "tiktoken", From 2662edfb49e60535ee21ebdd829dfd0297481bf1 Mon Sep 17 00:00:00 2001 From: Helena Date: Wed, 5 Jun 2024 12:02:18 +0000 Subject: [PATCH 3/3] Run slow tests on Windows too --- .github/workflows/test_openvino_basic.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_openvino_basic.yml b/.github/workflows/test_openvino_basic.yml index 4cf603ee85..240428e70a 100644 --- a/.github/workflows/test_openvino_basic.yml +++ b/.github/workflows/test_openvino_basic.yml @@ -52,8 +52,8 @@ jobs: run: | pytest tests/openvino/test_modeling_basic.py - - name: Slow tests (Linux) + - name: Slow tests run: | - RUN_SLOW=1 pytest tests/openvino/test_modeling.py -s -m "run_slow" --durations=0 - if: runner.os == 'Linux' - + pytest tests/openvino/test_modeling.py -s -m "run_slow" --durations=0 + env: + RUN_SLOW: 1