Skip to content

Commit

Permalink
resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ariG23498 committed Feb 11, 2025
2 parents cccc05c + afff2fa commit 23e3b12
Show file tree
Hide file tree
Showing 96 changed files with 3,934 additions and 2,136 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/build_main_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ jobs:
repository: 'huggingface/doc-builder'
path: doc-builder

- uses: actions/checkout@v2
with:
repository: 'huggingface/doc-build'
path: doc-build
token: ${{ secrets.HUGGINGFACE_PUSH }}

- uses: actions/checkout@v2
with:
repository: 'huggingface/optimum'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_pr_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
echo ${{ env.COMMIT_SHA }} > ./commit_sha
echo ${{ env.PR_NUMBER }} > ./pr_number
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: doc-build-artifact
path: optimum-doc-build/
2 changes: 1 addition & 1 deletion .github/workflows/dev_test_benckmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install dependencies
run: |
pip install wheel
pip install .[tests,onnxruntime,benchmark]
pip install .[tests,onnxruntime,benchmark] datasets
pip install -U git+https://github.com/huggingface/evaluate
pip install -U git+https://github.com/huggingface/diffusers
pip install -U git+https://github.com/huggingface/transformers
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@ on:
schedule:
- cron: '30 1 * * *'

permissions:
issues: write
pull-requests: write

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
stale-issue-message: 'This issue has been marked as stale because it has been open for 30 days with no activity. This thread will be automatically closed in 5 days if no further activity occurs.'
stale-pr-message: 'This PR has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.'
exempt-issue-labels: 'bug,exporters,good first issue,onnx,onnxruntime,quantization'
days-before-issue-stale: 30
days-before-issue-close: 5
days-before-pr-stale: 90
days-before-pr-close: 30
exempt-all-pr-assignees: true
2 changes: 1 addition & 1 deletion .github/workflows/test_benckmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install dependencies
run: |
pip install wheel
pip install .[tests,onnxruntime,benchmark]
pip install .[tests,onnxruntime,benchmark] datasets
- name: Test with unittest
run: |
python -m unittest discover --start-directory tests/benchmark --pattern 'test_*.py'
2 changes: 1 addition & 1 deletion .github/workflows/test_bettertransformer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
python-version: [3.9]
os: [ubuntu-20.04, macos-14]
os: [ubuntu-20.04]

runs-on: ${{ matrix.os }}
steps:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test_export_onnx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9']
python-version: ["3.9"]
os: [ubuntu-20.04]

runs-on: ${{ matrix.os }}
Expand All @@ -27,13 +27,14 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for pytorch export
run: |
pip install .[tests,exporters]
pip install .[tests,exporters,diffusers]
- 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 uninstall diffusers -y
pip install .[tests,exporters-tf]
- name: Test with unittest
working-directory: tests
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/test_export_onnx_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: Exporters ONNX CLI / 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,20 +17,24 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.9]
python-version: ["3.9"]
os: [ubuntu-20.04]

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

steps:
- uses: actions/checkout@v2
- name: Checkout repository
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 for pytorch export

- name: Install dependencies
run: |
pip install .[tests,exporters]
- name: Test with unittest
working-directory: tests
pip install .[tests,exporters,diffusers]
- name: Test with pytest
run: |
pytest exporters/onnx/test_exporters_onnx_cli.py -n auto -m "not tensorflow_test and not timm_test" -s --durations=0
pytest tests/exporters/onnx/test_exporters_onnx_cli.py -n auto -m "not tensorflow_test and not timm_test" -s --durations=0
41 changes: 21 additions & 20 deletions .github/workflows/test_exporters_slow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,27 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9']
python-version: ["3.9"]

