diff --git a/.github/workflows/self-scheduled-amd-mi210-caller.yml b/.github/workflows/self-scheduled-amd-mi210-caller.yml index 1c79b38a314e0b..6109faca00932e 100644 --- a/.github/workflows/self-scheduled-amd-mi210-caller.yml +++ b/.github/workflows/self-scheduled-amd-mi210-caller.yml @@ -1,55 +1,55 @@ -name: Self-hosted runner (AMD mi210 scheduled CI caller) - -on: - workflow_run: - workflows: ["Self-hosted runner (AMD scheduled CI caller)"] - branches: ["main"] - types: [completed] - push: - branches: - - run_amd_scheduled_ci_caller* - -jobs: - model-ci: - name: Model CI - uses: ./.github/workflows/self-scheduled-amd.yml - with: - job: run_models_gpu - slack_report_channel: "#transformers-ci-daily-amd" - runner: mi210 - docker: huggingface/transformers-pytorch-amd-gpu - ci_event: Scheduled CI (AMD) - mi210 - secrets: inherit - - torch-pipeline: - name: Torch pipeline CI - uses: ./.github/workflows/self-scheduled-amd.yml - with: - job: run_pipelines_torch_gpu - slack_report_channel: "#transformers-ci-daily-amd" - runner: mi210 - docker: huggingface/transformers-pytorch-amd-gpu - ci_event: Scheduled CI (AMD) - mi210 - secrets: inherit - - example-ci: - name: Example CI - uses: ./.github/workflows/self-scheduled-amd.yml - with: - job: run_examples_gpu - slack_report_channel: "#transformers-ci-daily-amd" - runner: mi210 - docker: huggingface/transformers-pytorch-amd-gpu - ci_event: Scheduled CI (AMD) - mi210 - secrets: inherit - - deepspeed-ci: - name: DeepSpeed CI - uses: ./.github/workflows/self-scheduled-amd.yml - with: - job: run_torch_cuda_extensions_gpu - slack_report_channel: "#transformers-ci-daily-amd" - runner: mi210 - docker: huggingface/transformers-pytorch-deepspeed-amd-gpu - ci_event: Scheduled CI (AMD) - mi210 - secrets: inherit +name: Self-hosted runner (AMD mi210 scheduled CI caller) + +on: + workflow_run: + workflows: ["Self-hosted runner (AMD scheduled CI caller)"] + branches: ["main"] + types: [completed] + push: + branches: + - run_amd_scheduled_ci_caller* + +jobs: + model-ci: + name: Model CI + uses: huggingface/hf-workflows/.github/workflows/transformers_amd_ci_scheduled.yaml@main + with: + job: run_models_gpu + slack_report_channel: "#transformers-ci-daily-amd" + runner: mi210 + docker: huggingface/transformers-pytorch-amd-gpu + ci_event: Scheduled CI (AMD) - mi210 + secrets: inherit + + torch-pipeline: + name: Torch pipeline CI + uses: huggingface/hf-workflows/.github/workflows/transformers_amd_ci_scheduled.yaml@main + with: + job: run_pipelines_torch_gpu + slack_report_channel: "#transformers-ci-daily-amd" + runner: mi210 + docker: huggingface/transformers-pytorch-amd-gpu + ci_event: Scheduled CI (AMD) - mi210 + secrets: inherit + + example-ci: + name: Example CI + uses: huggingface/hf-workflows/.github/workflows/transformers_amd_ci_scheduled.yaml@main + with: + job: run_examples_gpu + slack_report_channel: "#transformers-ci-daily-amd" + runner: mi210 + docker: huggingface/transformers-pytorch-amd-gpu + ci_event: Scheduled CI (AMD) - mi210 + secrets: inherit + + deepspeed-ci: + name: DeepSpeed CI + uses: huggingface/hf-workflows/.github/workflows/transformers_amd_ci_scheduled.yaml@main + with: + job: run_torch_cuda_extensions_gpu + slack_report_channel: "#transformers-ci-daily-amd" + runner: mi210 + docker: huggingface/transformers-pytorch-deepspeed-amd-gpu + ci_event: Scheduled CI (AMD) - mi210 + secrets: inherit diff --git a/.github/workflows/self-scheduled-amd-mi250-caller.yml b/.github/workflows/self-scheduled-amd-mi250-caller.yml index fd151305716396..a33b6e579c0ef3 100644 --- a/.github/workflows/self-scheduled-amd-mi250-caller.yml +++ b/.github/workflows/self-scheduled-amd-mi250-caller.yml @@ -1,55 +1,55 @@ -name: Self-hosted runner (AMD mi250 scheduled CI caller) - -on: - workflow_run: - workflows: ["Self-hosted runner (AMD scheduled CI caller)"] - branches: ["main"] - types: [completed] - push: - branches: - - run_amd_scheduled_ci_caller* - -jobs: - model-ci: - name: Model CI - uses: ./.github/workflows/self-scheduled-amd.yml - with: - job: run_models_gpu - slack_report_channel: "#transformers-ci-daily-amd" - runner: mi250 - docker: huggingface/transformers-pytorch-amd-gpu - ci_event: Scheduled CI (AMD) - mi250 - secrets: inherit - - torch-pipeline: - name: Torch pipeline CI - uses: ./.github/workflows/self-scheduled-amd.yml - with: - job: run_pipelines_torch_gpu - slack_report_channel: "#transformers-ci-daily-amd" - runner: mi250 - docker: huggingface/transformers-pytorch-amd-gpu - ci_event: Scheduled CI (AMD) - mi250 - secrets: inherit - - example-ci: - name: Example CI - uses: ./.github/workflows/self-scheduled-amd.yml - with: - job: run_examples_gpu - slack_report_channel: "#transformers-ci-daily-amd" - runner: mi250 - docker: huggingface/transformers-pytorch-amd-gpu - ci_event: Scheduled CI (AMD) - mi250 - secrets: inherit - - deepspeed-ci: - name: DeepSpeed CI - uses: ./.github/workflows/self-scheduled-amd.yml - with: - job: run_torch_cuda_extensions_gpu - slack_report_channel: "#transformers-ci-daily-amd" - runner: mi250 - docker: huggingface/transformers-pytorch-deepspeed-amd-gpu - ci_event: Scheduled CI (AMD) - mi250 - secrets: inherit +name: Self-hosted runner (AMD mi250 scheduled CI caller) + +on: + workflow_run: + workflows: ["Self-hosted runner (AMD scheduled CI caller)"] + branches: ["main"] + types: [completed] + push: + branches: + - run_amd_scheduled_ci_caller* + +jobs: + model-ci: + name: Model CI + uses: huggingface/hf-workflows/.github/workflows/transformers_amd_ci_scheduled.yaml@main + with: + job: run_models_gpu + slack_report_channel: "#transformers-ci-daily-amd" + runner: mi250 + docker: huggingface/transformers-pytorch-amd-gpu + ci_event: Scheduled CI (AMD) - mi250 + secrets: inherit + + torch-pipeline: + name: Torch pipeline CI + uses: huggingface/hf-workflows/.github/workflows/transformers_amd_ci_scheduled.yaml@main + with: + job: run_pipelines_torch_gpu + slack_report_channel: "#transformers-ci-daily-amd" + runner: mi250 + docker: huggingface/transformers-pytorch-amd-gpu + ci_event: Scheduled CI (AMD) - mi250 + secrets: inherit + + example-ci: + name: Example CI + uses: huggingface/hf-workflows/.github/workflows/transformers_amd_ci_scheduled.yaml@main + with: + job: run_examples_gpu + slack_report_channel: "#transformers-ci-daily-amd" + runner: mi250 + docker: huggingface/transformers-pytorch-amd-gpu + ci_event: Scheduled CI (AMD) - mi250 + secrets: inherit + + deepspeed-ci: + name: DeepSpeed CI + uses: huggingface/hf-workflows/.github/workflows/transformers_amd_ci_scheduled.yaml@main + with: + job: run_torch_cuda_extensions_gpu + slack_report_channel: "#transformers-ci-daily-amd" + runner: mi250 + docker: huggingface/transformers-pytorch-deepspeed-amd-gpu + ci_event: Scheduled CI (AMD) - mi250 + secrets: inherit diff --git a/.github/workflows/self-scheduled-amd.yml b/.github/workflows/self-scheduled-amd.yml deleted file mode 100644 index 47f92cd6a2b086..00000000000000 --- a/.github/workflows/self-scheduled-amd.yml +++ /dev/null @@ -1,349 +0,0 @@ -name: Self-hosted runner (scheduled-amd) - -# Note: For the AMD CI, we rely on a caller workflow and on the workflow_call event to trigger the -# CI in order to run it on both MI210 and MI250, without having to use matrix here which pushes -# us towards the limit of allowed jobs on GitHub Actions. - -on: - workflow_call: - inputs: - job: - required: true - type: string - slack_report_channel: - required: true - type: string - runner: - required: true - type: string - docker: - required: true - type: string - ci_event: - required: true - type: string - -env: - HF_HOME: /mnt/cache - TRANSFORMERS_IS_CI: yes - OMP_NUM_THREADS: 8 - MKL_NUM_THREADS: 8 - RUN_SLOW: yes - HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }} - SIGOPT_API_TOKEN: ${{ secrets.SIGOPT_API_TOKEN }} - NUM_SLICES: 2 - -# Important note: each job (run_tests_single_gpu, run_tests_multi_gpu, run_examples_gpu, run_pipelines_torch_gpu) requires all the previous jobs before running. -# This is done so that we avoid parallelizing the scheduled tests, to leave available -# runners for the push CI that is running on the same machine. -jobs: - check_runner_status: - name: Check Runner Status - runs-on: ubuntu-22.04 - steps: - - name: Checkout transformers - uses: actions/checkout@v4 - with: - fetch-depth: 2 - - - name: Check Runner Status - run: python utils/check_self_hosted_runner.py --target_runners hf-amd-mi210-ci-1gpu-1,hf-amd-mi250-ci-1gpu-1,hf-amd-mi300-ci-1gpu-1 --token ${{ secrets.ACCESS_REPO_INFO_TOKEN }} - - check_runners: - name: Check Runners - needs: check_runner_status - strategy: - matrix: - machine_type: [single-gpu, multi-gpu] - runs-on: ['${{ matrix.machine_type }}', self-hosted, amd-gpu, '${{ inputs.runner }}'] - container: - image: huggingface/transformers-pytorch-amd-gpu - options: --device /dev/kfd --device /dev/dri --env ROCR_VISIBLE_DEVICES --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/ - steps: - - name: ROCM-SMI - run: | - rocm-smi - - - name: ROCM-INFO - run: | - rocminfo | grep "Agent" -A 14 - - - name: Show ROCR environment - run: | - echo "ROCR: $ROCR_VISIBLE_DEVICES" - - setup: - if: contains(fromJSON('["run_models_gpu"]'), inputs.job) - name: Setup - needs: check_runners - strategy: - matrix: - machine_type: [single-gpu, multi-gpu] - runs-on: ['${{ matrix.machine_type }}', self-hosted, amd-gpu, '${{ inputs.runner }}'] - container: - image: huggingface/transformers-pytorch-amd-gpu - options: --device /dev/kfd --device /dev/dri --env ROCR_VISIBLE_DEVICES --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/ - outputs: - folder_slices: ${{ steps.set-matrix.outputs.folder_slices }} - slice_ids: ${{ steps.set-matrix.outputs.slice_ids }} - steps: - - name: Update clone - working-directory: /transformers - run: | - git fetch && git checkout ${{ github.sha }} - - - name: Cleanup - working-directory: /transformers - run: | - rm -rf tests/__pycache__ - rm -rf tests/models/__pycache__ - rm -rf reports - - - name: Show installed libraries and their versions - working-directory: /transformers - run: pip freeze - - - id: set-matrix - name: Identify models to test - working-directory: /transformers/tests - run: | - echo "folder_slices=$(python3 ../utils/split_model_tests.py --num_splits ${{ env.NUM_SLICES }})" >> $GITHUB_OUTPUT - echo "slice_ids=$(python3 -c 'd = list(range(${{ env.NUM_SLICES }})); print(d)')" >> $GITHUB_OUTPUT - - - name: ROCM-SMI - run: | - rocm-smi - - - name: ROCM-INFO - run: | - rocminfo | grep "Agent" -A 14 - - - name: Show ROCR environment - run: | - echo "ROCR: $ROCR_VISIBLE_DEVICES" - - - name: Environment - working-directory: /transformers - run: | - python3 utils/print_env.py - - run_models_gpu: - if: ${{ inputs.job == 'run_models_gpu' }} - name: Single GPU tests - needs: setup - strategy: - max-parallel: 1 # For now, not to parallelize. Can change later if it works well. - fail-fast: false - matrix: - machine_type: [single-gpu, multi-gpu] - slice_id: ${{ fromJSON(needs.setup.outputs.slice_ids) }} - uses: ./.github/workflows/model_jobs_amd.yml - with: - folder_slices: ${{ needs.setup.outputs.folder_slices }} - machine_type: ${{ matrix.machine_type }} - slice_id: ${{ matrix.slice_id }} - runner: ${{ inputs.runner }} - docker: ${{ inputs.docker }} - secrets: inherit - - run_pipelines_torch_gpu: - if: ${{ inputs.job == 'run_pipelines_torch_gpu' }} - name: PyTorch pipelines - needs: check_runners - strategy: - fail-fast: false - matrix: - machine_type: [single-gpu, multi-gpu] - runs-on: ['${{ matrix.machine_type }}', self-hosted, amd-gpu, '${{ inputs.runner }}'] - container: - image: ${{ inputs.docker }} - options: --device /dev/kfd --device /dev/dri --env ROCR_VISIBLE_DEVICES --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/ - steps: - - name: Update clone - working-directory: /transformers - run: git fetch && git checkout ${{ github.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: ROCM-SMI - run: | - rocm-smi - - - name: ROCM-INFO - run: | - rocminfo | grep "Agent" -A 14 - - - name: Show ROCR environment - run: | - echo "ROCR: $ROCR_VISIBLE_DEVICES" - - - 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 pipeline tests on GPU - working-directory: /transformers - run: | - python3 -m pytest -n 1 -v --dist=loadfile --make-reports=${{ matrix.machine_type }}_run_pipelines_torch_gpu_test_reports tests/pipelines -m "not not_device_test" - - - name: Failure short reports - if: ${{ failure() }} - continue-on-error: true - run: cat /transformers/reports/${{ matrix.machine_type }}_run_pipelines_torch_gpu_test_reports/failures_short.txt - - - name: "Test suite reports artifacts: ${{ matrix.machine_type }}_run_pipelines_torch_gpu_test_reports" - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.machine_type }}_run_pipelines_torch_gpu_test_reports - path: /transformers/reports/${{ matrix.machine_type }}_run_pipelines_torch_gpu_test_reports - - run_examples_gpu: - if: ${{ inputs.job == 'run_examples_gpu' }} - name: Examples directory - needs: check_runners - strategy: - fail-fast: false - matrix: - machine_type: [single-gpu] - runs-on: ['${{ matrix.machine_type }}', self-hosted, amd-gpu, '${{ inputs.runner }}'] - container: - image: ${{ inputs.docker }} - options: --device /dev/kfd --device /dev/dri --env ROCR_VISIBLE_DEVICES --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/ - steps: - - name: Update clone - working-directory: /transformers - run: git fetch && git checkout ${{ github.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: ROCM-SMI - run: | - rocm-smi - - - name: ROCM-INFO - run: | - rocminfo | grep "Agent" -A 14 - - - name: Show ROCR environment - run: | - echo "ROCR: $ROCR_VISIBLE_DEVICES" - - - 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 examples tests on GPU - working-directory: /transformers - run: | - pip install -r examples/pytorch/_tests_requirements.txt - python3 -m pytest -v --make-reports=${{ matrix.machine_type }}_run_examples_gpu_test_reports examples/pytorch -m "not not_device_test" - - - name: Failure short reports - if: ${{ failure() }} - continue-on-error: true - run: cat /transformers/reports/${{ matrix.machine_type }}_run_examples_gpu_test_reports/failures_short.txt - - - name: "Test suite reports artifacts: ${{ matrix.machine_type }}_run_examples_gpu_test_reports" - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.machine_type }}_run_examples_gpu_test_reports - path: /transformers/reports/${{ matrix.machine_type }}_run_examples_gpu_test_reports - - run_torch_cuda_extensions_gpu: - if: ${{ inputs.job == 'run_torch_cuda_extensions_gpu' }} - name: Torch ROCm deepspeed tests - needs: check_runners - strategy: - fail-fast: false - matrix: - machine_type: [single-gpu, multi-gpu] - runs-on: ['${{ matrix.machine_type }}', self-hosted, amd-gpu, '${{ inputs.runner }}'] - container: - image: ${{ inputs.docker }} - options: --device /dev/kfd --device /dev/dri --env ROCR_VISIBLE_DEVICES --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/ - steps: - - name: Update clone - working-directory: /transformers - run: git fetch && git checkout ${{ github.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: ROCM-SMI - run: | - rocm-smi - - - name: ROCM-INFO - run: | - rocminfo | grep "Agent" -A 14 - - - name: Show ROCR environment - run: | - echo "ROCR: $ROCR_VISIBLE_DEVICES" - - - 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 --make-reports=${{ matrix.machine_type }}_run_torch_cuda_extensions_gpu_test_reports tests/deepspeed tests/extended -m "not not_device_test" - - - name: Failure short reports - if: ${{ failure() }} - continue-on-error: true - run: cat /transformers/reports/${{ matrix.machine_type }}_run_torch_cuda_extensions_gpu_test_reports/failures_short.txt - - - name: "Test suite reports artifacts: ${{ matrix.machine_type }}_run_torch_cuda_extensions_gpu_test_reports" - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.machine_type }}_run_torch_cuda_extensions_gpu_test_reports - path: /transformers/reports/${{ matrix.machine_type }}_run_torch_cuda_extensions_gpu_test_reports - - send_results: - name: Slack Report - needs: [ - check_runner_status, - check_runners, - setup, - run_models_gpu, - run_pipelines_torch_gpu, - run_examples_gpu, - run_torch_cuda_extensions_gpu - ] - if: ${{ always() }} - uses: ./.github/workflows/slack-report.yml - with: - job: ${{ inputs.job }} - # This would be `skipped` if `setup` is skipped. - setup_status: ${{ needs.setup.result }} - slack_report_channel: ${{ inputs.slack_report_channel }} - # This would be an empty string if `setup` is skipped. - folder_slices: ${{ needs.setup.outputs.folder_slices }} - quantization_matrix: ${{ needs.setup.outputs.quantization_matrix }} - ci_event: ${{ inputs.ci_event }} - - secrets: inherit diff --git a/.github/workflows/slack-report.yml b/.github/workflows/slack-report.yml index ee2962ba89c37f..eb3294f392d94f 100644 --- a/.github/workflows/slack-report.yml +++ b/.github/workflows/slack-report.yml @@ -21,6 +21,13 @@ on: ci_event: required: true type: string + report_repo_id: + required: false + type: string + upload_report_summary: + required: false + type: boolean + default: false env: TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN: ${{ secrets.TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN }} @@ -47,6 +54,8 @@ jobs: CI_SLACK_CHANNEL_ID_DAILY: ${{ secrets.CI_SLACK_CHANNEL_ID_DAILY }} CI_SLACK_CHANNEL_DUMMY_TESTS: ${{ secrets.CI_SLACK_CHANNEL_DUMMY_TESTS }} SLACK_REPORT_CHANNEL: ${{ inputs.slack_report_channel }} + REPORT_REPO_ID: ${{ inputs.report_repo_id }} + UPLOAD_REPORT_SUMMARY: ${{ inputs.upload_report_summary }} ACCESS_REPO_INFO_TOKEN: ${{ secrets.ACCESS_REPO_INFO_TOKEN }} CI_EVENT: ${{ inputs.ci_event }} CI_SHA: ${{ github.sha }} @@ -70,7 +79,7 @@ jobs: with: name: ci_results_${{ inputs.job }} path: ci_results_${{ inputs.job }} - + - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 - name: Send message to Slack for quantization workflow @@ -90,7 +99,7 @@ jobs: pip install huggingface_hub pip install slack_sdk pip show slack_sdk - python utils/notification_service_quantization.py "${{ inputs.quantization_matrix }}" + python utils/notification_service_quantization.py "${{ inputs.quantization_matrix }}" # Upload complete failure tables, as they might be big and only truncated versions could be sent to Slack. - name: Failure table artifacts @@ -98,4 +107,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: ci_results_${{ inputs.job }} - path: ci_results_${{ inputs.job }} \ No newline at end of file + path: ci_results_${{ inputs.job }} diff --git a/utils/notification_service.py b/utils/notification_service.py index 6c9eab3a85387b..3581fd4fac3f7f 100644 --- a/utils/notification_service.py +++ b/utils/notification_service.py @@ -108,11 +108,13 @@ def __init__( ci_title: str, model_results: Dict, additional_results: Dict, - selected_warnings: List = None, + repo_id: str = "hf-internal-testing/transformers_daily_ci", + selected_warnings: Union[List, None] = None, prev_ci_artifacts=None, ): self.title = title self.ci_title = ci_title + self.repo_id = repo_id # Failures and success of the modeling tests self.n_model_success = sum(r["success"] for r in model_results.values()) @@ -533,11 +535,11 @@ def payload(self) -> str: commit_info = api.upload_file( path_or_fileobj=file_path, path_in_repo=f"{datetime.datetime.today().strftime('%Y-%m-%d')}/ci_results_{job_name}/new_model_failures.txt", - repo_id="hf-internal-testing/transformers_daily_ci", + repo_id=self.repo_id, repo_type="dataset", token=os.environ.get("TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN", None), ) - url = f"https://huggingface.co/datasets/hf-internal-testing/transformers_daily_ci/raw/{commit_info.oid}/{datetime.datetime.today().strftime('%Y-%m-%d')}/ci_results_{job_name}/new_model_failures.txt" + url = f"https://huggingface.co/datasets/{self.repo_id}/raw/{commit_info.oid}/{datetime.datetime.today().strftime('%Y-%m-%d')}/ci_results_{job_name}/new_model_failures.txt" # extra processing to save to json format new_failed_tests = {} @@ -560,7 +562,7 @@ def payload(self) -> str: _ = api.upload_file( path_or_fileobj=file_path, path_in_repo=f"{datetime.datetime.today().strftime('%Y-%m-%d')}/ci_results_{job_name}/new_model_failures.json", - repo_id="hf-internal-testing/transformers_daily_ci", + repo_id=self.repo_id, repo_type="dataset", token=os.environ.get("TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN", None), ) @@ -920,6 +922,8 @@ def prepare_reports(title, header, reports, to_truncate=True): if __name__ == "__main__": SLACK_REPORT_CHANNEL_ID = os.environ["SLACK_REPORT_CHANNEL"] + REPORT_REPO_ID = os.environ.get("REPORT_REPO_ID", "hf-internal-testing/transformers_daily_ci") + UPLOAD_REPORT_SUMMARY = os.environ.get("UPLOAD_REPORT_SUMMARY") == "true" # runner_status = os.environ.get("RUNNER_STATUS") # runner_env_status = os.environ.get("RUNNER_ENV_STATUS") @@ -1220,7 +1224,8 @@ def prepare_reports(title, header, reports, to_truncate=True): os.makedirs(os.path.join(os.getcwd(), f"ci_results_{job_name}")) target_workflow = "huggingface/transformers/.github/workflows/self-scheduled-caller.yml@refs/heads/main" - is_scheduled_ci_run = os.environ.get("CI_WORKFLOW_REF") == target_workflow + amd_target_workflow = "huggingface/transformers/.github/workflows/self-scheduled-amd-caller.yml@refs/heads/main" + is_scheduled_ci_run = os.environ.get("CI_WORKFLOW_REF") in [target_workflow, amd_target_workflow] # Only the model testing job is concerned: this condition is to avoid other jobs to upload the empty list as # results. @@ -1233,7 +1238,7 @@ def prepare_reports(title, header, reports, to_truncate=True): api.upload_file( path_or_fileobj=f"ci_results_{job_name}/model_results.json", path_in_repo=f"{datetime.datetime.today().strftime('%Y-%m-%d')}/ci_results_{job_name}/model_results.json", - repo_id="hf-internal-testing/transformers_daily_ci", + repo_id=REPORT_REPO_ID, repo_type="dataset", token=os.environ.get("TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN", None), ) @@ -1255,7 +1260,7 @@ def prepare_reports(title, header, reports, to_truncate=True): api.upload_file( path_or_fileobj=f"ci_results_{job_name}/{test_to_result_name[job]}_results.json", path_in_repo=f"{datetime.datetime.today().strftime('%Y-%m-%d')}/ci_results_{job_name}/{test_to_result_name[job]}_results.json", - repo_id="hf-internal-testing/transformers_daily_ci", + repo_id=REPORT_REPO_ID, repo_type="dataset", token=os.environ.get("TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN", None), ) @@ -1276,6 +1281,7 @@ def prepare_reports(title, header, reports, to_truncate=True): ci_title, model_results, additional_results, + repo_id=REPORT_REPO_ID, selected_warnings=selected_warnings, prev_ci_artifacts=prev_ci_artifacts, ) @@ -1284,3 +1290,6 @@ def prepare_reports(title, header, reports, to_truncate=True): if message.n_failures or (ci_event != "push" and not ci_event.startswith("Push CI (AMD)")): message.post() message.post_reply() + + # if UPLOAD_REPORT_SUMMARY + # message.upload_to_repo()