Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
441a21a
native namespace packages
IlyasMoutawwakil Sep 26, 2025
db2118c
docstring
IlyasMoutawwakil Sep 26, 2025
5c4a560
test
IlyasMoutawwakil Sep 26, 2025
559167b
style
IlyasMoutawwakil Sep 26, 2025
f55ca8c
Merge branch 'main' into namespace-command-loading
IlyasMoutawwakil Sep 26, 2025
f9ae71e
test cli exprters and pipelines
IlyasMoutawwakil Sep 26, 2025
b3b1db7
specify folder
IlyasMoutawwakil Sep 26, 2025
6bee398
path :/
IlyasMoutawwakil Sep 26, 2025
855d8c9
fixes
IlyasMoutawwakil Sep 26, 2025
db67dcd
fix
IlyasMoutawwakil Sep 26, 2025
f4d415b
extend
IlyasMoutawwakil Sep 26, 2025
1185d23
fix
IlyasMoutawwakil Sep 26, 2025
37a5fd3
final fix
IlyasMoutawwakil Sep 26, 2025
082f441
only keep one way for registering commands
IlyasMoutawwakil Sep 29, 2025
667a526
remove print
IlyasMoutawwakil Sep 29, 2025
278fcf8
revert load_subpackages
IlyasMoutawwakil Oct 1, 2025
967368c
style
IlyasMoutawwakil Oct 1, 2025
878e393
trigger
IlyasMoutawwakil Oct 1, 2025
8df084c
pip uninstall optimum optimum-onnx
IlyasMoutawwakil Oct 1, 2025
b5188a1
try using less of macos 15 (because of provisions)
IlyasMoutawwakil Oct 1, 2025
8e4b553
test provision issue with macos 14
IlyasMoutawwakil Oct 1, 2025
20d874b
fix node version for docs
IlyasMoutawwakil Oct 1, 2025
62d4ef5
use one macos 15
IlyasMoutawwakil Oct 1, 2025
64bc3de
use macos 14
IlyasMoutawwakil Oct 1, 2025
d74240b
no need to test macos everywhere
IlyasMoutawwakil Oct 1, 2025
37e7e76
better command registration that avoids importing the subpackages and…
IlyasMoutawwakil Oct 1, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/build_main_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "20"
cache-dependency-path: "kit/package-lock.json"

- name: Set up Python
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 @@ -30,7 +30,7 @@ jobs:
steps:
- uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "20"
cache-dependency-path: "kit/package-lock.json"

- name: Set up Python
Expand Down
40 changes: 33 additions & 7 deletions .github/workflows/test_cli.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Optimum CLI / Python - Test
name: Optimum CLI / Python - Test - Subpackage (ONNX)

on:
push:
Expand All @@ -11,21 +11,35 @@ concurrency:
cancel-in-progress: true

env:
UV_SYSTEM_PYTHON: 1
UV_TORCH_BACKEND: cpu
OPTIMUM_ONNX_REF: main
TRANSFORMERS_IS_CI: true

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-13, windows-2022]
python-version: ["3.9"]
python-version: [3.9]
runs-on: [ubuntu-22.04, windows-2022]

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

steps:
- name: Checkout code
- name: Checkout optimum
uses: actions/checkout@v4
with:
path: optimum
fetch-depth: 0

- name: checkout optimum-onnx
uses: actions/checkout@v4
with:
repository: huggingface/optimum-onnx
ref: ${{ env.OPTIMUM_ONNX_REF }}
path: optimum-onnx
fetch-depth: 0

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand All @@ -34,10 +48,22 @@ jobs:

- 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,exporters]
pip install --upgrade pip uv
uv pip install ./optimum-onnx[onnxruntime]
uv pip install ./optimum[tests]

- name: Test with pytest
run: |
pytest tests/cli -vvvv --durations=0
working-directory: optimum

- name: Install dependencies (editable mode)
run: |
uv pip uninstall optimum-onnx optimum
uv pip install -e ./optimum-onnx[onnxruntime]
uv pip install -e ./optimum[tests]

- name: Test with pytest (editable mode)
run: |
pytest tests/cli -vvvv --durations=0
working-directory: optimum
9 changes: 5 additions & 4 deletions .github/workflows/test_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ concurrency:
cancel-in-progress: true

env:
UV_SYSTEM_PYTHON: 1
UV_TORCH_BACKEND: cpu
TRANSFORMERS_IS_CI: true

jobs:
Expand All @@ -19,7 +21,7 @@ jobs:
fail-fast: false
matrix:
python-version: [3.9]
runs-on: [ubuntu-22.04, windows-2022, macos-14]
runs-on: [ubuntu-22.04, macos-14, windows-2022]

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

Expand All @@ -34,9 +36,8 @@ jobs:

- 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]
pip install --upgrade pip uv
uv pip install .[tests]

- name: Test with pytest
run: |
Expand Down
39 changes: 32 additions & 7 deletions .github/workflows/test_exporters_common.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Exporters Common / Python - Test
name: Exporters Common / Python - Test - Subpackage (ONNX)

