Fixes extract_subset_of_nodes (#337) #2166
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| pull_request: | |
| types: | |
| - closed | |
| branches: | |
| - main | |
| jobs: | |
| run: | |
| name: to-${{ matrix.torch }}-tr-${{ matrix.transformers }}-ci ${{ matrix.os }}-${{ matrix.python }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| python: ['3.10', '3.11', '3.12', '3.13'] | |
| transformers: ['4.48.3', '4.51.3', '4.52.4', '4.55.4', '4.56.2', '4.57.3', 'main'] | |
| torch: ['2.9', 'main'] | |
| exclude: | |
| - python: '3.10' # 3.10 | |
| torch: 'main' | |
| - python: '3.10' | |
| torch: '2.9' | |
| - python: '3.10' | |
| transformers: 'main' | |
| - python: '3.10' | |
| transformers: '4.52.4' | |
| - python: '3.10' | |
| transformers: '4.55.4' | |
| - python: '3.10' | |
| transformers: '4.56.2' | |
| - python: '3.10' | |
| transformers: '4.57.3' | |
| - python: '3.11' # 3.11 | |
| torch: 'main' | |
| - python: '3.11' | |
| transformers: 'main' | |
| - python: '3.11' | |
| transformers: '4.55.4' | |
| - python: '3.11' | |
| transformers: '4.56.2' | |
| - python: '3.11' | |
| transformers: '4.57.3' | |
| - python: '3.13' # 3.11 | |
| torch: '2.9' | |
| - python: '3.13' | |
| transformers: '4.48.3' | |
| - python: '3.13' | |
| transformers: '4.51.3' | |
| - python: '3.13' | |
| transformers: '4.55.4' | |
| - python: '3.13' | |
| transformers: '4.56.2' | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Install pytorch ${{ matrix.torch }} | |
| run: | | |
| if [[ "${{ matrix.torch }}" == "main" ]]; then | |
| python -m pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu | |
| else | |
| echo "install torch==${{ matrix.torch }} torchvision torchaudio" | |
| pip install torch==${{ matrix.torch }} torchvision torchaudio | |
| fi | |
| - name: Install transformers ${{ matrix.transformers }} | |
| run: | | |
| if [[ "${{ matrix.transformers }}" == "main" ]]; then | |
| echo "install transformers from github" | |
| git clone https://github.com/huggingface/transformers.git | |
| cd transformers | |
| pip install -e . | |
| cd .. | |
| else | |
| echo "install transformers==${{ matrix.transformers }}" | |
| pip install transformers==${{ matrix.transformers }} | |
| fi | |
| - name: Install requirements | |
| run: python -m pip install -r requirements.txt | |
| - name: Install requirements dev | |
| run: python -m pip install -r requirements-dev.txt | |
| - name: Uninstall onnx-diagnostic | |
| run: python -m pip uninstall -y onnx-diagnostic | |
| - name: Uninstall onnx and install onnx-weekly | |
| run: | | |
| python -m pip uninstall -y onnx | |
| python -m pip install onnx-weekly | |
| - name: Install pytorch ${{ matrix.torch }} (2) | |
| run: | | |
| if [[ "${{ matrix.torch }}" == "main" ]]; then | |
| python -m pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu | |
| else | |
| echo "install torch==${{ matrix.torch }} torchvision torchaudio" | |
| pip install torch==${{ matrix.torch }} torchvision torchaudio | |
| fi | |
| # two slow | |
| #- name: Cache pip | |
| # if: ${{ matrix.torch != 'main' && matrix.transformers != 'main' }} | |
| # uses: actions/cache@v4 | |
| # with: | |
| # path: ~/.cache/pip | |
| # key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }} | |
| # restore-keys: | | |
| # ${{ runner.os }}-pip- | |
| # ${{ runner.os }}- | |
| - name: pip freeze | |
| run: python -m pip freeze | |
| - name: tiny-llm torch.export.export | |
| run: PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_torch_models/test_tiny_llms.py | |
| - name: tiny-llm onnx | |
| run: PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_torch_models/test_tiny_llms_onnx.py | |
| continue-on-error: true # connectivity issues | |
| - name: tiny-llm example | |
| run: PYTHONPATH=. UNITTEST_GOING=1 python _doc/examples/plot_export_tiny_llm.py | |
| continue-on-error: true # connectivity issues | |
| - name: tiny-llm bypass | |
| run: PYTHONPATH=. UNITTEST_GOING=1 python _doc/examples/plot_export_tiny_llm_patched.py | |
| continue-on-error: true # connectivity issues | |
| - name: run tests bypassed | |
| run: PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_torch_models/test_tiny_llms_bypassed.py | |
| - name: test image_classification | |
| run: PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_tasks/test_tasks_image_classification.py | |
| - name: test zero_shot_image_classification | |
| run: PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_tasks/test_tasks_zero_shot_image_classification.py | |
| - name: run tests | |
| run: | | |
| pip install pytest | |
| PYTHONPATH=. UNITTEST_GOING=1 pytest --durations=10 _unittests --ignore _unittests/ut_reference/test_backend_extended_reference_evaluator.py --ignore _unittests/ut_reference/test_backend_onnxruntime_evaluator.py --ignore _unittests/ut_torch_models/test_tiny_llms_bypassed.py --ignore _unittests/ut_tasks/test_tasks_zero_shot_image_classification.py --ignore _unittests/ut_tasks/test_tasks_image_classification.py --ignore-glob _unittests/ut_torch_models/test_validate_whole_models*.py --ignore-glob _unittests/ut_torch_models/test_validate_models*.py | |
| - name: test models | |
| run: | | |
| echo "----" | |
| PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_torch_models/test_validate_models.py | |
| echo "----" | |
| PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_torch_models/test_validate_whole_models1.py | |
| echo "----" | |
| PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_torch_models/test_validate_whole_models2.py | |
| echo "----" | |
| PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_torch_models/test_validate_whole_models3.py | |
| echo "----" | |
| # - name: run backend tests python | |
| # run: PYTHONPATH=. UNITTEST_GOING=1 pytest --durations=10 _unittests/ut_reference/test_backend_extended_reference_evaluator.py | |
| # - name: run backend tests onnxruntime | |
| # run: PYTHONPATH=. UNITTEST_GOING=1 pytest --durations=10 _unittests/ut_reference/test_backend_onnxruntime_evaluator.py --maxfail=15 |