runs-on: ubuntu-20.04
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: |
RUN_SLOW=1 pytest exporters -s -m "not tensorflow_test and run_slow" --durations=0
- name: Install dependencies for tensorflow export
run: |
pip install .[tests,exporters-tf]
- name: Test with unittest
working-directory: tests
run: |
RUN_SLOW=1 pytest exporters -s -m "tensorflow_test and run_slow" --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,diffusers]
- name: Test with unittest
working-directory: tests
run: |
RUN_SLOW=1 pytest exporters -s -m "not tensorflow_test and run_slow" --durations=0
- name: Install dependencies for tensorflow export
run: |
pip uninstall diffusers -y
pip install .[tests,exporters-tf]
- name: Test with unittest
working-directory: tests
run: |
RUN_SLOW=1 pytest exporters -s -m "tensorflow_test and run_slow" --durations=0
2 changes: 1 addition & 1 deletion .github/workflows/test_onnx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install .[tests,exporters]
pip install .[tests,exporters,diffusers]
- name: Test with unittest
working-directory: tests
run: |
Expand Down
37 changes: 20 additions & 17 deletions .github/workflows/test_onnxruntime.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# 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: ONNX Runtime / 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 @@ -18,47 +18,50 @@ jobs:
fail-fast: false
matrix:
transformers-version: ["latest"]
os: [ubuntu-20.04, windows-2019, macos-13]
os: [ubuntu-20.04, windows-2019] # TODO : add macos-15 after mps fix
include:
- transformers-version: "4.36.*"
os: ubuntu-20.04
- transformers-version: "4.45.*"
os: ubuntu-20.04

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

steps:
- name: Free Disk Space (Ubuntu)
if: matrix.os == 'ubuntu-20.04'
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
swap-storage: false
large-packages: false

- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: "3.9"

- name: Install dependencies
run: |
pip install --upgrade pip
pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install .[tests,onnxruntime]
pip install .[tests,onnxruntime,diffusers]
- name: Install transformers ${{ matrix.transformers-version }}
if: ${{ matrix.transformers-version != 'latest' }}
run: pip install transformers==${{ matrix.transformers-version }}
run: |
pip install "transformers==${{ matrix.transformers-version }}"
- name: Downgrade diffusers
if: matrix.transformers-version == '4.36.*'
run: |
pip install "diffusers<0.32.0"
- name: Test with pytest (in series)
working-directory: tests
run: |
pytest onnxruntime -m "run_in_series" --durations=0 -vvvv -s
pytest tests/onnxruntime -m "run_in_series" --durations=0 -vvvv
- name: Test with pytest (in parallel)
run: |
pytest tests/onnxruntime -m "not run_in_series" --durations=0 -vvvv -n auto
env:
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
working-directory: tests
run: |
pytest onnxruntime -m "not run_in_series" --durations=0 -vvvv -s -n auto
58 changes: 41 additions & 17 deletions .github/workflows/test_onnxruntime_gpu.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,54 @@
name: ONNX Runtime / Test GPU
name: ONNX Runtime GPU / Python - Test

on:
workflow_dispatch:
schedule:
- cron: 0 1 */3 * * # at 1am every 3 days
- cron: 0 7 * * * # every day at 7am UTC
pull_request:
types: [opened, synchronize, reopened, labeled]
# uncomment to enable on PR merge on main branch:
#push:
# branches:
# - main
branches:
- main
types:
- opened
- labeled
- reopened
- unlabeled
- synchronize

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

jobs:
do-the-job:
if: ${{ (github.event_name == 'workflow_dispatch') || (github.event_name == 'schedule') || contains( github.event.pull_request.labels.*.name, 'gpu-test') }}
name: Start self-hosted EC2 runner
build:
if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
contains(github.event.pull_request.labels.*.name, 'gpu') ||
contains(github.event.pull_request.labels.*.name, 'onnxruntime-gpu')
}}

runs-on:
group: aws-g6-4xlarge-plus
env:
AWS_REGION: us-east-1

container:
image: nvcr.io/nvidia/tensorrt:24.12-py3
options: --gpus all

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build image
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.9"

- name: Install dependencies
run: |
docker build -f tests/onnxruntime/docker/Dockerfile_onnxruntime_gpu -t onnxruntime-gpu .
- name: Test with unittest within docker container
pip install --upgrade pip
pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
pip install .[tests,onnxruntime-gpu,diffusers]
- name: Test with pytest
run: |
docker run --rm --gpus all -v /mnt/cache/.cache/huggingface:/root/.cache/huggingface --workdir=/workspace/optimum/tests onnxruntime-gpu:latest
pytest tests/onnxruntime -m "cuda_ep_test or trt_ep_test" --durations=0 -vvvv -n auto
Loading

0 comments on commit 23e3b12

Please sign in to comment.