Skip to content

Commit

Permalink
#14406: Upload perf report to GH
Browse files Browse the repository at this point in the history
  • Loading branch information
Aswinmcw committed Nov 7, 2024
1 parent cc170e5 commit c941a28
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/t3000-model-perf-tests-impl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: TTMetal_build_${{ matrix.test-group.arch }}_profiler
- name: Download regular build artifact
- name: Download build artifact
if: ${{ !matrix.test-group.tracy }}
uses: actions/download-artifact@v4
with:
Expand All @@ -65,9 +65,21 @@ jobs:
if: ${{ !cancelled() }}
run: |
ls -hal
export PERF_REPORT_FILENAME="Models_Perf_$(date +%Y_%m_%d).csv"
ls -hal $PERF_REPORT_FILENAME
echo "perf_report_filename=$PERF_REPORT_FILENAME" >> "$GITHUB_OUTPUT"
TODAY=$(date +%Y_%m_%d)
PERF_REPORT_FILENAME_MODELS="Models_Perf_${TODAY}.csv"
PERF_REPORT_FILENAME_CCL="CCL_Perf_${TODAY}.csv"
if [ -f "$PERF_REPORT_FILENAME_MODELS" ]; then
echo "Found Models Perf report: $PERF_REPORT_FILENAME_MODELS"
echo "perf_report_filename=$PERF_REPORT_FILENAME_MODELS" >> "$GITHUB_OUTPUT"
ls -hal "$PERF_REPORT_FILENAME_MODELS"
elif [ -f "$PERF_REPORT_FILENAME_CCL" ]; then
echo "Found CCL Perf report: $PERF_REPORT_FILENAME_CCL"
echo "perf_report_filename=$PERF_REPORT_FILENAME_CCL" >> "$GITHUB_OUTPUT"
ls -hal "$PERF_REPORT_FILENAME_CCL"
else
echo "No perf report found."
exit 1
fi
- name: Upload perf report
if: ${{ !cancelled() && steps.check-perf-report.conclusion == 'success' }}
uses: actions/upload-artifact@v4
Expand Down
9 changes: 6 additions & 3 deletions tests/ttnn/unit_tests/operations/ccl/perf/perf_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pandas as pd
import os
import re
import time


def perf_report(file_path):
Expand Down Expand Up @@ -208,10 +209,12 @@ def calculate_bandwidth(row):

averages_df = pd.DataFrame(averages_data)

averages_file_path = file_path.replace(".csv", "_averages.csv")
today = time.strftime("%Y_%m_%d")
ccl_perf_file_path = f"CCL_Perf_{today}.csv"
os.rename(file_path, ccl_perf_file_path)

averages_df.to_csv(averages_file_path, index=False)
averages_df.to_csv(ccl_perf_file_path, index=False)

print(f"Averages CSV saved to: {averages_file_path}")
print(f"CCL Perf report CSV saved to: {ccl_perf_file_path}")

return averages_df

0 comments on commit c941a28

Please sign in to comment.