Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean and clear CI #975

Merged
merged 22 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/build_pr_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Build PR documentation

on:
pull_request:
branches: [ main ]
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -18,20 +19,18 @@ jobs:
PR_CLONE_URL: ${{ github.event.pull_request.head.repo.clone_url }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
repository: 'huggingface/doc-builder'
repository: "huggingface/doc-builder"
path: doc-builder

- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
repository: 'huggingface/optimum-intel'
repository: "huggingface/optimum-intel"
path: optimum-intel

- name: Setup environment
run: |
python -m venv venv-doc
source venv-doc/bin/activate
IlyasMoutawwakil marked this conversation as resolved.
Show resolved Hide resolved
pip uninstall -y doc-builder
cd doc-builder
git pull origin main
Expand Down
54 changes: 0 additions & 54 deletions .github/workflows/check_code_quality.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Quality Checks
on:
push:
branches:
- main

pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
quality:
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install dependencies
run: |
pip install --upgrade pip
# TODO: we should remove the the version pinning at some point
pip install "black~=23.1" "ruff==0.4.4"

- name: Check style with black
run: |
black --check .

- name: Check style with ruff
run: |
ruff check .
44 changes: 24 additions & 20 deletions .github/workflows/test_generation.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Intel Generation Utils - Test
name: Generation Utils - Test (deprecated)

on:
push:
branches: [ main ]
branches:
- main
- v*-release
pull_request:
branches: [ main ]
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -17,22 +18,25 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9]
python-version: ["3.9"]
IlyasMoutawwakil marked this conversation as resolved.
Show resolved Hide resolved
os: [ubuntu-latest]

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

steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install transformers==4.43.*
pip install optimum[exporters]
pip install .[tests]
- name: Test with Pytest
run: |
pytest tests/generation/
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install dependencies
run: |
pip install --upgrade pip
pip install .[tests] transformers[testing]==4.43.*

- name: Test with Pytest
run: |
pytest tests/generation/
55 changes: 29 additions & 26 deletions .github/workflows/test_inc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Intel Neural Compressor - Test
name: INC - Test

on:
push:
Expand All @@ -20,31 +18,36 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9]
torch-version: ["2.2.0", "2.3.*", "2.4.*"]
python-version: ["3.9"]
os: [ubuntu-latest]

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

steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install cmake
pip install py-cpuinfo
pip install torch==2.3.0 torchaudio==2.3.0 torchvision==0.18 --index-url https://download.pytorch.org/whl/cpu
pip install intel-extension-for-pytorch==2.3.0
pip install datasets==2.19.0
pip install .[neural-compressor,diffusers,tests]
pip install peft

- name: Test with Pytest
run: |
pytest tests/neural_compressor/ --ignore tests/neural_compressor/test_ipex.py --durations=0
- name: Test IPEX
run: |
pytest tests/neural_compressor/test_ipex.py
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install dependencies
run: |
pip install --upgrade pip
pip install torch==${{ matrix.torch-version }} torchaudio torchvision --index-url https://download.pytorch.org/whl/cpu
pip install .[neural-compressor,ipex,diffusers,peft,tests] transformers[testing] intel-extension-for-pytorch==${{ matrix.torch-version }}

- if: ${{ matrix.torch-version == '2.2.0' }}
name: Downgrade Numpy
run: pip install numpy==1.*

- name: Assert versions
run: |
python -c "import torch; print(torch.__version__); assert torch.__version__.startswith('${{ matrix.torch-version }}'.replace('.*', ''))"
python -c "import intel_extension_for_pytorch; print(intel_extension_for_pytorch.__version__); assert intel_extension_for_pytorch.__version__.startswith('${{ matrix.torch-version }}'.replace('.*', ''))"

- name: Test with Pytest
run: |
pytest tests/neural_compressor
45 changes: 24 additions & 21 deletions .github/workflows/test_ipex.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Intel IPEX - Test
name: IPEX - Test

on:
push:
Expand All @@ -17,36 +15,41 @@ concurrency:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.9]
torch-version: ["2.2.0", "2.3.*", "2.4.*"]
transformers-version: ["4.39.0", "4.44.*"]
ipex-version: ["2.2.0", "2.3.*"]
include:
- python-version: 3.8
transformers-version: 4.39.0
ipex-version: 2.2.0
python-version: [3.9]
os: [ubuntu-latest]

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

steps:
- uses: actions/checkout@v2
- name: Checkout code
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
run: |
python -m pip install --upgrade pip
pip install torch==${{ matrix.ipex-version }} --extra-index-url https://download.pytorch.org/whl/cpu
pip install intel_extension_for_pytorch==${{ matrix.ipex-version }}
pip install Pillow parameterized
pip install transformers[testing]==${{ matrix.transformers-version }}
pip install .[ipex]

- if: ${{ matrix.ipex-version == '2.2.0' }}
pip install --upgrade pip
pip install torch==${{ matrix.torch-version }} torchaudio torchvision --extra-index-url https://download.pytorch.org/whl/cpu
pip install .[ipex,tests] transformers[testing]==${{ matrix.transformers-version }} intel_extension_for_pytorch==${{ matrix.torch-version }}

- if: ${{ matrix.torch-version == '2.2.0' }}
name: Downgrade Numpy
run: pip install numpy==1.*

- name: Assert versions
run: |
python -c "import torch; print(torch.__version__); assert torch.__version__.startswith('${{ matrix.torch-version }}'.replace('.*', ''))"
python -c "import intel_extension_for_pytorch; print(intel_extension_for_pytorch.__version__); assert intel_extension_for_pytorch.__version__.startswith('${{ matrix.torch-version }}'.replace('.*', ''))"
python -c "import transformers; print(transformers.__version__); assert transformers.__version__.startswith('${{ matrix.transformers-version }}'.replace('.*', ''))"

- name: Test with Pytest
run: |
pytest tests/ipex/
pytest tests/ipex
19 changes: 13 additions & 6 deletions .github/workflows/test_offline.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Offline usage / Python - Test
name: Offline - Test

on:
push:
branches: [main]
branches:
- main
- v*-release
pull_request:
branches: [main]
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -15,19 +18,23 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.9]
python-version: ["3.9"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install .[tests,openvino]

- name: Test
run: |
HF_HOME=/tmp/ huggingface-cli download hf-internal-testing/tiny-random-gpt2
Expand Down
Loading
Loading