Skip to content

Commit

Permalink
warning for timeout models
Browse files Browse the repository at this point in the history
  • Loading branch information
mengfei25 committed Jul 22, 2024
1 parent 515b0c4 commit 4ac2a40
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
13 changes: 11 additions & 2 deletions .github/ci_expected_accuracy/check_expected.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
new_models = []
new_pass_models = []
lost_models = []
timeout_models = []
for model_name in model_names:
# for index, row in refer_data.iterrows():
test_row = next(([i, line] for i, line in test_data.iterrows() if line["name"] == model_name), "N/A")
Expand All @@ -56,6 +57,13 @@
elif 'pass' not in refer_accuracy:
new_pass_models.append([model_name, test_accuracy])
refer_data.at[refer_row[0], args.dtype] = test_accuracy
elif 'timeout' in test_accuracy:
timeout_models.append([model_name, test_accuracy])
if refer_accuracy == "N/A":
new_models.append([model_name, test_accuracy])
refer_data.loc[len(refer_data),:] = "N/A"
refer_data.at[len(refer_data) - 1, "name"] = model_name
refer_data.at[len(refer_data) - 1, args.dtype] = test_accuracy
else:
if refer_accuracy == "N/A":
new_models.append([model_name, test_accuracy])
Expand All @@ -74,8 +82,9 @@
print("============ Summary for {} {} {} accuracy ============".format(args.suite, args.dtype, args.mode))
print("Total models:", len(model_names))
print("Passed models:", len(passed_models))
print("Real failed: models:", len(real_failed_models), real_failed_models)
print("Expected failed: models:", len(expected_failed_models), expected_failed_models)
print("Real failed models:", len(real_failed_models), real_failed_models)
print("Expected failed models:", len(expected_failed_models), expected_failed_models)
print("Warning timeout models:", len(timeout_models), timeout_models)
print("New models:", len(new_models), new_models)
print("Failed to passed models:", len(new_pass_models), new_pass_models)
print("Not run/in models:", len(lost_models), lost_models)
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/nightly_ondemand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:
TRANSFORMERS_VERSION: ${{ steps.pinned.outputs.TRANSFORMERS_VERSION }}
TIMM_COMMIT_ID: ${{ steps.pinned.outputs.TIMM_COMMIT_ID }}
TRITON_COMMIT_ID: ${{ steps.pinned.outputs.TRITON_COMMIT_ID }}
TIMEOUT_MODELS: ${{ steps.summary.outputs.TIMEOUT_MODELS }}
steps:
- name: Checkout torch-xpu-ops
uses: actions/checkout@v4
Expand Down Expand Up @@ -214,16 +215,25 @@ jobs:
scenario: ${{ inputs.scenario }}
hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
- name: Summarize archieve files
id: summary
if: always()
run: |
rm -rf ${{ github.workspace }}/upload_files
cp -r ${{ github.workspace }}/../pytorch/inductor_log ${{ github.workspace }}/upload_files
mkdir -p ${{ github.workspace }}/../../_backup/ && cd ${{ github.workspace }}/../../_backup/
find . -type f -name "*.tgz" -mtime +3 -delete # delete files older than 3 days
tar zcf xpu-inductor-${GITHUB_RUN_ID}.tgz -C ${{ github.workspace }}/upload_files/ . # backup logs
failed_case=$(grep "Real failed: models: *[1-9]" ${{ github.workspace }}/upload_files/summary_accuracy.log |wc -l || true)
if [ ${failed_case} -ne 0 ];then
grep -E "Real failed: models: [1-9]|Summary for" ${{ github.workspace }}/upload_files/summary_accuracy.log
failed_models=$(grep "Real failed models: *[1-9]" ${{ github.workspace }}/upload_files/summary_accuracy.log |wc -l || true)
timeout_models=$(grep "timeout models: *[1-9]" ${{ github.workspace }}/upload_files/summary_accuracy.log |wc -l || true)
if [ ${timeout_models} -ne 0 ];then
TIMEOUT_MODELS="$(
grep -E "timeout models: [1-9]|Summary for" ${{ github.workspace }}/upload_files/summary_accuracy.log |grep "timeout" -B 1
)"
echo "${TIMEOUT_MODELS}" |sed 's/Summary/\\nSummary/g;s/Timeout/\\nTimeout/g' |tee -a "${GITHUB_OUTPUT}"
grep -E "timeout models: [1-9]|Summary for" ${{ github.workspace }}/upload_files/summary_accuracy.log |grep "timeout" -B 1
fi
if [ ${failed_models} -ne 0 ];then
grep -E "Real failed models: [1-9]|Summary for" ${{ github.workspace }}/upload_files/summary_accuracy.log |grep "failed" -B 1
exit 1
fi
- name: Upload Inductor XPU E2E Data
Expand Down Expand Up @@ -262,6 +272,7 @@ jobs:
TRANSFORMERS_VERSION="${{ needs.Linux-Nightly-Ondemand-E2E-Tests.outputs.TRANSFORMERS_VERSION }}"
TIMM_COMMIT_ID="${{ needs.Linux-Nightly-Ondemand-E2E-Tests.outputs.TIMM_COMMIT_ID }}"
TRITON_COMMIT_ID="${{ needs.Linux-Nightly-Ondemand-E2E-Tests.outputs.TRITON_COMMIT_ID }}"
TIMEOUT_MODELS="${{ needs.Linux-Nightly-Ondemand-E2E-Tests.outputs.TIMEOUT_MODELS }}"
# Test status
if [ "${{ needs.Linux-Nightly-Ondemand-E2E-Tests.result }}" == "success" ];then
test_status=Success
Expand Down Expand Up @@ -304,6 +315,7 @@ jobs:
fi
echo -e "Inputs | $test_scope\n--- | --- \n" >> ${{ github.workspace }}/report.txt
fi
echo "$TIMEOUT_MODELS" >> ${{ github.workspace }}/report.txt
echo "$cc_comment" >> ${{ github.workspace }}/report.txt
# Report
report_txt=$(cat ${{ github.workspace }}/report.txt)
Expand Down

0 comments on commit 4ac2a40

Please sign in to comment.