Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/directml
Browse files Browse the repository at this point in the history
  • Loading branch information
kazssym committed Jan 12, 2025
2 parents 6134c8c + adcae38 commit 19c1db4
Show file tree
Hide file tree
Showing 229 changed files with 13,886 additions and 6,973 deletions.
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,13 @@ Fixes # (issue)
- [ ] Did you make sure to update the documentation with your changes?
- [ ] Did you write any new necessary tests?

## Who can review?

<!--
For faster review, we strongly recommend you to ping the following people:
- ONNX / ONNX Runtime : @fxmarty, @echarlaix, @JingyaHuang, @michaelbenayoun
- ONNX Runtime Training: @JingyaHuang
- BetterTransformer: @fxmarty
- GPTQ, quantization: @fxmarty, @SunMarc
- TFLite export: @michaelbenayoun
-->
34 changes: 25 additions & 9 deletions .github/workflows/build_main_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,14 @@ on:

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

steps:
- uses: actions/checkout@v2
with:
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 All @@ -49,6 +43,11 @@ jobs:
repository: 'huggingface/optimum-amd'
path: optimum-amd

- uses: actions/checkout@v2
with:
repository: 'huggingface/optimum-tpu'
path: optimum-tpu

- name: Free disk space
run: |
df -h
Expand All @@ -62,7 +61,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 @@ -106,6 +105,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 @@ -131,8 +132,11 @@ jobs:
- name: Make Furiosa documentation
run: |
source venv-doc/bin/activate
cd optimum-furiosa
pip install .
sudo apt install software-properties-common
sudo add-apt-repository --remove https://packages.microsoft.com/ubuntu/22.04/prod
sudo apt update
sudo apt install -y ca-certificates apt-transport-https gnupg
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 5F03AFA423A751913F249259814F888B20B09A7E
Expand All @@ -150,6 +154,17 @@ jobs:
mv furiosa-doc-build ../optimum
cd ..
- 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
doc-builder build optimum.tpu docs/source/ --build_dir tpu-doc-build --version pr_$PR_NUMBER --version_tag_suffix "" --html --clean
mv tpu-doc-build ../optimum
cd ..
- name: Make AMD documentation
run: |
sudo docker system prune -a -f
Expand All @@ -171,11 +186,12 @@ jobs:
- name: Combine subpackage documentation
run: |
cd optimum
sudo python docs/combine_docs.py --subpackages nvidia amd intel neuron habana furiosa --version ${{ env.VERSION }}
sudo python docs/combine_docs.py --subpackages nvidia amd intel neuron tpu habana furiosa --version ${{ env.VERSION }}
cd ..
- 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
23 changes: 21 additions & 2 deletions .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 @@ -53,8 +54,15 @@ jobs:
repository: 'huggingface/optimum-amd'
path: optimum-amd

- uses: actions/checkout@v2
with:
repository: 'huggingface/optimum-tpu'
path: optimum-tpu

- 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 @@ -91,6 +99,17 @@ jobs:
sudo mv amd-doc-build ../optimum
cd ..
- 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
doc-builder build optimum.tpu docs/source/ --build_dir tpu-doc-build --version pr_$PR_NUMBER --version_tag_suffix "" --html --clean
mv tpu-doc-build ../optimum
cd ..
- name: Make Optimum documentation
run: |
sudo docker system prune -a -f
Expand All @@ -101,7 +120,7 @@ jobs:
- name: Combine subpackage documentation
run: |
cd optimum
sudo python docs/combine_docs.py --subpackages nvidia amd intel neuron habana furiosa --version pr_$PR_NUMBER
sudo python docs/combine_docs.py --subpackages nvidia amd intel neuron tpu habana furiosa --version pr_$PR_NUMBER
sudo mv optimum-doc-build ../
cd ..
Expand Down
58 changes: 24 additions & 34 deletions .github/workflows/check_code_quality.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
name: check_code_quality
name: Code Quality

on:
push:
branches: [ main ]
paths:
- "optimum/**.py"
- "tests/**.py"
- "examples/**.py"
branches: [main]

pull_request:
branches: [ main ]
paths:
- "optimum/**.py"
- "tests/**.py"
- "examples/**.py"
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -24,30 +16,28 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
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: Create and start a virtual environment
run: |
python -m venv venv
source venv/bin/activate
- name: Install dependencies
run: |
source venv/bin/activate
pip install --upgrade pip
pip install .[quality]
- name: Check style with black
run: |
source venv/bin/activate
black --check .
- name: Check style with ruff
run: |
source venv/bin/activate
ruff .
- 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 .[quality]
- name: Check style with black
run: |
black --check .
- name: Check style with ruff
run: |
ruff .
10 changes: 3 additions & 7 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 All @@ -27,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
10 changes: 4 additions & 6 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-latest
- 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 All @@ -35,4 +33,4 @@ jobs:
- name: Test with unittest
working-directory: tests
run: |
python -m unittest discover -s bettertransformer -p test_*.py
python -m unittest discover -s bettertransformer -p test_*.py
8 changes: 3 additions & 5 deletions .github/workflows/dev_test_dummy_inputs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version:
- 3.8
- 3.9
python-version: ['3.9', '3.11']
os:
- ubuntu-20.04
- macos-latest
- macos-13
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand All @@ -35,4 +33,4 @@ jobs:
- name: Test with unittest
working-directory: tests
run: |
python -m unittest discover -s utils -p test_*.py
python -m unittest discover -s utils -p test_*.py
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
8 changes: 3 additions & 5 deletions .github/workflows/dev_test_fx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version:
- 3.8
- 3.9
python-version: ['3.9', '3.11']
os:
- ubuntu-20.04
- macos-latest
- macos-13
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand All @@ -35,4 +33,4 @@ jobs:
- name: Test with unittest
working-directory: tests
run: |
python -m pytest fx/optimization/test_transformations.py --exitfirst
python -m pytest fx/optimization/test_transformations.py --exitfirst
8 changes: 3 additions & 5 deletions .github/workflows/dev_test_onnx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version:
- 3.8
- 3.9
python-version: ['3.9', '3.11']
os:
- ubuntu-20.04
- macos-latest
- macos-13
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand All @@ -34,4 +32,4 @@ jobs:
- name: Test with unittest
working-directory: tests
run: |
python -m unittest discover -s onnx -p test_*.py
python -m unittest discover -s onnx -p test_*.py
Loading

0 comments on commit 19c1db4

Please sign in to comment.