From 613ff7b0859dcd74459241fa537c5fc53606b658 Mon Sep 17 00:00:00 2001 From: IlyasMoutawwakil Date: Fri, 10 Jan 2025 16:50:09 +0100 Subject: [PATCH] revert main transformers and disable modernbert --- .github/workflows/test_export_onnx.yml | 1 - .github/workflows/test_export_onnx_cli.yml | 1 - .github/workflows/test_exporters_slow.yml | 40 +++++++++++----------- .github/workflows/test_onnxruntime.yml | 7 +++- optimum/exporters/tasks.py | 18 +++++----- tests/exporters/exporters_utils.py | 4 +-- 6 files changed, 37 insertions(+), 34 deletions(-) diff --git a/.github/workflows/test_export_onnx.yml b/.github/workflows/test_export_onnx.yml index ff392672ce..187aa6a65c 100644 --- a/.github/workflows/test_export_onnx.yml +++ b/.github/workflows/test_export_onnx.yml @@ -28,7 +28,6 @@ jobs: - name: Install dependencies for pytorch export run: | pip install .[tests,exporters,diffusers] - pip install transformers@git+https://github.com/huggingface/transformers.git - name: Test with unittest working-directory: tests run: | diff --git a/.github/workflows/test_export_onnx_cli.yml b/.github/workflows/test_export_onnx_cli.yml index 601be88a04..41394fef92 100644 --- a/.github/workflows/test_export_onnx_cli.yml +++ b/.github/workflows/test_export_onnx_cli.yml @@ -28,7 +28,6 @@ jobs: - name: Install dependencies for pytorch export run: | pip install .[tests,exporters,diffusers] - pip install transformers@git+https://github.com/huggingface/transformers.git - name: Test with unittest working-directory: tests run: | diff --git a/.github/workflows/test_exporters_slow.yml b/.github/workflows/test_exporters_slow.yml index 9885c418ae..51424a18f3 100644 --- a/.github/workflows/test_exporters_slow.yml +++ b/.github/workflows/test_exporters_slow.yml @@ -18,23 +18,23 @@ jobs: 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,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 + - 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 diff --git a/.github/workflows/test_onnxruntime.yml b/.github/workflows/test_onnxruntime.yml index 7522fe343e..d3fb57c555 100644 --- a/.github/workflows/test_onnxruntime.yml +++ b/.github/workflows/test_onnxruntime.yml @@ -49,7 +49,12 @@ jobs: - name: Install transformers ${{ matrix.transformers-version }} if: ${{ matrix.transformers-version != 'latest' }} run: | - pip install "transformers==${{ matrix.transformers-version }}" "diffusers<0.32.0" + pip install "transformers==${{ matrix.transformers-version }}" + + - name: Install diffusers + if: matrix.transformers-version == '4.36.*' + run: | + pip install "diffusers<0.32.0" - name: Test with pytest (in series) run: | diff --git a/optimum/exporters/tasks.py b/optimum/exporters/tasks.py index e8ea3830d3..6afe17a369 100644 --- a/optimum/exporters/tasks.py +++ b/optimum/exporters/tasks.py @@ -902,15 +902,15 @@ class TasksManager: "image-classification", onnx="MobileNetV2OnnxConfig", ), - "modernbert": supported_tasks_mapping( - "feature-extraction", - "fill-mask", - "text-classification", - "multiple-choice", - "token-classification", - "question-answering", - onnx="ModernBertOnnxConfig", - ), + # "modernbert": supported_tasks_mapping( + # "feature-extraction", + # "fill-mask", + # "text-classification", + # "multiple-choice", + # "token-classification", + # "question-answering", + # onnx="ModernBertOnnxConfig", + # ), "mpnet": supported_tasks_mapping( "feature-extraction", "fill-mask", diff --git a/tests/exporters/exporters_utils.py b/tests/exporters/exporters_utils.py index d256e16dd4..461e34adf6 100644 --- a/tests/exporters/exporters_utils.py +++ b/tests/exporters/exporters_utils.py @@ -125,7 +125,7 @@ "mobilenet-v2": "hf-internal-testing/tiny-random-MobileNetV2Model", "mobilenet-v1": "google/mobilenet_v1_0.75_192", "mobilevit": "hf-internal-testing/tiny-random-mobilevit", - "modernbert": "hf-internal-testing/tiny-random-ModernBertForMaskedLM", + # "modernbert": "hf-internal-testing/tiny-random-ModernBertForMaskedLM", "mpnet": "hf-internal-testing/tiny-random-MPNetModel", "mpt": "hf-internal-testing/tiny-random-MptForCausalLM", "mt5": "lewtun/tiny-random-mt5", @@ -267,7 +267,7 @@ # "mobilenet_v1": "google/mobilenet_v1_0.75_192", # "mobilenet_v2": "google/mobilenet_v2_0.35_96", "mobilevit": "apple/mobilevit-small", - "modernbert": "answerdotai/ModernBERT-base", + # "modernbert": "answerdotai/ModernBERT-base", "mpt": "mosaicml/mpt-7b", "mt5": "lewtun/tiny-random-mt5", # Not using google/mt5-small because it takes too much time for testing. "musicgen": "facebook/musicgen-small",