Skip to content

Commit

Permalink
Merge branch 'main' into add-hiera-onnx
Browse files Browse the repository at this point in the history
  • Loading branch information
xenova authored Nov 14, 2024
2 parents 86706d1 + 35eebfe commit 2fa69b4
Show file tree
Hide file tree
Showing 113 changed files with 4,383 additions and 4,876 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build_main_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
build_documentation:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -57,6 +57,7 @@ jobs:
- name: Free disk space
run: |
df -h
sudo apt-get update
sudo apt-get purge -y '^apache.*'
sudo apt-get purge -y '^imagemagick.*'
sudo apt-get purge -y '^dotnet.*'
Expand All @@ -66,7 +67,7 @@ jobs:
sudo apt-get purge -y '^mysql.*'
sudo apt-get purge -y '^java.*'
sudo apt-get purge -y '^openjdk.*'
sudo apt-get purge -y microsoft-edge-stable google-cloud-cli azure-cli google-chrome-stable firefox powershell mono-devel
sudo apt-get purge -y microsoft-edge-stable azure-cli google-chrome-stable firefox mono-devel
df -h
sudo apt-get autoremove -y >/dev/null 2>&1
sudo apt-get clean
Expand Down Expand Up @@ -110,6 +111,8 @@ jobs:
- name: Setup environment
run: |
python -m venv venv-doc
source venv-doc/bin/activate
pip uninstall -y doc-builder
cd doc-builder
git pull origin main
Expand All @@ -135,6 +138,7 @@ jobs:
- name: Make Furiosa documentation
run: |
source venv-doc/bin/activate
cd optimum-furiosa
pip install .
sudo apt install software-properties-common
Expand All @@ -159,6 +163,7 @@ jobs:
- name: Make TPU documentation
run: |
sudo docker system prune -a -f
source venv-doc/bin/activate
cd optimum-tpu
pip install -U pip
pip install . -f https://storage.googleapis.com/libtpu-releases/index.html
Expand Down Expand Up @@ -192,6 +197,7 @@ jobs:
- name: Push to repositories
run: |
source venv-doc/bin/activate
cd optimum/optimum-doc-build
sudo chmod -R ugo+rwx optimum
doc-builder push optimum --doc_build_repo_id "hf-doc-build/doc-build" --token "${{ secrets.HF_DOC_BUILD_PUSH }}" --commit_msg "Updated with commit ${{ github.sha }} See: https://github.com/huggingface/optimum/commit/${{ github.sha }}" --n_retries 5 --upload_version_yml
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build_pr_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ on:
- "optimum/**.py"
- "docs/**.mdx"
- "docs/**.yml"
- ".github/workflows/build_pr_documentation.yml"

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

jobs:
build_documentation:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
PR_NUMBER: ${{ github.event.number }}
Expand Down Expand Up @@ -60,6 +61,8 @@ jobs:

- name: Setup environment
run: |
python -m venv venv-doc
source venv-doc/bin/activate
pip uninstall -y doc-builder
cd doc-builder
git pull origin main
Expand Down Expand Up @@ -99,6 +102,7 @@ jobs:
- name: Make TPU documentation
run: |
sudo docker system prune -a -f
source venv-doc/bin/activate
cd optimum-tpu
pip install -U pip
pip install . -f https://storage.googleapis.com/libtpu-releases/index.html
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
python-version: [3.9]
os: [ubuntu-20.04]

runs-on: ${{ matrix.os }}
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/dev_test_benckmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version:
- 3.8
- 3.9
os:
- ubuntu-20.04
runs-on: ${{ matrix.os }}
python-version: ['3.9', '3.11']
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/dev_test_bettertransformer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version:
- 3.8
os:
- ubuntu-20.04
- macos-13
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
python-version: '3.9'
- name: Install dependencies
run: |
pip install .[tests]
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/dev_test_dummy_inputs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version:
- 3.8
- 3.9
python-version: ['3.9', '3.11']
os:
- ubuntu-20.04
- macos-13
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/dev_test_exporters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version:
- 3.8
- 3.9
os:
- ubuntu-20.04
runs-on: ${{ matrix.os }}
python-version: ['3.9', '3.11']
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/dev_test_fx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version:
- 3.8
- 3.9
python-version: ['3.9', '3.11']
os:
- ubuntu-20.04
- macos-13
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/dev_test_onnx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version:
- 3.8
- 3.9
python-version: ['3.9', '3.11']
os:
- ubuntu-20.04
- macos-13
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/dev_test_onnxruntime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version:
- 3.8
- 3.9
python-version: ['3.9', '3.11']
os:
- ubuntu-20.04
- windows-2019
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/dev_test_optimum_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version:
- 3.7
- 3.8
- 3.9
python-version: ['3.9', '3.11']
os:
- ubuntu-20.04
- windows-2019
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
days-before-stale: 30
days-before-close: 5
30 changes: 15 additions & 15 deletions .github/workflows/test_benckmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: Benchmark suite / Python - Test

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -17,20 +17,20 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9]
python-version: [3.9]
os: [ubuntu-20.04]

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: |
pip install wheel
pip install .[tests,onnxruntime,benchmark]
- name: Test with unittest
run: |
python -m unittest discover --start-directory tests/benchmark --pattern 'test_*.py'
- 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: |
pip install wheel
pip install .[tests,onnxruntime,benchmark]
- name: Test with unittest
run: |
python -m unittest discover --start-directory tests/benchmark --pattern 'test_*.py'
5 changes: 2 additions & 3 deletions .github/workflows/test_bettertransformer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9]
os: [ubuntu-20.04, macos-13]
exclude: [{ python-version: 3.8, os: macos-13 }]
python-version: [3.9]
os: [ubuntu-20.04, macos-14]

runs-on: ${{ matrix.os }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9]
python-version: [3.9]
os: [ubuntu-20.04, macos-13]

runs-on: ${{ matrix.os }}
Expand All @@ -34,7 +34,7 @@ jobs:
run: |
pip install --upgrade pip
pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install .[tests,exporters,exporters-tf]
pip install .[tests,exporters-tf]
- name: Test with pytest
run: |
Expand Down
44 changes: 22 additions & 22 deletions .github/workflows/test_export_onnx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Exporters ONNX / Python - Test

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -15,27 +15,27 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9]
python-version: ['3.9']
os: [ubuntu-20.04]

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 for pytorch export
run: |
pip install .[tests,exporters]
- name: Test with unittest
working-directory: tests
run: |
pytest exporters/onnx/test_onnx_*.py -s -n auto -m "not tensorflow_test and not timm_test" --durations=0
- name: Install dependencies for tensorflow export
run: |
pip install .[tests,exporters-tf]
- name: Test with unittest
working-directory: tests
run: |
pytest exporters/onnx/test_onnx_*.py -n auto -m "tensorflow_test" -s --durations=0
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for pytorch export
run: |
pip install .[tests,exporters]
- name: Test with unittest
working-directory: tests
run: |
pytest exporters/onnx/test_onnx_*.py -s -n auto -m "not tensorflow_test and not timm_test" --durations=0
- name: Install dependencies for tensorflow export
run: |
pip install .[tests,exporters-tf]
- name: Test with unittest
working-directory: tests
run: |
pytest exporters/onnx/test_onnx_*.py -n auto -m "tensorflow_test" -s --durations=0
Loading

0 comments on commit 2fa69b4

Please sign in to comment.