on:
push:
Expand All @@ -11,21 +11,35 @@ concurrency:
cancel-in-progress: true

env:
UV_SYSTEM_PYTHON: 1
UV_TORCH_BACKEND: cpu
OPTIMUM_ONNX_REF: main
TRANSFORMERS_IS_CI: true

jobs:
build:
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-22.04]
python-version: [3.9]
runs-on: [ubuntu-22.04, windows-2022]

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

steps:
- name: Checkout code
- name: Checkout optimum
uses: actions/checkout@v4
with:
path: optimum
fetch-depth: 0

- name: checkout optimum-onnx
uses: actions/checkout@v4
with:
repository: huggingface/optimum-onnx
ref: ${{ env.OPTIMUM_ONNX_REF }}
path: optimum-onnx
fetch-depth: 0

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand All @@ -34,11 +48,22 @@ jobs:

- 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 optimum-onnx@git+https://github.com/huggingface/optimum-onnx.git
pip install .[tests]
pip install --upgrade pip uv
uv pip install ./optimum-onnx
uv pip install ./optimum[tests]

- name: Test with pytest
run: |
pytest tests/exporters/common -vvvv --durations=0 -n auto
working-directory: optimum

- name: Install dependencies (editable mode)
run: |
uv pip uninstall optimum-onnx optimum
uv pip install -e ./optimum-onnx
uv pip install -e ./optimum[tests]

- name: Test with pytest (editable mode)
run: |
pytest tests/exporters/common -vvvv --durations=0 -n auto
working-directory: optimum
36 changes: 30 additions & 6 deletions .github/workflows/test_pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Optimum Pipelines / Python - Test
name: Optimum Pipelines / Python - Test - Subpackage (ONNX)

on:
push:
Expand All @@ -12,7 +12,8 @@ concurrency:

env:
UV_SYSTEM_PYTHON: 1
UV_TORCH_BACKEND: auto
UV_TORCH_BACKEND: cpu
OPTIMUM_ONNX_REF: main
TRANSFORMERS_IS_CI: true

jobs:
Expand All @@ -21,13 +22,24 @@ jobs:
fail-fast: false
matrix:
python-version: [3.9]
runs-on: [ubuntu-22.04]
runs-on: [ubuntu-22.04, windows-2022]

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

steps:
- name: Checkout code
- name: Checkout optimum
uses: actions/checkout@v4
with:
path: optimum
fetch-depth: 0

- name: checkout optimum-onnx
uses: actions/checkout@v4
with:
repository: huggingface/optimum-onnx
ref: ${{ env.OPTIMUM_ONNX_REF }}
path: optimum-onnx
fetch-depth: 0

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand All @@ -37,9 +49,21 @@ jobs:
- name: Install dependencies
run: |
pip install --upgrade pip uv
uv pip install --no-cache-dir optimum-onnx[onnxruntime]@git+https://github.com/huggingface/optimum-onnx.git
uv pip install --no-cache-dir .[tests]
uv pip install ./optimum-onnx[onnxruntime]
uv pip install ./optimum[tests]

- name: Test with pytest
run: |
pytest tests/pipelines -vvvv --durations=0
working-directory: optimum

- name: Install dependencies (editable mode)
run: |
uv pip uninstall optimum-onnx optimum
uv pip install -e ./optimum-onnx[onnxruntime]
uv pip install -e ./optimum[tests]

- name: Test with pytest (editable mode)
run: |
pytest tests/pipelines -vvvv --durations=0
working-directory: optimum
16 changes: 9 additions & 7 deletions .github/workflows/test_utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ concurrency:
cancel-in-progress: true

env:
UV_SYSTEM_PYTHON: 1
UV_TORCH_BACKEND: cpu
TRANSFORMERS_IS_CI: true

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-13, windows-2022]
python-version: ["3.9"]
python-version: [3.9]
runs-on: [ubuntu-22.04, macos-14, windows-2022]

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

runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -33,10 +36,9 @@ jobs:

- 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]
pip install --upgrade pip uv
uv pip install .[tests]

- name: Tests needing datasets
run: |
pytest tests/utils -n auto -vvvv --durations=0
pytest tests/utils -n auto -vvvv --durations=0
15 changes: 0 additions & 15 deletions optimum/__init__.py

This file was deleted.

19 changes: 0 additions & 19 deletions optimum/commands/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion optimum/commands/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from transformers.utils import is_tf_available, is_torch_available

from ..version import __version__ as version
from . import BaseOptimumCLICommand, CommandInfo
from .base import BaseOptimumCLICommand, CommandInfo


class EnvironmentCommand(BaseOptimumCLICommand):
Expand Down
16 changes: 0 additions & 16 deletions optimum/commands/export/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion optimum/commands/export/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
"""optimum.exporters command-line interface base classes."""

from .. import BaseOptimumCLICommand, CommandInfo
from ..base import BaseOptimumCLICommand, CommandInfo


class ExportCommand(BaseOptimumCLICommand):
Expand Down
Loading