From 27c66e03d260508b40d58ebf890cae55b8cde6b3 Mon Sep 17 00:00:00 2001 From: ydshieh Date: Mon, 29 Apr 2024 15:02:41 +0200 Subject: [PATCH] hello 1 hello 2 hello 3 hello 4 --- .../workflows/self-new-model-pr-caller.yml | 180 +++++++++++------- 1 file changed, 109 insertions(+), 71 deletions(-) diff --git a/.github/workflows/self-new-model-pr-caller.yml b/.github/workflows/self-new-model-pr-caller.yml index 44a54ac675279b..324aa83c4f8542 100644 --- a/.github/workflows/self-new-model-pr-caller.yml +++ b/.github/workflows/self-new-model-pr-caller.yml @@ -2,8 +2,6 @@ name: PR slow CI on: pull_request: - paths: - - "src/transformers/models/*/modeling_*.py" env: HF_HOME: /mnt/cache @@ -23,12 +21,14 @@ jobs: check_for_new_model: runs-on: ubuntu-22.04 name: Check if a PR is a new model PR + if: contains(github.event.pull_request.labels.*.name, 'single-model-run-slow') outputs: new_model: ${{ steps.check_new_model.outputs.new_model }} steps: - uses: actions/checkout@v4 with: fetch-depth: "0" + ref: ${{ github.event.pull_request.head.sha }} - name: Check if there is a new model id: check_new_model @@ -36,77 +36,115 @@ jobs: python -m pip install GitPython echo "new_model=$(python utils/check_if_new_model_added.py | tail -n 1)" >> $GITHUB_OUTPUT - run_models_gpu: - name: Run all tests for the new model - # Triggered if it is a new model PR and the required label is added - if: ${{ needs.check_for_new_model.outputs.new_model != '' && contains(github.event.pull_request.labels.*.name, 'single-model-run-slow') }} - needs: check_for_new_model - strategy: - fail-fast: false - matrix: - folders: ["${{ needs.check_for_new_model.outputs.new_model }}"] - machine_type: [single-gpu, multi-gpu] - runs-on: ['${{ matrix.machine_type }}', nvidia-gpu, t4, ci] - container: - image: huggingface/transformers-all-latest-gpu - options: --gpus all --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/ + check_specified_models: + runs-on: ubuntu-22.04 + name: Check specified models to test + outputs: + new_model: ${{ steps.check_models.outputs.models }} steps: - - name: Echo input and matrix info - shell: bash - run: | - echo "${{ matrix.folders }}" - - - name: Echo folder ${{ matrix.folders }} - shell: bash - # For folders like `models/bert`, set an env. var. (`matrix_folders`) to `models_bert`, which will be used to - # set the artifact folder names (because the character `/` is not allowed). - run: | - echo "${{ matrix.folders }}" - matrix_folders=${{ matrix.folders }} - matrix_folders=${matrix_folders/'models/'/'models_'} - echo "$matrix_folders" - echo "matrix_folders=$matrix_folders" >> $GITHUB_ENV - - - name: Update clone - working-directory: /transformers - run: git fetch && git checkout ${{ github.event.pull_request.head.sha }} - - - name: Reinstall transformers in edit mode (remove the one installed during docker image build) - working-directory: /transformers - run: python3 -m pip uninstall -y transformers && python3 -m pip install -e . - - - name: NVIDIA-SMI - run: | - nvidia-smi - - - name: Environment - working-directory: /transformers - run: | - python3 utils/print_env.py - - - name: Show installed libraries and their versions - working-directory: /transformers - run: pip freeze + - uses: actions/checkout@v4 + with: + fetch-depth: "0" + ref: ${{ github.event.pull_request.head.sha }} - - name: Run all tests on GPU - working-directory: /transformers - run: python3 -m pytest -v -rs --make-reports=${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports tests/${{ matrix.folders }} + - name: Check commit message + id: check_message + run: | + echo "${{ github.event.head_commit.message }}" + git log -n 5 + git show -s --format=%s - - name: Failure short reports - if: ${{ failure() }} - continue-on-error: true - run: cat /transformers/reports/${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports/failures_short.txt + - name: Check if there are specified models + id: check_models + run: | + echo "models=['models/bert', 'models/gpt2']" >> $GITHUB_OUTPUT - - name: Make sure report directory exists - shell: bash - run: | - mkdir -p /transformers/reports/${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports - echo "hello" > /transformers/reports/${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports/hello.txt - echo "${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports" +# - name: Check if there are specified models +# id: check_models +# run: | +# python -m pip install GitPython +# echo "new_model=$(python utils/check_if_new_model_added.py | tail -n 1)" >> $GITHUB_OUTPUT - - name: "Test suite reports artifacts: ${{ matrix.machine_type }}_run_models_gpu_${{ env.matrix_folders }}_test_reports" - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.machine_type }}_run_models_gpu_${{ env.matrix_folders }}_test_reports - path: /transformers/reports/${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports + dummy: + runs-on: ubuntu-22.04 + name: Check specified models to test + needs: check_specified_models + steps: + - name: Check if there are specified models + run: | + echo "${{ needs.check_specified_models.outputs.models }}" +# +# run_models_gpu: +# name: Run all tests for the new model +# # Triggered if it is a new model PR and the required label is added +# if: ${{ needs.check_for_new_model.outputs.new_model != '' && contains(github.event.pull_request.labels.*.name, 'single-model-run-slow') }} +# needs: check_for_new_model +# strategy: +# fail-fast: false +# matrix: +# folders: ["${{ needs.check_for_new_model.outputs.new_model }}"] +# machine_type: [single-gpu, multi-gpu] +# runs-on: ['${{ matrix.machine_type }}', nvidia-gpu, t4, ci] +# container: +# image: huggingface/transformers-all-latest-gpu +# options: --gpus all --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/ +# steps: +# - name: Echo input and matrix info +# shell: bash +# run: | +# echo "${{ matrix.folders }}" +# +# - name: Echo folder ${{ matrix.folders }} +# shell: bash +# # For folders like `models/bert`, set an env. var. (`matrix_folders`) to `models_bert`, which will be used to +# # set the artifact folder names (because the character `/` is not allowed). +# run: | +# echo "${{ matrix.folders }}" +# matrix_folders=${{ matrix.folders }} +# matrix_folders=${matrix_folders/'models/'/'models_'} +# echo "$matrix_folders" +# echo "matrix_folders=$matrix_folders" >> $GITHUB_ENV +# +# - name: Update clone +# working-directory: /transformers +# run: git fetch && git checkout ${{ github.event.pull_request.head.sha }} +# +# - name: Reinstall transformers in edit mode (remove the one installed during docker image build) +# working-directory: /transformers +# run: python3 -m pip uninstall -y transformers && python3 -m pip install -e . +# +# - name: NVIDIA-SMI +# run: | +# nvidia-smi +# +# - name: Environment +# working-directory: /transformers +# run: | +# python3 utils/print_env.py +# +# - name: Show installed libraries and their versions +# working-directory: /transformers +# run: pip freeze +# +# - name: Run all tests on GPU +# working-directory: /transformers +# run: python3 -m pytest -v -rs --make-reports=${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports tests/${{ matrix.folders }} +# +# - name: Failure short reports +# if: ${{ failure() }} +# continue-on-error: true +# run: cat /transformers/reports/${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports/failures_short.txt +# +# - name: Make sure report directory exists +# shell: bash +# run: | +# mkdir -p /transformers/reports/${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports +# echo "hello" > /transformers/reports/${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports/hello.txt +# echo "${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports" +# +# - name: "Test suite reports artifacts: ${{ matrix.machine_type }}_run_models_gpu_${{ env.matrix_folders }}_test_reports" +# if: ${{ always() }} +# uses: actions/upload-artifact@v4 +# with: +# name: ${{ matrix.machine_type }}_run_models_gpu_${{ env.matrix_folders }}_test_reports +# path: /transformers/reports/${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports