From 48650cfca4d6874717edac1379f946174621d942 Mon Sep 17 00:00:00 2001 From: ydshieh Date: Thu, 17 Oct 2024 15:21:02 +0200 Subject: [PATCH] run --- .github/workflows/model_jobs.yml | 2 +- .github/workflows/self-scheduled-caller.yml | 58 +-------------------- .github/workflows/self-scheduled.yml | 43 +-------------- tests/models/vit/test_modeling_vit.py | 3 ++ utils/check_bad_commit.py | 2 + utils/notification_service.py | 38 +++++++------- utils/split_model_tests.py | 1 + 7 files changed, 28 insertions(+), 119 deletions(-) diff --git a/.github/workflows/model_jobs.yml b/.github/workflows/model_jobs.yml index 001e2c531d9bc8..6a0d1bfc988699 100644 --- a/.github/workflows/model_jobs.yml +++ b/.github/workflows/model_jobs.yml @@ -117,7 +117,7 @@ jobs: - name: Run all tests on GPU working-directory: /transformers - run: python3 -m pytest -rsfE -v --make-reports=${{ env.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports tests/${{ matrix.folders }} + run: python3 -m pytest -rsfE -v --make-reports=${{ env.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports tests/${{ matrix.folders }} -k "test_foo" - name: Failure short reports if: ${{ failure() }} diff --git a/.github/workflows/self-scheduled-caller.yml b/.github/workflows/self-scheduled-caller.yml index 75ea3bb24bc7fa..d4b7fb5c381416 100644 --- a/.github/workflows/self-scheduled-caller.yml +++ b/.github/workflows/self-scheduled-caller.yml @@ -7,7 +7,7 @@ on: - cron: "17 2 * * *" push: branches: - - run_scheduled_ci* + - ping_author_6 jobs: model-ci: @@ -20,59 +20,3 @@ jobs: docker: huggingface/transformers-all-latest-gpu ci_event: Daily CI secrets: inherit - - torch-pipeline: - name: Torch pipeline CI - uses: ./.github/workflows/self-scheduled.yml - with: - job: run_pipelines_torch_gpu - slack_report_channel: "#transformers-ci-daily-pipeline-torch" - runner: daily-ci - docker: huggingface/transformers-pytorch-gpu - ci_event: Daily CI - secrets: inherit - - tf-pipeline: - name: TF pipeline CI - uses: ./.github/workflows/self-scheduled.yml - with: - job: run_pipelines_tf_gpu - slack_report_channel: "#transformers-ci-daily-pipeline-tf" - runner: daily-ci - docker: huggingface/transformers-tensorflow-gpu - ci_event: Daily CI - secrets: inherit - - example-ci: - name: Example CI - uses: ./.github/workflows/self-scheduled.yml - with: - job: run_examples_gpu - slack_report_channel: "#transformers-ci-daily-examples" - runner: daily-ci - docker: huggingface/transformers-all-latest-gpu - ci_event: Daily CI - secrets: inherit - - deepspeed-ci: - name: DeepSpeed CI - uses: ./.github/workflows/self-scheduled.yml - with: - job: run_torch_cuda_extensions_gpu - slack_report_channel: "#transformers-ci-daily-deepspeed" - runner: daily-ci - docker: huggingface/transformers-pytorch-deepspeed-latest-gpu - ci_event: Daily CI - working-directory-prefix: /workspace - secrets: inherit - - quantization-ci: - name: Quantization CI - uses: ./.github/workflows/self-scheduled.yml - with: - job: run_quantization_torch_gpu - slack_report_channel: "#transformers-ci-daily-quantization" - runner: daily-ci - docker: huggingface/transformers-quantization-latest-gpu - ci_event: Daily CI - secrets: inherit diff --git a/.github/workflows/self-scheduled.yml b/.github/workflows/self-scheduled.yml index 353fb59843e4a5..006e01c49762dc 100644 --- a/.github/workflows/self-scheduled.yml +++ b/.github/workflows/self-scheduled.yml @@ -496,46 +496,6 @@ jobs: name: ${{ env.machine_type }}_run_quantization_torch_gpu_${{ env.matrix_folders }}_test_reports path: /transformers/reports/${{ env.machine_type }}_run_quantization_torch_gpu_${{ matrix.folders }}_test_reports - run_extract_warnings: - # Let's only do this for the job `run_models_gpu` to simplify the (already complex) logic. - if: ${{ always() && inputs.job == 'run_models_gpu' }} - name: Extract warnings in CI artifacts - runs-on: ubuntu-22.04 - needs: [setup, run_models_gpu] - steps: - - name: Checkout transformers - uses: actions/checkout@v4 - with: - fetch-depth: 2 - - - name: Install transformers - run: pip install transformers - - - name: Show installed libraries and their versions - run: pip freeze - - - name: Create output directory - run: mkdir warnings_in_ci - - - uses: actions/download-artifact@v4 - with: - path: warnings_in_ci - - - name: Show artifacts - run: echo "$(python3 -c 'import os; d = os.listdir(); print(d)')" - working-directory: warnings_in_ci - - - name: Extract warnings in CI artifacts - run: | - python3 utils/extract_warnings.py --workflow_run_id ${{ github.run_id }} --output_dir warnings_in_ci --token ${{ secrets.ACCESS_REPO_INFO_TOKEN }} --from_gh - echo "$(python3 -c 'import os; import json; fp = open("warnings_in_ci/selected_warnings.json"); d = json.load(fp); d = "\n".join(d) ;print(d)')" - - - name: Upload artifact - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: warnings_in_ci - path: warnings_in_ci/selected_warnings.json send_results: name: Slack Report @@ -546,8 +506,7 @@ jobs: run_pipelines_tf_gpu, run_examples_gpu, run_torch_cuda_extensions_gpu, - run_quantization_torch_gpu, - run_extract_warnings + run_quantization_torch_gpu ] if: ${{ always() }} uses: ./.github/workflows/slack-report.yml diff --git a/tests/models/vit/test_modeling_vit.py b/tests/models/vit/test_modeling_vit.py index cace1d377034fb..4407a33dbf02be 100644 --- a/tests/models/vit/test_modeling_vit.py +++ b/tests/models/vit/test_modeling_vit.py @@ -219,6 +219,9 @@ def setUp(self): def test_multi_gpu_data_parallel_forward(self): super().test_multi_gpu_data_parallel_forward() + def test_foo(self): + assert 1 == 2 + def test_config(self): self.config_tester.run_common_tests() diff --git a/utils/check_bad_commit.py b/utils/check_bad_commit.py index 091ed5c4a427f9..1f265803582912 100644 --- a/utils/check_bad_commit.py +++ b/utils/check_bad_commit.py @@ -131,8 +131,10 @@ def get_commit_info(commit): url = f"https://api.github.com/repos/huggingface/transformers/commits/{commit}/pulls" pr_info_for_commit = requests.get(url).json() + print(pr_info_for_commit) if len(pr_info_for_commit) > 0: + print(pr_info_for_commit) pr_number = pr_info_for_commit[0]["number"] url = f"https://api.github.com/repos/huggingface/transformers/pulls/{pr_number}" diff --git a/utils/notification_service.py b/utils/notification_service.py index 629b793337889a..7652a4d8d89cb1 100644 --- a/utils/notification_service.py +++ b/utils/notification_service.py @@ -528,16 +528,17 @@ def payload(self) -> str: with open(file_path, "w", encoding="UTF-8") as fp: fp.write(failure_text) - # upload results to Hub dataset - file_path = os.path.join(os.getcwd(), f"ci_results_{job_name}/new_model_failures.txt") - 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_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" + # # upload results to Hub dataset + # file_path = os.path.join(os.getcwd(), f"ci_results_{job_name}/new_model_failures.txt") + # 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_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/hf-internal-testing/transformers_daily_ci" # extra processing to save to json format new_failed_tests = {} @@ -1250,15 +1251,14 @@ def prepare_reports(title, header, reports, to_truncate=True): ) prev_ci_artifacts = None - if is_scheduled_ci_run: - if job_name == "run_models_gpu": - # Get the last previously completed CI's failure tables - artifact_names = [f"ci_results_{job_name}"] - output_dir = os.path.join(os.getcwd(), "previous_reports") - os.makedirs(output_dir, exist_ok=True) - prev_ci_artifacts = get_last_daily_ci_reports( - artifact_names=artifact_names, output_dir=output_dir, token=os.environ["ACCESS_REPO_INFO_TOKEN"] - ) + if job_name == "run_models_gpu": + # Get the last previously completed CI's failure tables + artifact_names = [f"ci_results_{job_name}"] + output_dir = os.path.join(os.getcwd(), "previous_reports") + os.makedirs(output_dir, exist_ok=True) + prev_ci_artifacts = get_last_daily_ci_reports( + artifact_names=artifact_names, output_dir=output_dir, token=os.environ["ACCESS_REPO_INFO_TOKEN"] + ) message = Message( title, diff --git a/utils/split_model_tests.py b/utils/split_model_tests.py index e5083aaeb46fa5..958b872c4a50cd 100644 --- a/utils/split_model_tests.py +++ b/utils/split_model_tests.py @@ -62,4 +62,5 @@ start = end end = start + num_jobs_per_splits + (1 if idx < num_jobs % args.num_splits else 0) model_splits.append(d[start:end]) + model_splits = [["models/vit"]] print(model_splits)