Skip to content

Commit

Permalink
run
Browse files Browse the repository at this point in the history
  • Loading branch information
ydshieh committed Oct 17, 2024
1 parent 9507665 commit 48650cf
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 119 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/model_jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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() }}
Expand Down
58 changes: 1 addition & 57 deletions .github/workflows/self-scheduled-caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- cron: "17 2 * * *"
push:
branches:
- run_scheduled_ci*
- ping_author_6

jobs:
model-ci:
Expand All @@ -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
43 changes: 1 addition & 42 deletions .github/workflows/self-scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tests/models/vit/test_modeling_vit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 2 additions & 0 deletions utils/check_bad_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
38 changes: 19 additions & 19 deletions utils/notification_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions utils/split_model_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 48650cf

Please sign in to comment.