Skip to content

Commit

Permalink
merge main in branch
Browse files Browse the repository at this point in the history
  • Loading branch information
echarlaix committed Dec 18, 2024
2 parents fd15bd3 + 4daa408 commit a47cd96
Show file tree
Hide file tree
Showing 42 changed files with 1,193 additions and 317 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/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'
17 changes: 7 additions & 10 deletions .github/workflows/test_onnxruntime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,19 @@ jobs:
fail-fast: false
matrix:
transformers-version: ["latest"]
os: [ubuntu-20.04, windows-2019, macos-13]
os: [ubuntu-20.04, windows-2019, macos-15]
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
Expand All @@ -52,13 +51,11 @@ jobs:
run: pip install transformers==${{ matrix.transformers-version }}

- 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 -s
- name: Test with pytest (in parallel)
run: |
pytest tests/onnxruntime -m "not run_in_series" --durations=0 -vvvv -s -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
11 changes: 10 additions & 1 deletion .github/workflows/test_utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@ jobs:
- name: Test with pytest
working-directory: tests
run: |
python -m pytest -s -vvvv utils
pytest utils -s -n auto -m "not datasets_test" --durations=0
- name: Install datasets
run: |
pip install datasets
- name: Tests needing datasets
working-directory: tests
run: |
pytest utils -s -n auto -m "datasets_test" --durations=0
2 changes: 1 addition & 1 deletion docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nikolaik/python-nodejs:python3.8-nodejs18
FROM nikolaik/python-nodejs:python3.9-nodejs18

ARG commit_sha
ARG clone_url
Expand Down
5 changes: 5 additions & 0 deletions docs/source/exporters/onnx/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Supported architectures from [🤗 Transformers](https://huggingface.co/docs/tra
- Data2VecVision
- Deberta
- Deberta-v2
- Decision Transformer
- Deit
- Detr
- DINOv2
Expand Down Expand Up @@ -67,6 +68,7 @@ Supported architectures from [🤗 Transformers](https://huggingface.co/docs/tra
- MarkupLM
- Maskformer
- MBart
- MGP-STR
- Mistral
- MobileBert
- MobileVit
Expand All @@ -76,6 +78,8 @@ Supported architectures from [🤗 Transformers](https://huggingface.co/docs/tra
- MT5
- Musicgen (text-conditional only)
- Nystromformer
- OLMo
- OLMo2
- OWL-ViT
- Pegasus
- Perceiver
Expand All @@ -86,6 +90,7 @@ Supported architectures from [🤗 Transformers](https://huggingface.co/docs/tra
- PVT
- Qwen2(Qwen1.5)
- RegNet
- RemBERT
- ResNet
- Roberta
- Roformer
Expand Down
6 changes: 1 addition & 5 deletions docs/source/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The packages below enable you to get the best of the 🤗 Hugging Face ecosystem
<p class="text-gray-700">Accelerate your training and inference workflows with <span class="underline" onclick="event.preventDefault(); window.open('https://aws.amazon.com/machine-learning/trainium/', '_blank');">AWS Trainium</span> and <span class="underline" onclick="event.preventDefault(); window.open('https://aws.amazon.com/machine-learning/inferentia/', '_blank');">AWS Inferentia</span></p>
</a>
<a class="!no-underline border dark:border-gray-700 p-5 rounded-lg shadow hover:shadow-lg" href="https://huggingface.co/docs/optimum-tpu/index"
><div class="w-full text-center bg-gradient-to-tr from-blue-200 to-blue-600 rounded-lg py-1.5 font-semibold mb-5 text-white text-lg leading-relaxed">Google TPUs</div>
><div class="w-full text-center bg-gradient-to-tr from-blue-500 to-blue-600 rounded-lg py-1.5 font-semibold mb-5 text-white text-lg leading-relaxed">Google TPUs</div>
<p class="text-gray-700">Accelerate your training and inference workflows with <span class="underline" onclick="event.preventDefault(); window.open('https://cloud.google.com/tpu', '_blank');">Google TPUs</span></p>
</a>
<a class="!no-underline border dark:border-gray-700 p-5 rounded-lg shadow hover:shadow-lg" href="./habana/index"
Expand All @@ -57,10 +57,6 @@ The packages below enable you to get the best of the 🤗 Hugging Face ecosystem
</div>
</div>

> [!TIP]
> Some packages provide hardware-agnostic features (e.g. INC interface in Optimum Intel).

## Open-source integrations

🤗 Optimum also supports a variety of open-source frameworks to make model optimization very easy.
Expand Down
1 change: 1 addition & 0 deletions optimum/exporters/onnx/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ def fix_dynamic_axes(
input_shapes = {}
dummy_inputs = self.generate_dummy_inputs(framework="np", **input_shapes)
dummy_inputs = self.generate_dummy_inputs_for_validation(dummy_inputs, onnx_input_names=onnx_input_names)
dummy_inputs = self.rename_ambiguous_inputs(dummy_inputs)

onnx_inputs = {}
for name, value in dummy_inputs.items():
Expand Down
4 changes: 4 additions & 0 deletions optimum/exporters/onnx/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,10 @@ def onnx_export_from_model(
if tokenizer_2 is not None:
tokenizer_2.save_pretrained(output.joinpath("tokenizer_2"))

tokenizer_3 = getattr(model, "tokenizer_3", None)
if tokenizer_3 is not None:
tokenizer_3.save_pretrained(output.joinpath("tokenizer_3"))

model.save_config(output)

if float_dtype == "bf16":
Expand Down
Loading

0 comments on commit a47cd96

Please sign in to comment.