From 1d682c04e284b512643008ee6c730b4c3164f8d9 Mon Sep 17 00:00:00 2001 From: mengfeil Date: Thu, 8 May 2025 11:38:11 +0800 Subject: [PATCH 01/18] modify perf comparison --- .github/scripts/e2e_summary.sh | 29 ++--------------- .github/workflows/nightly_ondemand.yml | 30 ++++++++++++++++-- .../workflows/nightly_ondemand_rolling.yml | 31 +++++++++++++++++-- .github/workflows/nightly_ondemand_whl.yml | 31 +++++++++++++++++-- .github/workflows/pull.yml | 16 +++++++++- 5 files changed, 102 insertions(+), 35 deletions(-) diff --git a/.github/scripts/e2e_summary.sh b/.github/scripts/e2e_summary.sh index 2b5bf97b8..bc182e0aa 100644 --- a/.github/scripts/e2e_summary.sh +++ b/.github/scripts/e2e_summary.sh @@ -1,7 +1,7 @@ #!/bin/bash results_dir="$1" -artifact_type="$2" +reference_dir="$2" check_file="$(dirname "$0")/../ci_expected_accuracy/check_expected.py" rm -rf /tmp/tmp-*.txt @@ -147,32 +147,9 @@ fi performance=$(find "${results_dir}" -name "*.csv" |grep -E "_xpu_performance.csv" -c) if [ "${performance}" -gt 0 ];then echo "### Performance" - pip install jq > /dev/null 2>&1 - if [ "${artifact_type}" != "" ];then - gh api \ - --method GET -F per_page=100 -F page=10 \ - -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \ - /repos/${GITHUB_REPOSITORY:-"intel/torch-xpu-ops"}/actions/artifacts \ - > ${GITHUB_WORKSPACE:-"/tmp"}/refer.json - artifact_id="$(eval "jq -r \ - '[.artifacts[] | \ - select(.name|test(\"${artifact_type}.*\")) | \ - select(.workflow_run.head_branch|test(\"main\"))][0].id' \ - ${GITHUB_WORKSPACE:-"/tmp"}/refer.json")" - if [ "$artifact_id" -gt 1 ];then - gh api \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - /repos/${GITHUB_REPOSITORY:-"intel/torch-xpu-ops"}/actions/artifacts/${artifact_id}/zip > reference.zip - fi - fi - rm -rf ${GITHUB_WORKSPACE:-"/tmp"}/reference - mkdir ${GITHUB_WORKSPACE:-"/tmp"}/reference - mv reference.zip ${GITHUB_WORKSPACE:-"/tmp"}/reference - unzip ${GITHUB_WORKSPACE:-"/tmp"}/reference/reference.zip -d ${GITHUB_WORKSPACE:-"/tmp"}/reference > /dev/null 2>&1 - reference_dir="${GITHUB_WORKSPACE:-"/tmp"}/reference" + unzip ${reference_dir}/*.zip -d ${reference_dir} > /dev/null 2>&1 python "$(dirname "$0")/perf_comparison.py" -xpu ${results_dir} -refer ${reference_dir} - cp ${GITHUB_WORKSPACE:-"/tmp"}/reference/best.csv ${results_dir}/best.csv > /dev/null 2>&1 || true + cp ${reference_dir}/best.csv ${results_dir}/best.csv > /dev/null 2>&1 || true python "$(dirname "$0")/calculate_best_perf.py" \ --new ${results_dir} \ --best ${results_dir}/best.csv \ diff --git a/.github/workflows/nightly_ondemand.yml b/.github/workflows/nightly_ondemand.yml index 701e3e82a..a3cf81c52 100644 --- a/.github/workflows/nightly_ondemand.yml +++ b/.github/workflows/nightly_ondemand.yml @@ -59,7 +59,8 @@ on: default: '3.10' description: Python version -permissions: read-all +permissions: + issues: write concurrency: group: ${{ github.workflow }}-${{ github.sha }}-${{ github.event_name }}-${{ inputs.pytorch }}-${{ inputs.keep_torch_xpu_ops }}-${{ inputs.ut }}-${{ inputs.triton }}-${{ inputs.suite }}-${{ inputs.dt }}-${{ inputs.mode }}-${{ inputs.scenario }}-${{ inputs.model }}-${{ inputs.python }} @@ -102,6 +103,7 @@ jobs: timeout-minutes: 3600 env: GH_TOKEN: ${{ github.token }} + reference_issue: 1645 pytorch: ${{ needs.Linux-Nightly-Ondemand-Build.outputs.torch_commit_id }} keep_torch_xpu_ops: ${{ github.event_name == 'schedule' && 'false' || inputs.keep_torch_xpu_ops }} python: ${{ github.event_name == 'schedule' && '3.10' || inputs.python }} @@ -300,6 +302,24 @@ jobs: scenario: ${{ inputs.scenario }} hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} + - name: Get Reference Run ID + id: reference_id + run: | + set -xe + if [ "${{ env.run_type }}" == "on-demand" ];then + artifact_type="weekly" + else + artifact_type="${{ env.run_type }}" + fi + REFERENCE_RUN_ID="$(gh --repo intel/torch-xpu-ops issue view ${reference_issue} \ + --json body -q .body |grep "Inductor-${artifact_type}-LTS-XPU-E2E" |sed 's/.*: *//')" + echo "REFERENCE_RUN_ID=${REFERENCE_RUN_ID}" >> "${GITHUB_OUTPUT}" + - name: Download Reference Artifact + uses: actions/download-artifact@v4 + with: + run-id: ${{ steps.reference_id.outputs.REFERENCE_RUN_ID }} + pattern: Inductor-${{ env.run_type }}-LTS-XPU-E2E-* + path: reference - name: Summarize archieve files id: summary if: ${{ ! cancelled() }} @@ -314,7 +334,7 @@ jobs: source activate e2e_ci bash ${{ github.workspace }}/.github/scripts/e2e_summary.sh \ ${{ github.workspace }}/upload_files \ - Inductor-${{ env.run_type }}-LTS-XPU-E2E \ + ${{ github.workspace }}/reference \ >> ${GITHUB_STEP_SUMMARY} exit_label=$(awk 'BEGIN{sum=0}{if($2>0){sum++}}END{print sum}' /tmp/tmp-result.txt) if [ ${exit_label} -ne 0 ];then @@ -335,6 +355,12 @@ jobs: with: name: Inductor-${{ env.run_type }}-LTS-XPU-E2E-Data-${{ github.event.pull_request.number || github.sha }} path: ${{ github.workspace }}/upload_files + - name: Upload Reference Run ID + if: ${{ env.run_type != 'on-demand' }} + run: | + gh --repo ${GITHUB_REPOSITORY} issue view ${reference_issue} --json body -q .body | \ + sed "s/Inductor-${{ env.run_type }}-Rolling-XPU-E2E:.*/Inductor-${{ env.run_type }}-Rolling-XPU-E2E: ${GITHUB_RUN_ID}/" | sed '/^$/d' > new_body.txt + gh --repo ${GITHUB_REPOSITORY} issue edit ${reference_issue} --body-file new_body.txt Tests-Failure-And-Report: if: ${{ ! cancelled() }} diff --git a/.github/workflows/nightly_ondemand_rolling.yml b/.github/workflows/nightly_ondemand_rolling.yml index a084af3d3..8cd4d5d5f 100644 --- a/.github/workflows/nightly_ondemand_rolling.yml +++ b/.github/workflows/nightly_ondemand_rolling.yml @@ -59,7 +59,8 @@ on: default: '3.10' description: Python version -permissions: read-all +permissions: + issues: write concurrency: group: ${{ github.workflow }}-${{ github.sha }}-${{ github.event_name }}-${{ inputs.pytorch }}-${{ inputs.keep_torch_xpu_ops }}-${{ inputs.ut }}-${{ inputs.triton }}-${{ inputs.suite }}-${{ inputs.dt }}-${{ inputs.mode }}-${{ inputs.scenario }}-${{ inputs.model }}-${{ inputs.python }} @@ -117,6 +118,7 @@ jobs: timeout-minutes: 3600 env: GH_TOKEN: ${{ github.token }} + reference_issue: 1645 pytorch: ${{ needs.Linux-Nightly-Ondemand-Build-Rolling.outputs.torch_commit_id }} keep_torch_xpu_ops: ${{ github.event_name == 'schedule' && 'false' || inputs.keep_torch_xpu_ops }} python: ${{ github.event_name == 'schedule' && '3.10' || inputs.python }} @@ -326,7 +328,24 @@ jobs: scenario: ${{ inputs.scenario }} hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} driver: rolling - + - name: Get Reference Run ID + id: reference_id + run: | + set -xe + if [ "${{ env.run_type }}" == "on-demand" ];then + artifact_type="weekly" + else + artifact_type="${{ env.run_type }}" + fi + REFERENCE_RUN_ID="$(gh --repo intel/torch-xpu-ops issue view ${reference_issue} \ + --json body -q .body |grep "Inductor-${artifact_type}-Rolling-XPU-E2E" |sed 's/.*: *//')" + echo "REFERENCE_RUN_ID=${REFERENCE_RUN_ID}" >> "${GITHUB_OUTPUT}" + - name: Download Reference Artifact + uses: actions/download-artifact@v4 + with: + run-id: ${{ steps.reference_id.outputs.REFERENCE_RUN_ID }} + pattern: Inductor-${{ env.run_type }}-Rolling-XPU-E2E-* + path: reference - name: Summarize archieve files id: summary if: ${{ ! cancelled() }} @@ -341,7 +360,7 @@ jobs: source activate e2e_ci bash ${{ github.workspace }}/.github/scripts/e2e_summary.sh \ ${{ github.workspace }}/upload_files \ - Inductor-${{ env.run_type }}-Rolling-XPU-E2E \ + ${{ github.workspace }}/reference \ >> ${GITHUB_STEP_SUMMARY} exit_label=$(awk 'BEGIN{sum=0}{if($2>0){sum++}}END{print sum}' /tmp/tmp-result.txt) if [ ${exit_label} -ne 0 ];then @@ -362,6 +381,12 @@ jobs: with: name: Inductor-${{ env.run_type }}-Rolling-XPU-E2E-Data-${{ github.event.pull_request.number || github.sha }} path: ${{ github.workspace }}/upload_files + - name: Upload Reference Run ID + if: ${{ env.run_type != 'on-demand' }} + run: | + gh --repo ${GITHUB_REPOSITORY} issue view ${reference_issue} --json body -q .body | \ + sed "s/Inductor-${{ env.run_type }}-Rolling-XPU-E2E:.*/Inductor-${{ env.run_type }}-Rolling-XPU-E2E: ${GITHUB_RUN_ID}/" | sed '/^$/d' > new_body.txt + gh --repo ${GITHUB_REPOSITORY} issue edit ${reference_issue} --body-file new_body.txt Tests-Failure-And-Report: if: ${{ ! cancelled() }} diff --git a/.github/workflows/nightly_ondemand_whl.yml b/.github/workflows/nightly_ondemand_whl.yml index 11092a858..e28159e52 100644 --- a/.github/workflows/nightly_ondemand_whl.yml +++ b/.github/workflows/nightly_ondemand_whl.yml @@ -49,7 +49,8 @@ on: default: '3.10' description: Python version -permissions: read-all +permissions: + issues: write concurrency: group: ${{ github.workflow }}-${{ github.sha }}-${{ github.event_name }}-${{ inputs.pytorch }}-${{ inputs.ut }}-${{ inputs.suite }}-${{ inputs.dt }}-${{ inputs.mode }}-${{ inputs.scenario }}-${{ inputs.model }}-${{ inputs.python }} @@ -72,6 +73,7 @@ jobs: timeout-minutes: 3600 env: GH_TOKEN: ${{ github.token }} + reference_issue: 1645 pytorch: ${{ github.event_name == 'schedule' && 'nightly' || inputs.pytorch }} python: ${{ github.event_name == 'schedule' && '3.10' || inputs.python }} run_type: ${{ (github.event_name == 'schedule' && (github.event.schedule == '0 17 * * 5' && 'weekly' || 'nightly')) || 'on-demand' }} @@ -262,7 +264,24 @@ jobs: scenario: ${{ inputs.scenario }} pytorch: nightly_wheel hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} - + - name: Get Reference Run ID + id: reference_id + run: | + set -xe + if [ "${{ env.run_type }}" == "on-demand" ];then + artifact_type="weekly" + else + artifact_type="${{ env.run_type }}" + fi + REFERENCE_RUN_ID="$(gh --repo intel/torch-xpu-ops issue view ${reference_issue} \ + --json body -q .body |grep "Inductor-${artifact_type}-Pre-XPU-E2E" |sed 's/.*: *//')" + echo "REFERENCE_RUN_ID=${REFERENCE_RUN_ID}" >> "${GITHUB_OUTPUT}" + - name: Download Reference Artifact + uses: actions/download-artifact@v4 + with: + run-id: ${{ steps.reference_id.outputs.REFERENCE_RUN_ID }} + pattern: Inductor-${{ env.run_type }}-Pre-XPU-E2E-* + path: reference - name: Summarize archieve files id: summary if: ${{ ! cancelled() }} @@ -277,7 +296,7 @@ jobs: source activate e2e_ci bash ${{ github.workspace }}/.github/scripts/e2e_summary.sh \ ${{ github.workspace }}/upload_files \ - Inductor-${{ env.run_type }}-Pre-XPU-E2E \ + ${{ github.workspace }}/reference \ >> ${GITHUB_STEP_SUMMARY} exit_label=$(awk 'BEGIN{sum=0}{if($2>0){sum++}}END{print sum}' /tmp/tmp-result.txt) if [ ${exit_label} -ne 0 ];then @@ -298,6 +317,12 @@ jobs: with: name: Inductor-${{ env.run_type }}-Pre-XPU-E2E-Data-${{ github.event.pull_request.number || github.sha }} path: ${{ github.workspace }}/upload_files + - name: Upload Reference Run ID + if: ${{ env.run_type != 'on-demand' }} + run: | + gh --repo ${GITHUB_REPOSITORY} issue view ${reference_issue} --json body -q .body | \ + sed "s/Inductor-${{ env.run_type }}-Rolling-XPU-E2E:.*/Inductor-${{ env.run_type }}-Rolling-XPU-E2E: ${GITHUB_RUN_ID}/" | sed '/^$/d' > new_body.txt + gh --repo ${GITHUB_REPOSITORY} issue edit ${reference_issue} --body-file new_body.txt Tests-Failure-And-Report: if: ${{ ! cancelled() }} diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 912b3eb31..c959b218b 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -73,6 +73,7 @@ jobs: runs-on: pvc_e2e env: GH_TOKEN: ${{ github.token }} + reference_issue: 1645 # Don't run on forked repos and draft PRs if: ${{ (github.repository_owner == 'intel') && (github.event.pull_request.draft == false) }} timeout-minutes: 900 @@ -183,6 +184,19 @@ jobs: scenario: accuracy,performance env_prepare: true hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} + - name: Get Reference Run ID + id: reference_id + run: | + set -xe + REFERENCE_RUN_ID="$(gh --repo intel/torch-xpu-ops issue view ${reference_issue} \ + --json body -q .body |grep "Inductor-weekly-LTS-XPU-E2E" |sed 's/.*: *//')" + echo "REFERENCE_RUN_ID=${REFERENCE_RUN_ID}" >> "${GITHUB_OUTPUT}" + - name: Download Reference Artifact + uses: actions/download-artifact@v4 + with: + run-id: ${{ steps.reference_id.outputs.REFERENCE_RUN_ID }} + pattern: Inductor-weekly-LTS-XPU-E2E-* + path: reference - name: Summarize archieve files if: ${{ ! cancelled() }} run: | @@ -192,7 +206,7 @@ jobs: source activate e2e_ci bash ${{ github.workspace }}/.github/scripts/e2e_summary.sh \ ${{ github.workspace }}/upload_files \ - Inductor-weekly-LTS-XPU-E2E \ + ${{ github.workspace }}/reference \ >> ${GITHUB_STEP_SUMMARY} exit_label=$(awk 'BEGIN{sum=0}{if($2>0){sum++}}END{print sum}' /tmp/tmp-result.txt) if [ ${exit_label} -ne 0 ];then From 0f56eeebb3dfd3c7742ac68af79e078838f307b3 Mon Sep 17 00:00:00 2001 From: mengfeil Date: Thu, 8 May 2025 11:46:25 +0800 Subject: [PATCH 02/18] workflow permission --- .github/workflows/nightly_ondemand.yml | 3 +-- .github/workflows/nightly_ondemand_rolling.yml | 3 +-- .github/workflows/nightly_ondemand_whl.yml | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nightly_ondemand.yml b/.github/workflows/nightly_ondemand.yml index a3cf81c52..f075a15a2 100644 --- a/.github/workflows/nightly_ondemand.yml +++ b/.github/workflows/nightly_ondemand.yml @@ -59,8 +59,7 @@ on: default: '3.10' description: Python version -permissions: - issues: write +permissions: write-all concurrency: group: ${{ github.workflow }}-${{ github.sha }}-${{ github.event_name }}-${{ inputs.pytorch }}-${{ inputs.keep_torch_xpu_ops }}-${{ inputs.ut }}-${{ inputs.triton }}-${{ inputs.suite }}-${{ inputs.dt }}-${{ inputs.mode }}-${{ inputs.scenario }}-${{ inputs.model }}-${{ inputs.python }} diff --git a/.github/workflows/nightly_ondemand_rolling.yml b/.github/workflows/nightly_ondemand_rolling.yml index 8cd4d5d5f..47bde6fa4 100644 --- a/.github/workflows/nightly_ondemand_rolling.yml +++ b/.github/workflows/nightly_ondemand_rolling.yml @@ -59,8 +59,7 @@ on: default: '3.10' description: Python version -permissions: - issues: write +permissions: write-all concurrency: group: ${{ github.workflow }}-${{ github.sha }}-${{ github.event_name }}-${{ inputs.pytorch }}-${{ inputs.keep_torch_xpu_ops }}-${{ inputs.ut }}-${{ inputs.triton }}-${{ inputs.suite }}-${{ inputs.dt }}-${{ inputs.mode }}-${{ inputs.scenario }}-${{ inputs.model }}-${{ inputs.python }} diff --git a/.github/workflows/nightly_ondemand_whl.yml b/.github/workflows/nightly_ondemand_whl.yml index e28159e52..c3339de58 100644 --- a/.github/workflows/nightly_ondemand_whl.yml +++ b/.github/workflows/nightly_ondemand_whl.yml @@ -49,8 +49,7 @@ on: default: '3.10' description: Python version -permissions: - issues: write +permissions: write-all concurrency: group: ${{ github.workflow }}-${{ github.sha }}-${{ github.event_name }}-${{ inputs.pytorch }}-${{ inputs.ut }}-${{ inputs.suite }}-${{ inputs.dt }}-${{ inputs.mode }}-${{ inputs.scenario }}-${{ inputs.model }}-${{ inputs.python }} From 82711374de6067b72c72e54f3a58e498bcc70598 Mon Sep 17 00:00:00 2001 From: mengfeil Date: Thu, 8 May 2025 13:32:21 +0800 Subject: [PATCH 03/18] workflow permission --- .github/workflows/_performance_comparison.yml | 4 ++-- .github/workflows/nightly_ondemand.yml | 2 +- .github/workflows/nightly_ondemand_rolling.yml | 2 +- .github/workflows/nightly_ondemand_whl.yml | 2 +- .github/workflows/pull.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/_performance_comparison.yml b/.github/workflows/_performance_comparison.yml index 76f216cee..9596ebe79 100644 --- a/.github/workflows/_performance_comparison.yml +++ b/.github/workflows/_performance_comparison.yml @@ -33,13 +33,13 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ inputs.target }} - pattern: XPU-E2E + pattern: Inductor-*-XPU-E2E-* path: target - name: Downlaod baseline artifacts uses: actions/download-artifact@v4 with: run-id: ${{ inputs.baseline }} - pattern: XPU-E2E + pattern: Inductor-*-XPU-E2E-* path: baseline - name: Get comparison artifacts run: | diff --git a/.github/workflows/nightly_ondemand.yml b/.github/workflows/nightly_ondemand.yml index f075a15a2..1afcb2383 100644 --- a/.github/workflows/nightly_ondemand.yml +++ b/.github/workflows/nightly_ondemand.yml @@ -317,7 +317,7 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ steps.reference_id.outputs.REFERENCE_RUN_ID }} - pattern: Inductor-${{ env.run_type }}-LTS-XPU-E2E-* + pattern: Inductor-*-XPU-E2E-* path: reference - name: Summarize archieve files id: summary diff --git a/.github/workflows/nightly_ondemand_rolling.yml b/.github/workflows/nightly_ondemand_rolling.yml index 47bde6fa4..d63cae7c0 100644 --- a/.github/workflows/nightly_ondemand_rolling.yml +++ b/.github/workflows/nightly_ondemand_rolling.yml @@ -343,7 +343,7 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ steps.reference_id.outputs.REFERENCE_RUN_ID }} - pattern: Inductor-${{ env.run_type }}-Rolling-XPU-E2E-* + pattern: Inductor-*-XPU-E2E-* path: reference - name: Summarize archieve files id: summary diff --git a/.github/workflows/nightly_ondemand_whl.yml b/.github/workflows/nightly_ondemand_whl.yml index c3339de58..d4e24d26d 100644 --- a/.github/workflows/nightly_ondemand_whl.yml +++ b/.github/workflows/nightly_ondemand_whl.yml @@ -279,7 +279,7 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ steps.reference_id.outputs.REFERENCE_RUN_ID }} - pattern: Inductor-${{ env.run_type }}-Pre-XPU-E2E-* + pattern: Inductor-*-XPU-E2E-* path: reference - name: Summarize archieve files id: summary diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index c959b218b..6e34a44ca 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -195,7 +195,7 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ steps.reference_id.outputs.REFERENCE_RUN_ID }} - pattern: Inductor-weekly-LTS-XPU-E2E-* + pattern: Inductor-*-XPU-E2E-* path: reference - name: Summarize archieve files if: ${{ ! cancelled() }} From 273a86dbcb6aa3ed072ffc8bae019f6fb4e0a30b Mon Sep 17 00:00:00 2001 From: mengfeil Date: Thu, 8 May 2025 13:36:56 +0800 Subject: [PATCH 04/18] update --- .github/workflows/_performance_comparison.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_performance_comparison.yml b/.github/workflows/_performance_comparison.yml index 9596ebe79..f2411003b 100644 --- a/.github/workflows/_performance_comparison.yml +++ b/.github/workflows/_performance_comparison.yml @@ -33,7 +33,7 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ inputs.target }} - pattern: Inductor-*-XPU-E2E-* + pattern: Inductor-* path: target - name: Downlaod baseline artifacts uses: actions/download-artifact@v4 From 76703a3993fa4ce691f1e1dc5659cdd7067c8e59 Mon Sep 17 00:00:00 2001 From: mengfeil Date: Thu, 8 May 2025 13:38:30 +0800 Subject: [PATCH 05/18] update --- .github/workflows/_performance_comparison.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_performance_comparison.yml b/.github/workflows/_performance_comparison.yml index f2411003b..976cef09d 100644 --- a/.github/workflows/_performance_comparison.yml +++ b/.github/workflows/_performance_comparison.yml @@ -33,7 +33,7 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ inputs.target }} - pattern: Inductor-* + name: Inductor-weekly-LTS-XPU-E2E-Data-a9af82d9f9984b2aefc6eb4729b4cbaa4c660fd7 path: target - name: Downlaod baseline artifacts uses: actions/download-artifact@v4 From 51c39a4a7a051b1c9e8d32a09250375b152a1526 Mon Sep 17 00:00:00 2001 From: mengfeil Date: Thu, 8 May 2025 13:43:23 +0800 Subject: [PATCH 06/18] update --- .github/workflows/_performance_comparison.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_performance_comparison.yml b/.github/workflows/_performance_comparison.yml index 976cef09d..f2411003b 100644 --- a/.github/workflows/_performance_comparison.yml +++ b/.github/workflows/_performance_comparison.yml @@ -33,7 +33,7 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ inputs.target }} - name: Inductor-weekly-LTS-XPU-E2E-Data-a9af82d9f9984b2aefc6eb4729b4cbaa4c660fd7 + pattern: Inductor-* path: target - name: Downlaod baseline artifacts uses: actions/download-artifact@v4 From 852377c9792426dc4b4242e7e8142df249a01746 Mon Sep 17 00:00:00 2001 From: mengfeil Date: Thu, 8 May 2025 13:46:28 +0800 Subject: [PATCH 07/18] update --- .github/workflows/_performance_comparison.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/_performance_comparison.yml b/.github/workflows/_performance_comparison.yml index f2411003b..dac8f3347 100644 --- a/.github/workflows/_performance_comparison.yml +++ b/.github/workflows/_performance_comparison.yml @@ -33,13 +33,11 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ inputs.target }} - pattern: Inductor-* path: target - name: Downlaod baseline artifacts uses: actions/download-artifact@v4 with: run-id: ${{ inputs.baseline }} - pattern: Inductor-*-XPU-E2E-* path: baseline - name: Get comparison artifacts run: | From b0e5122cc6cf2946242084c626e59dd28b921f13 Mon Sep 17 00:00:00 2001 From: mengfeil Date: Thu, 8 May 2025 14:18:23 +0800 Subject: [PATCH 08/18] update --- .github/workflows/_performance_comparison.yml | 20 +++++++------------ .github/workflows/nightly_ondemand.yml | 2 +- .../workflows/nightly_ondemand_rolling.yml | 2 +- .github/workflows/nightly_ondemand_whl.yml | 2 +- .github/workflows/pull.yml | 2 +- 5 files changed, 11 insertions(+), 17 deletions(-) diff --git a/.github/workflows/_performance_comparison.yml b/.github/workflows/_performance_comparison.yml index dac8f3347..64f4eb55e 100644 --- a/.github/workflows/_performance_comparison.yml +++ b/.github/workflows/_performance_comparison.yml @@ -29,20 +29,14 @@ jobs: python-version: '3.10' - name: Checkout torch-xpu-ops uses: actions/checkout@v4 - - name: Downlaod target artifacts - uses: actions/download-artifact@v4 - with: - run-id: ${{ inputs.target }} - path: target - - name: Downlaod baseline artifacts - uses: actions/download-artifact@v4 - with: - run-id: ${{ inputs.baseline }} - path: baseline - - name: Get comparison artifacts + - name: Downlaod artifacts run: | - cd target && unzip *.zip - cd ../baseline && unzip *.zip + rm -rf target && mkdir target && cd target + gh --repo ${GITHUB_REPOSITORY} run download ${{ inputs.target }} -p "Inductor-*-XPU-E2E-*" + unzip *.zip && cd .. + rm -rf baseline && mkdir baseline && cd baseline + gh --repo ${GITHUB_REPOSITORY} run download ${{ inputs.baseline }} -p "Inductor-*-XPU-E2E-*" + unzip *.zip && cd .. - name: Comparison result run: | python -m pip install pandas diff --git a/.github/workflows/nightly_ondemand.yml b/.github/workflows/nightly_ondemand.yml index 1afcb2383..90f6d8cf4 100644 --- a/.github/workflows/nightly_ondemand.yml +++ b/.github/workflows/nightly_ondemand.yml @@ -310,7 +310,7 @@ jobs: else artifact_type="${{ env.run_type }}" fi - REFERENCE_RUN_ID="$(gh --repo intel/torch-xpu-ops issue view ${reference_issue} \ + REFERENCE_RUN_ID="$(gh --repo ${GITHUB_REPOSITORY} issue view ${reference_issue} \ --json body -q .body |grep "Inductor-${artifact_type}-LTS-XPU-E2E" |sed 's/.*: *//')" echo "REFERENCE_RUN_ID=${REFERENCE_RUN_ID}" >> "${GITHUB_OUTPUT}" - name: Download Reference Artifact diff --git a/.github/workflows/nightly_ondemand_rolling.yml b/.github/workflows/nightly_ondemand_rolling.yml index d63cae7c0..cb6ed629f 100644 --- a/.github/workflows/nightly_ondemand_rolling.yml +++ b/.github/workflows/nightly_ondemand_rolling.yml @@ -336,7 +336,7 @@ jobs: else artifact_type="${{ env.run_type }}" fi - REFERENCE_RUN_ID="$(gh --repo intel/torch-xpu-ops issue view ${reference_issue} \ + REFERENCE_RUN_ID="$(gh --repo ${GITHUB_REPOSITORY} issue view ${reference_issue} \ --json body -q .body |grep "Inductor-${artifact_type}-Rolling-XPU-E2E" |sed 's/.*: *//')" echo "REFERENCE_RUN_ID=${REFERENCE_RUN_ID}" >> "${GITHUB_OUTPUT}" - name: Download Reference Artifact diff --git a/.github/workflows/nightly_ondemand_whl.yml b/.github/workflows/nightly_ondemand_whl.yml index d4e24d26d..b56b46940 100644 --- a/.github/workflows/nightly_ondemand_whl.yml +++ b/.github/workflows/nightly_ondemand_whl.yml @@ -272,7 +272,7 @@ jobs: else artifact_type="${{ env.run_type }}" fi - REFERENCE_RUN_ID="$(gh --repo intel/torch-xpu-ops issue view ${reference_issue} \ + REFERENCE_RUN_ID="$(gh --repo ${GITHUB_REPOSITORY} issue view ${reference_issue} \ --json body -q .body |grep "Inductor-${artifact_type}-Pre-XPU-E2E" |sed 's/.*: *//')" echo "REFERENCE_RUN_ID=${REFERENCE_RUN_ID}" >> "${GITHUB_OUTPUT}" - name: Download Reference Artifact diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 6e34a44ca..4f7e917eb 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -188,7 +188,7 @@ jobs: id: reference_id run: | set -xe - REFERENCE_RUN_ID="$(gh --repo intel/torch-xpu-ops issue view ${reference_issue} \ + REFERENCE_RUN_ID="$(gh --repo ${GITHUB_REPOSITORY} issue view ${reference_issue} \ --json body -q .body |grep "Inductor-weekly-LTS-XPU-E2E" |sed 's/.*: *//')" echo "REFERENCE_RUN_ID=${REFERENCE_RUN_ID}" >> "${GITHUB_OUTPUT}" - name: Download Reference Artifact From 80440b195270be5467f2c31c8f513bb51012d6f5 Mon Sep 17 00:00:00 2001 From: mengfeil Date: Thu, 8 May 2025 14:24:04 +0800 Subject: [PATCH 09/18] update --- .github/workflows/_performance_comparison.yml | 4 ++-- .github/workflows/nightly_ondemand.yml | 11 +++-------- .github/workflows/nightly_ondemand_rolling.yml | 13 ++++--------- .github/workflows/nightly_ondemand_whl.yml | 13 ++++--------- .github/workflows/pull.yml | 11 +++-------- 5 files changed, 16 insertions(+), 36 deletions(-) diff --git a/.github/workflows/_performance_comparison.yml b/.github/workflows/_performance_comparison.yml index 64f4eb55e..ada9d33f4 100644 --- a/.github/workflows/_performance_comparison.yml +++ b/.github/workflows/_performance_comparison.yml @@ -33,10 +33,10 @@ jobs: run: | rm -rf target && mkdir target && cd target gh --repo ${GITHUB_REPOSITORY} run download ${{ inputs.target }} -p "Inductor-*-XPU-E2E-*" - unzip *.zip && cd .. + mv Inductor-*-XPU-E2E-*/* . && cd .. rm -rf baseline && mkdir baseline && cd baseline gh --repo ${GITHUB_REPOSITORY} run download ${{ inputs.baseline }} -p "Inductor-*-XPU-E2E-*" - unzip *.zip && cd .. + mv Inductor-*-XPU-E2E-*/* . && cd .. - name: Comparison result run: | python -m pip install pandas diff --git a/.github/workflows/nightly_ondemand.yml b/.github/workflows/nightly_ondemand.yml index 90f6d8cf4..380df87c4 100644 --- a/.github/workflows/nightly_ondemand.yml +++ b/.github/workflows/nightly_ondemand.yml @@ -301,7 +301,7 @@ jobs: scenario: ${{ inputs.scenario }} hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} - - name: Get Reference Run ID + - name: Download Reference Artifact id: reference_id run: | set -xe @@ -312,13 +312,8 @@ jobs: fi REFERENCE_RUN_ID="$(gh --repo ${GITHUB_REPOSITORY} issue view ${reference_issue} \ --json body -q .body |grep "Inductor-${artifact_type}-LTS-XPU-E2E" |sed 's/.*: *//')" - echo "REFERENCE_RUN_ID=${REFERENCE_RUN_ID}" >> "${GITHUB_OUTPUT}" - - name: Download Reference Artifact - uses: actions/download-artifact@v4 - with: - run-id: ${{ steps.reference_id.outputs.REFERENCE_RUN_ID }} - pattern: Inductor-*-XPU-E2E-* - path: reference + gh --repo ${GITHUB_REPOSITORY} run download ${REFERENCE_RUN_ID} -p "Inductor-*-XPU-E2E-*" + rm -rf reference && mv Inductor-*-XPU-E2E-* reference - name: Summarize archieve files id: summary if: ${{ ! cancelled() }} diff --git a/.github/workflows/nightly_ondemand_rolling.yml b/.github/workflows/nightly_ondemand_rolling.yml index cb6ed629f..cba987b03 100644 --- a/.github/workflows/nightly_ondemand_rolling.yml +++ b/.github/workflows/nightly_ondemand_rolling.yml @@ -327,7 +327,7 @@ jobs: scenario: ${{ inputs.scenario }} hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} driver: rolling - - name: Get Reference Run ID + - name: Download Reference Artifact id: reference_id run: | set -xe @@ -337,14 +337,9 @@ jobs: artifact_type="${{ env.run_type }}" fi REFERENCE_RUN_ID="$(gh --repo ${GITHUB_REPOSITORY} issue view ${reference_issue} \ - --json body -q .body |grep "Inductor-${artifact_type}-Rolling-XPU-E2E" |sed 's/.*: *//')" - echo "REFERENCE_RUN_ID=${REFERENCE_RUN_ID}" >> "${GITHUB_OUTPUT}" - - name: Download Reference Artifact - uses: actions/download-artifact@v4 - with: - run-id: ${{ steps.reference_id.outputs.REFERENCE_RUN_ID }} - pattern: Inductor-*-XPU-E2E-* - path: reference + --json body -q .body |grep "Inductor-${artifact_type}-LTS-XPU-E2E" |sed 's/.*: *//')" + gh --repo ${GITHUB_REPOSITORY} run download ${REFERENCE_RUN_ID} -p "Inductor-*-XPU-E2E-*" + rm -rf reference && mv Inductor-*-XPU-E2E-* reference - name: Summarize archieve files id: summary if: ${{ ! cancelled() }} diff --git a/.github/workflows/nightly_ondemand_whl.yml b/.github/workflows/nightly_ondemand_whl.yml index b56b46940..303806b54 100644 --- a/.github/workflows/nightly_ondemand_whl.yml +++ b/.github/workflows/nightly_ondemand_whl.yml @@ -263,7 +263,7 @@ jobs: scenario: ${{ inputs.scenario }} pytorch: nightly_wheel hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} - - name: Get Reference Run ID + - name: Download Reference Artifact id: reference_id run: | set -xe @@ -273,14 +273,9 @@ jobs: artifact_type="${{ env.run_type }}" fi REFERENCE_RUN_ID="$(gh --repo ${GITHUB_REPOSITORY} issue view ${reference_issue} \ - --json body -q .body |grep "Inductor-${artifact_type}-Pre-XPU-E2E" |sed 's/.*: *//')" - echo "REFERENCE_RUN_ID=${REFERENCE_RUN_ID}" >> "${GITHUB_OUTPUT}" - - name: Download Reference Artifact - uses: actions/download-artifact@v4 - with: - run-id: ${{ steps.reference_id.outputs.REFERENCE_RUN_ID }} - pattern: Inductor-*-XPU-E2E-* - path: reference + --json body -q .body |grep "Inductor-${artifact_type}-LTS-XPU-E2E" |sed 's/.*: *//')" + gh --repo ${GITHUB_REPOSITORY} run download ${REFERENCE_RUN_ID} -p "Inductor-*-XPU-E2E-*" + rm -rf reference && mv Inductor-*-XPU-E2E-* reference - name: Summarize archieve files id: summary if: ${{ ! cancelled() }} diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 4f7e917eb..bdd4c6576 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -184,19 +184,14 @@ jobs: scenario: accuracy,performance env_prepare: true hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} - - name: Get Reference Run ID + - name: Download Reference Artifact id: reference_id run: | set -xe REFERENCE_RUN_ID="$(gh --repo ${GITHUB_REPOSITORY} issue view ${reference_issue} \ --json body -q .body |grep "Inductor-weekly-LTS-XPU-E2E" |sed 's/.*: *//')" - echo "REFERENCE_RUN_ID=${REFERENCE_RUN_ID}" >> "${GITHUB_OUTPUT}" - - name: Download Reference Artifact - uses: actions/download-artifact@v4 - with: - run-id: ${{ steps.reference_id.outputs.REFERENCE_RUN_ID }} - pattern: Inductor-*-XPU-E2E-* - path: reference + gh --repo ${GITHUB_REPOSITORY} run download ${REFERENCE_RUN_ID} -p "Inductor-*-XPU-E2E-*" + rm -rf reference && mv Inductor-*-XPU-E2E-* reference - name: Summarize archieve files if: ${{ ! cancelled() }} run: | From 28f94e383d450db7dddf17fb8b6a208863f3994c Mon Sep 17 00:00:00 2001 From: mengfeil Date: Thu, 8 May 2025 14:25:28 +0800 Subject: [PATCH 10/18] update --- .github/workflows/_performance_comparison.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/_performance_comparison.yml b/.github/workflows/_performance_comparison.yml index ada9d33f4..2108f2be7 100644 --- a/.github/workflows/_performance_comparison.yml +++ b/.github/workflows/_performance_comparison.yml @@ -18,6 +18,8 @@ permissions: read-all jobs: Performance-Comparison: + env: + GH_TOKEN: ${{ github.token }} runs-on: ubuntu-latest steps: - name: Cleanup workspace From 2208ce2220c266a00bbf6f5577213a18a33da6a4 Mon Sep 17 00:00:00 2001 From: mengfeil Date: Thu, 8 May 2025 14:31:00 +0800 Subject: [PATCH 11/18] update --- .github/workflows/_performance_comparison.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_performance_comparison.yml b/.github/workflows/_performance_comparison.yml index 2108f2be7..0eb531e18 100644 --- a/.github/workflows/_performance_comparison.yml +++ b/.github/workflows/_performance_comparison.yml @@ -7,12 +7,12 @@ on: required: true type: string default: '' - description: Target artifact id + description: Target run id baseline: required: true type: string default: '' - description: Baseline artifact id + description: Baseline run id permissions: read-all From a485f15bfdd40db6e3e9073c9e4c3bec3403b020 Mon Sep 17 00:00:00 2001 From: mengfeil Date: Fri, 9 May 2025 09:58:06 +0800 Subject: [PATCH 12/18] install higher gh from conda --- .github/workflows/nightly_ondemand.yml | 2 ++ .github/workflows/nightly_ondemand_rolling.yml | 2 ++ .github/workflows/nightly_ondemand_whl.yml | 2 ++ .github/workflows/pull.yml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/.github/workflows/nightly_ondemand.yml b/.github/workflows/nightly_ondemand.yml index 380df87c4..67ec288ba 100644 --- a/.github/workflows/nightly_ondemand.yml +++ b/.github/workflows/nightly_ondemand.yml @@ -305,6 +305,8 @@ jobs: id: reference_id run: | set -xe + source activate e2e_ci + conda install gh --channel conda-forge -y if [ "${{ env.run_type }}" == "on-demand" ];then artifact_type="weekly" else diff --git a/.github/workflows/nightly_ondemand_rolling.yml b/.github/workflows/nightly_ondemand_rolling.yml index cba987b03..460a6621e 100644 --- a/.github/workflows/nightly_ondemand_rolling.yml +++ b/.github/workflows/nightly_ondemand_rolling.yml @@ -331,6 +331,8 @@ jobs: id: reference_id run: | set -xe + source activate e2e_ci + conda install gh --channel conda-forge -y if [ "${{ env.run_type }}" == "on-demand" ];then artifact_type="weekly" else diff --git a/.github/workflows/nightly_ondemand_whl.yml b/.github/workflows/nightly_ondemand_whl.yml index 303806b54..7b8e83262 100644 --- a/.github/workflows/nightly_ondemand_whl.yml +++ b/.github/workflows/nightly_ondemand_whl.yml @@ -267,6 +267,8 @@ jobs: id: reference_id run: | set -xe + source activate e2e_ci + conda install gh --channel conda-forge -y if [ "${{ env.run_type }}" == "on-demand" ];then artifact_type="weekly" else diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index bdd4c6576..9f276ec1a 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -188,6 +188,8 @@ jobs: id: reference_id run: | set -xe + source activate e2e_ci + conda install gh --channel conda-forge -y REFERENCE_RUN_ID="$(gh --repo ${GITHUB_REPOSITORY} issue view ${reference_issue} \ --json body -q .body |grep "Inductor-weekly-LTS-XPU-E2E" |sed 's/.*: *//')" gh --repo ${GITHUB_REPOSITORY} run download ${REFERENCE_RUN_ID} -p "Inductor-*-XPU-E2E-*" From 978fa807e62c12ec29c6c99e2a1eceb510e7a21e Mon Sep 17 00:00:00 2001 From: mengfeil Date: Mon, 19 May 2025 11:09:55 +0800 Subject: [PATCH 13/18] update --- .github/scripts/e2e_summary.sh | 6 +++- .github/scripts/perf_comparison.py | 34 ++++++++++--------- .github/workflows/_performance_comparison.yml | 2 +- .github/workflows/pull.yml | 1 + 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/.github/scripts/e2e_summary.sh b/.github/scripts/e2e_summary.sh index bc182e0aa..e732a0e07 100644 --- a/.github/scripts/e2e_summary.sh +++ b/.github/scripts/e2e_summary.sh @@ -148,7 +148,11 @@ performance=$(find "${results_dir}" -name "*.csv" |grep -E "_xpu_performance.csv if [ "${performance}" -gt 0 ];then echo "### Performance" unzip ${reference_dir}/*.zip -d ${reference_dir} > /dev/null 2>&1 - python "$(dirname "$0")/perf_comparison.py" -xpu ${results_dir} -refer ${reference_dir} + if [ "$IS_PR" == "1" ];then + python "$(dirname "$0")/perf_comparison.py" --xpu ${results_dir} --refer ${reference_dir} --pr + else + python "$(dirname "$0")/perf_comparison.py" --xpu ${results_dir} --refer ${reference_dir} + fi cp ${reference_dir}/best.csv ${results_dir}/best.csv > /dev/null 2>&1 || true python "$(dirname "$0")/calculate_best_perf.py" \ --new ${results_dir} \ diff --git a/.github/scripts/perf_comparison.py b/.github/scripts/perf_comparison.py index 92ac6c2c3..7c5b6d338 100644 --- a/.github/scripts/perf_comparison.py +++ b/.github/scripts/perf_comparison.py @@ -1,6 +1,6 @@ # To compare the performance diff # Usage: -# python perf_comparison.py -xpu /path/to/xpu/performance/result/dir -refer /path/to/reference/dir +# python perf_comparison.py --xpu /path/to/xpu/performance/result/dir --refer /path/to/reference/dir import re import os @@ -10,8 +10,9 @@ from statistics import geometric_mean parser = argparse.ArgumentParser(description="Analysis", formatter_class=argparse.ArgumentDefaultsHelpFormatter) -parser.add_argument("-xpu", default=None, help="XPU performance result csv files dir") -parser.add_argument("-refer", default=None, help="XPU refrerence result csv files dir") +parser.add_argument("--xpu", default=None, help="XPU performance result csv files dir") +parser.add_argument("--refer", default=None, help="XPU refrerence result csv files dir") +parser.add_argument("--pr", action="store_true", help="Only show results xpu has") args = parser.parse_args() @@ -46,7 +47,7 @@ def find_files(pattern, path): if os.path.isfile(refer_file): refer_data= pd.read_csv(refer_file) refer_names = [row["name"] for index, row in refer_data.iterrows()] - names = xpu_names + refer_names + names = xpu_names if args.pr else xpu_names + refer_names names = set(names) names = sorted(names) for name in names: @@ -72,18 +73,19 @@ def find_files(pattern, path): xpu_value = next((row for index, row in xpu_data.iterrows() if row["name"] == name), "") xpu_eager_latency = xpu_value["speedup"] * xpu_value["abs_latency"] output_data.append([multiple_replace(xpu_file), name, xpu_eager_latency, xpu_value["abs_latency"], xpu_value["speedup"], -1, -1, -1, -1, -1]) -refer_files = find_files("*_xpu_performance.csv", args.refer) -for refer_file in refer_files: - refer_data = pd.read_csv(refer_file) - refer_names = [row["name"] for index, row in refer_data.iterrows()] - xpu_file = re.sub(args.refer, args.xpu + "/", refer_file, flags=re.IGNORECASE) - if not os.path.isfile(xpu_file): - names = set(refer_names) - names = sorted(names) - for name in names: - refer_value = next((row for index, row in refer_data.iterrows() if row["name"] == name), "") - refer_eager_latency = refer_value["speedup"] * refer_value["abs_latency"] - output_data.append([multiple_replace(refer_file), name, -1, -1, -1, refer_eager_latency, refer_value["abs_latency"], refer_value["speedup"], -1, -1]) +if args.pr: + refer_files = find_files("*_xpu_performance.csv", args.refer) + for refer_file in refer_files: + refer_data = pd.read_csv(refer_file) + refer_names = [row["name"] for index, row in refer_data.iterrows()] + xpu_file = re.sub(args.refer, args.xpu + "/", refer_file, flags=re.IGNORECASE) + if not os.path.isfile(xpu_file): + names = set(refer_names) + names = sorted(names) + for name in names: + refer_value = next((row for index, row in refer_data.iterrows() if row["name"] == name), "") + refer_eager_latency = refer_value["speedup"] * refer_value["abs_latency"] + output_data.append([multiple_replace(refer_file), name, -1, -1, -1, refer_eager_latency, refer_value["abs_latency"], refer_value["speedup"], -1, -1]) # summary output_data = pd.DataFrame(output_data, columns=output_header) diff --git a/.github/workflows/_performance_comparison.yml b/.github/workflows/_performance_comparison.yml index 0eb531e18..21fe79692 100644 --- a/.github/workflows/_performance_comparison.yml +++ b/.github/workflows/_performance_comparison.yml @@ -42,4 +42,4 @@ jobs: - name: Comparison result run: | python -m pip install pandas - python .github/scripts/perf_comparison.py -xpu target -refer baseline >> ${GITHUB_STEP_SUMMARY} + python .github/scripts/perf_comparison.py --xpu target --refer baseline >> ${GITHUB_STEP_SUMMARY} diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 71886ff55..d397fba5c 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -201,6 +201,7 @@ jobs: cp -r ${{ github.workspace }}/../pytorch/inductor_log ${{ github.workspace }}/upload_files # Print summary source activate e2e_ci + export IS_PR=1 bash ${{ github.workspace }}/.github/scripts/e2e_summary.sh \ ${{ github.workspace }}/upload_files \ ${{ github.workspace }}/reference \ From 197f60e53266df27a59d09ab6603e61be1714e18 Mon Sep 17 00:00:00 2001 From: mengfeil Date: Mon, 19 May 2025 15:05:33 +0800 Subject: [PATCH 14/18] update --- .github/workflows/nightly_ondemand.yml | 3 ++- .github/workflows/nightly_ondemand_rolling.yml | 3 ++- .github/workflows/nightly_ondemand_whl.yml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly_ondemand.yml b/.github/workflows/nightly_ondemand.yml index f1fe3521b..3d6fea204 100644 --- a/.github/workflows/nightly_ondemand.yml +++ b/.github/workflows/nightly_ondemand.yml @@ -59,7 +59,8 @@ on: default: '3.10' description: Python version -permissions: write-all +permissions: + issues: write concurrency: group: ${{ github.workflow }}-${{ github.sha }}-${{ github.event_name }}-${{ inputs.pytorch }}-${{ inputs.keep_torch_xpu_ops }}-${{ inputs.ut }}-${{ inputs.triton }}-${{ inputs.suite }}-${{ inputs.dt }}-${{ inputs.mode }}-${{ inputs.scenario }}-${{ inputs.model }}-${{ inputs.python }} diff --git a/.github/workflows/nightly_ondemand_rolling.yml b/.github/workflows/nightly_ondemand_rolling.yml index fd6a9421c..b4ab18969 100644 --- a/.github/workflows/nightly_ondemand_rolling.yml +++ b/.github/workflows/nightly_ondemand_rolling.yml @@ -59,7 +59,8 @@ on: default: '3.10' description: Python version -permissions: write-all +permissions: + issues: write concurrency: group: ${{ github.workflow }}-${{ github.sha }}-${{ github.event_name }}-${{ inputs.pytorch }}-${{ inputs.keep_torch_xpu_ops }}-${{ inputs.ut }}-${{ inputs.triton }}-${{ inputs.suite }}-${{ inputs.dt }}-${{ inputs.mode }}-${{ inputs.scenario }}-${{ inputs.model }}-${{ inputs.python }} diff --git a/.github/workflows/nightly_ondemand_whl.yml b/.github/workflows/nightly_ondemand_whl.yml index 51a752cf7..0275f8846 100644 --- a/.github/workflows/nightly_ondemand_whl.yml +++ b/.github/workflows/nightly_ondemand_whl.yml @@ -49,7 +49,8 @@ on: default: '3.10' description: Python version -permissions: write-all +permissions: + issues: write concurrency: group: ${{ github.workflow }}-${{ github.sha }}-${{ github.event_name }}-${{ inputs.pytorch }}-${{ inputs.ut }}-${{ inputs.suite }}-${{ inputs.dt }}-${{ inputs.mode }}-${{ inputs.scenario }}-${{ inputs.model }}-${{ inputs.python }} From 3e145c76d5fd65d05861dd895f79df26ca00d2df Mon Sep 17 00:00:00 2001 From: mengfeil Date: Mon, 19 May 2025 15:19:49 +0800 Subject: [PATCH 15/18] Revert "update" This reverts commit 197f60e53266df27a59d09ab6603e61be1714e18. --- .github/workflows/nightly_ondemand.yml | 3 +-- .github/workflows/nightly_ondemand_rolling.yml | 3 +-- .github/workflows/nightly_ondemand_whl.yml | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nightly_ondemand.yml b/.github/workflows/nightly_ondemand.yml index 3d6fea204..f1fe3521b 100644 --- a/.github/workflows/nightly_ondemand.yml +++ b/.github/workflows/nightly_ondemand.yml @@ -59,8 +59,7 @@ on: default: '3.10' description: Python version -permissions: - issues: write +permissions: write-all concurrency: group: ${{ github.workflow }}-${{ github.sha }}-${{ github.event_name }}-${{ inputs.pytorch }}-${{ inputs.keep_torch_xpu_ops }}-${{ inputs.ut }}-${{ inputs.triton }}-${{ inputs.suite }}-${{ inputs.dt }}-${{ inputs.mode }}-${{ inputs.scenario }}-${{ inputs.model }}-${{ inputs.python }} diff --git a/.github/workflows/nightly_ondemand_rolling.yml b/.github/workflows/nightly_ondemand_rolling.yml index b4ab18969..fd6a9421c 100644 --- a/.github/workflows/nightly_ondemand_rolling.yml +++ b/.github/workflows/nightly_ondemand_rolling.yml @@ -59,8 +59,7 @@ on: default: '3.10' description: Python version -permissions: - issues: write +permissions: write-all concurrency: group: ${{ github.workflow }}-${{ github.sha }}-${{ github.event_name }}-${{ inputs.pytorch }}-${{ inputs.keep_torch_xpu_ops }}-${{ inputs.ut }}-${{ inputs.triton }}-${{ inputs.suite }}-${{ inputs.dt }}-${{ inputs.mode }}-${{ inputs.scenario }}-${{ inputs.model }}-${{ inputs.python }} diff --git a/.github/workflows/nightly_ondemand_whl.yml b/.github/workflows/nightly_ondemand_whl.yml index 0275f8846..51a752cf7 100644 --- a/.github/workflows/nightly_ondemand_whl.yml +++ b/.github/workflows/nightly_ondemand_whl.yml @@ -49,8 +49,7 @@ on: default: '3.10' description: Python version -permissions: - issues: write +permissions: write-all concurrency: group: ${{ github.workflow }}-${{ github.sha }}-${{ github.event_name }}-${{ inputs.pytorch }}-${{ inputs.ut }}-${{ inputs.suite }}-${{ inputs.dt }}-${{ inputs.mode }}-${{ inputs.scenario }}-${{ inputs.model }}-${{ inputs.python }} From 5b974d050838c28d1fddc27c9627c4e4c78ab164 Mon Sep 17 00:00:00 2001 From: mengfeil Date: Tue, 20 May 2025 09:49:13 +0800 Subject: [PATCH 16/18] modify --- .github/scripts/e2e_summary.sh | 2 +- .github/scripts/perf_comparison.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/e2e_summary.sh b/.github/scripts/e2e_summary.sh index e732a0e07..5894bb4b5 100644 --- a/.github/scripts/e2e_summary.sh +++ b/.github/scripts/e2e_summary.sh @@ -148,7 +148,7 @@ performance=$(find "${results_dir}" -name "*.csv" |grep -E "_xpu_performance.csv if [ "${performance}" -gt 0 ];then echo "### Performance" unzip ${reference_dir}/*.zip -d ${reference_dir} > /dev/null 2>&1 - if [ "$IS_PR" == "1" ];then + if [ "${IS_PR}" == "1" ];then python "$(dirname "$0")/perf_comparison.py" --xpu ${results_dir} --refer ${reference_dir} --pr else python "$(dirname "$0")/perf_comparison.py" --xpu ${results_dir} --refer ${reference_dir} diff --git a/.github/scripts/perf_comparison.py b/.github/scripts/perf_comparison.py index 7c5b6d338..9a314d533 100644 --- a/.github/scripts/perf_comparison.py +++ b/.github/scripts/perf_comparison.py @@ -73,7 +73,7 @@ def find_files(pattern, path): xpu_value = next((row for index, row in xpu_data.iterrows() if row["name"] == name), "") xpu_eager_latency = xpu_value["speedup"] * xpu_value["abs_latency"] output_data.append([multiple_replace(xpu_file), name, xpu_eager_latency, xpu_value["abs_latency"], xpu_value["speedup"], -1, -1, -1, -1, -1]) -if args.pr: +if not args.pr: refer_files = find_files("*_xpu_performance.csv", args.refer) for refer_file in refer_files: refer_data = pd.read_csv(refer_file) From 94be3fc3e8bdcd7bab6fc7ce8e3fdfe7935271ca Mon Sep 17 00:00:00 2001 From: mengfeil Date: Tue, 20 May 2025 14:15:46 +0800 Subject: [PATCH 17/18] debug --- .github/workflows/nightly_ondemand.yml | 1 + .github/workflows/nightly_ondemand_rolling.yml | 1 + .github/workflows/nightly_ondemand_whl.yml | 1 + .github/workflows/pull.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/.github/workflows/nightly_ondemand.yml b/.github/workflows/nightly_ondemand.yml index f1fe3521b..03aea6adc 100644 --- a/.github/workflows/nightly_ondemand.yml +++ b/.github/workflows/nightly_ondemand.yml @@ -320,6 +320,7 @@ jobs: id: summary if: ${{ ! cancelled() }} run: | + set -x -e -o pipefail 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/ diff --git a/.github/workflows/nightly_ondemand_rolling.yml b/.github/workflows/nightly_ondemand_rolling.yml index fd6a9421c..8355f236c 100644 --- a/.github/workflows/nightly_ondemand_rolling.yml +++ b/.github/workflows/nightly_ondemand_rolling.yml @@ -346,6 +346,7 @@ jobs: id: summary if: ${{ ! cancelled() }} run: | + set -x -e -o pipefail 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/ diff --git a/.github/workflows/nightly_ondemand_whl.yml b/.github/workflows/nightly_ondemand_whl.yml index 51a752cf7..fbee5dac3 100644 --- a/.github/workflows/nightly_ondemand_whl.yml +++ b/.github/workflows/nightly_ondemand_whl.yml @@ -282,6 +282,7 @@ jobs: id: summary if: ${{ ! cancelled() }} run: | + set -x -e -o pipefail 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/ diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index d397fba5c..0d18d3ae5 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -197,6 +197,7 @@ jobs: - name: Summarize archieve files if: ${{ ! cancelled() }} run: | + set -x -e -o pipefail rm -rf ${{ github.workspace }}/upload_files cp -r ${{ github.workspace }}/../pytorch/inductor_log ${{ github.workspace }}/upload_files # Print summary From 4f56ad483998ab2d98fedc1c9dd84bc9dd1217be Mon Sep 17 00:00:00 2001 From: mengfeil Date: Wed, 21 May 2025 11:05:38 +0800 Subject: [PATCH 18/18] update --- .github/scripts/calculate_best_perf.py | 34 +++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/scripts/calculate_best_perf.py b/.github/scripts/calculate_best_perf.py index c19194385..3d2f53233 100644 --- a/.github/scripts/calculate_best_perf.py +++ b/.github/scripts/calculate_best_perf.py @@ -21,8 +21,8 @@ parser = argparse.ArgumentParser(description="Get Best Performance", formatter_class=argparse.ArgumentDefaultsHelpFormatter) -parser.add_argument("--best", default=None, required=True, help="Saved best performance file") -parser.add_argument("--new", default=None, required=True, help="New round launch") +parser.add_argument("--best", required=True, help="Saved best performance file") +parser.add_argument("--new", required=True, help="New round launch") parser.add_argument("--device", default=None, type=str, help="Device name, such as PVC1100") parser.add_argument("--os", default=None, type=str, help="OS version, such as Ubuntu 22.04") parser.add_argument("--driver", default=None, type=str, help="Driver version, such as 25.05.32567") @@ -63,8 +63,8 @@ def find_files(pattern, path): new_data = pd.read_csv(new_file) new_data = new_data.reset_index(drop=True) for index, row in new_data.iterrows(): - new_eager = row["abs_latency"] * row["speedup"] # eager + new_eager = row["abs_latency"] * row["speedup"] eager_row = next(([i, line] for i, line in best_data.iterrows() if (line["Category"] == category and line["Model"] == row["name"] @@ -74,15 +74,15 @@ def find_files(pattern, path): (best_data["Model"] == row["name"]) & (best_data["Value Type"] == "eager")] if eager_row != "N/A": - if new_eager < best_eager_value["Value"].values: - best_data.loc[eager_row[0]] = category, row["name"], "eager", new_eager, \ - args.device, args.os, args.driver, args.oneapi, args.gcc, args.python, \ - args.pytorch, args.torch_xpu_ops, date.today().strftime('%F') + if new_eager < best_eager_value["Value"].values[0]: + best_data.loc[eager_row[0]] = [category, row["name"], "eager", new_eager, + args.device, args.os, args.driver, args.oneapi, args.gcc, args.python, + args.pytorch, args.torch_xpu_ops, date.today().strftime('%F')] else: best_data.loc[len(best_data), :] = None - best_data.loc[len(best_data) - 1] = category, row["name"], "eager", new_eager, \ - args.device, args.os, args.driver, args.oneapi, args.gcc, args.python, \ - args.pytorch, args.torch_xpu_ops, date.today().strftime('%F') + best_data.loc[len(best_data) - 1] = [category, row["name"], "eager", new_eager, + args.device, args.os, args.driver, args.oneapi, args.gcc, args.python, + args.pytorch, args.torch_xpu_ops, date.today().strftime('%F')] # inductor inductor_row = next(([i, line] for i, line in best_data.iterrows() if (line["Category"] == category @@ -93,14 +93,14 @@ def find_files(pattern, path): (best_data["Model"] == row["name"]) & (best_data["Value Type"] == "inductor")] if inductor_row != "N/A": - if row["abs_latency"] < best_inductor_value["Value"].values: - best_data.at[inductor_row[0]] = category, row["name"], "inductor", row["abs_latency"], \ - args.device, args.os, args.driver, args.oneapi, args.gcc, args.python, \ - args.pytorch, args.torch_xpu_ops, date.today().strftime('%F') + if row["abs_latency"] < best_inductor_value["Value"].values[0]: + best_data.loc[inductor_row[0]] = [category, row["name"], "inductor", row["abs_latency"], + args.device, args.os, args.driver, args.oneapi, args.gcc, args.python, + args.pytorch, args.torch_xpu_ops, date.today().strftime('%F')] else: best_data.loc[len(best_data), :] = None - best_data.loc[len(best_data) - 1] = category, row["name"], "inductor", row["abs_latency"], \ - args.device, args.os, args.driver, args.oneapi, args.gcc, args.python, \ - args.pytorch, args.torch_xpu_ops, date.today().strftime('%F') + best_data.loc[len(best_data) - 1] = [category, row["name"], "inductor", row["abs_latency"], + args.device, args.os, args.driver, args.oneapi, args.gcc, args.python, + args.pytorch, args.torch_xpu_ops, date.today().strftime('%F')] best_data.to_csv(args.best, sep=',', encoding='utf-8', index=False)