From a514435fbd81b3f21419a0321c722bf5c7289d47 Mon Sep 17 00:00:00 2001 From: IlyasMoutawwakil Date: Thu, 16 Oct 2025 08:28:21 +0200 Subject: [PATCH 1/5] fix --- optimum/amd/brevitas/quantizer.py | 2 +- optimum/amd/ryzenai/modeling.py | 2 +- optimum/amd/ryzenai/pipelines/__init__.py | 2 +- tests/brevitas/test_onnx_export.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/optimum/amd/brevitas/quantizer.py b/optimum/amd/brevitas/quantizer.py index d06e143b..f24393f0 100644 --- a/optimum/amd/brevitas/quantizer.py +++ b/optimum/amd/brevitas/quantizer.py @@ -13,7 +13,7 @@ from brevitas_examples.llm.llm_quant.equalize import apply_weight_equalization from tqdm import tqdm -from optimum.exporters import TasksManager +from optimum.exporters.tasks import TasksManager from optimum.quantization_base import OptimumQuantizer from transformers.utils.fx import symbolic_trace diff --git a/optimum/amd/ryzenai/modeling.py b/optimum/amd/ryzenai/modeling.py index 74186cef..a7f743ae 100644 --- a/optimum/amd/ryzenai/modeling.py +++ b/optimum/amd/ryzenai/modeling.py @@ -17,8 +17,8 @@ from onnx import shape_inference from onnx.tools import update_model_dims -from optimum.exporters import TasksManager from optimum.exporters.onnx import main_export +from optimum.exporters.tasks import TasksManager from optimum.modeling_base import FROM_PRETRAINED_START_DOCSTRING, OptimizedModel from optimum.onnx.utils import _get_external_data_paths from optimum.utils.save_utils import maybe_load_preprocessors diff --git a/optimum/amd/ryzenai/pipelines/__init__.py b/optimum/amd/ryzenai/pipelines/__init__.py index 7b9c0051..2ba1755a 100644 --- a/optimum/amd/ryzenai/pipelines/__init__.py +++ b/optimum/amd/ryzenai/pipelines/__init__.py @@ -4,7 +4,7 @@ from typing import TYPE_CHECKING, Any, Optional, Union -from optimum.exporters import TasksManager +from optimum.exporters.tasks import TasksManager from transformers import ImageClassificationPipeline, Pipeline, PretrainedConfig from transformers import pipeline as transformers_pipeline from transformers.image_processing_utils import BaseImageProcessor diff --git a/tests/brevitas/test_onnx_export.py b/tests/brevitas/test_onnx_export.py index 836d21b8..7f9a65a6 100644 --- a/tests/brevitas/test_onnx_export.py +++ b/tests/brevitas/test_onnx_export.py @@ -15,12 +15,12 @@ from testing_utils import SUPPORTED_MODELS_TINY, VALIDATE_EXPORT_ON_SHAPES, get_quantized_model from optimum.amd.brevitas.export import find_and_insert_matmulinteger -from optimum.exporters import TasksManager from optimum.exporters.onnx import ( export_models, validate_models_outputs, ) from optimum.exporters.onnx.utils import _get_submodels_and_onnx_configs +from optimum.exporters.tasks import TasksManager from optimum.utils import DEFAULT_DUMMY_SHAPES from optimum.utils.testing_utils import grid_parameters from transformers.modeling_utils import get_parameter_dtype From 7609d19d58b0f2f6803c6d5c873118f504b193fb Mon Sep 17 00:00:00 2001 From: IlyasMoutawwakil Date: Thu, 16 Oct 2025 08:39:21 +0200 Subject: [PATCH 2/5] fix --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 5e6c4bf2..42e6542d 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ # Run code quality checks SHELL := /bin/bash CURRENT_DIR = $(shell pwd) +COMMIT_SHA_SUBPACKAGE := $(shell git rev-parse HEAD) DEFAULT_CLONE_URL := https://github.com/huggingface/optimum-amd.git # If CLONE_URL is empty, revert to DEFAULT_CLONE_URL REAL_CLONE_URL = $(if $(CLONE_URL),$(CLONE_URL),$(DEFAULT_CLONE_URL)) From f3c86cd39ce2796efe18763fe617c82c17f6c98c Mon Sep 17 00:00:00 2001 From: IlyasMoutawwakil Date: Thu, 16 Oct 2025 08:45:37 +0200 Subject: [PATCH 3/5] fix --- .github/workflows/build_pr_documentation.yml | 2 ++ Makefile | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml index 1e7bd0a3..15d1bf81 100644 --- a/.github/workflows/build_pr_documentation.yml +++ b/.github/workflows/build_pr_documentation.yml @@ -31,6 +31,8 @@ jobs: sudo mv ./doc-build/optimum.amd ./doc-build/optimum-amd echo ${{ env.COMMIT_SHA }} > ./commit_sha echo ${{ env.PR_NUMBER }} > ./pr_number + env: + COMMIT_SHA_SUBPACKAGE: ${{ github.event.pull_request.head.sha }} - uses: actions/upload-artifact@v4 with: diff --git a/Makefile b/Makefile index 42e6542d..5e6c4bf2 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,6 @@ # Run code quality checks SHELL := /bin/bash CURRENT_DIR = $(shell pwd) -COMMIT_SHA_SUBPACKAGE := $(shell git rev-parse HEAD) DEFAULT_CLONE_URL := https://github.com/huggingface/optimum-amd.git # If CLONE_URL is empty, revert to DEFAULT_CLONE_URL REAL_CLONE_URL = $(if $(CLONE_URL),$(CLONE_URL),$(DEFAULT_CLONE_URL)) From 525b59ec34832261f85208272e7d240f77528290 Mon Sep 17 00:00:00 2001 From: IlyasMoutawwakil Date: Thu, 16 Oct 2025 08:55:41 +0200 Subject: [PATCH 4/5] fix --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 4eedceb7..d0bda965 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ assert False, "Error: Could not open '%s' due %s\n" % (filepath, error) # ORT 1.16 is not compatible: https://github.com/Xilinx/Vitis-AI/issues/1343 -INSTALL_REQUIRE = ["optimum", "transformers>=4.38", "onnx", "onnxruntime-extensions"] +INSTALL_REQUIRE = ["optimum-onnx", "transformers>=4.38", "onnx", "onnxruntime-extensions"] # TODO: unpin pytest once https://github.com/huggingface/transformers/pull/29154 is merged & released TESTS_REQUIRE = [ @@ -46,7 +46,6 @@ "onnxruntime", "accelerate>=0.30", "onnx-tool", - "optimum>=1.17", ], } From ff929b727df503089704803b50a198a945cad644 Mon Sep 17 00:00:00 2001 From: IlyasMoutawwakil Date: Thu, 16 Oct 2025 09:00:22 +0200 Subject: [PATCH 5/5] fix --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d0bda965..f9ad971a 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ assert False, "Error: Could not open '%s' due %s\n" % (filepath, error) # ORT 1.16 is not compatible: https://github.com/Xilinx/Vitis-AI/issues/1343 -INSTALL_REQUIRE = ["optimum-onnx", "transformers>=4.38", "onnx", "onnxruntime-extensions"] +INSTALL_REQUIRE = ["optimum<2.0.0", "transformers>=4.38", "onnx", "onnxruntime-extensions"] # TODO: unpin pytest once https://github.com/huggingface/transformers/pull/29154 is merged & released TESTS_REQUIRE = [ @@ -46,6 +46,7 @@ "onnxruntime", "accelerate>=0.30", "onnx-tool", + "optimum>=1.17", ], }