Skip to content

Commit 6db196b

Browse files
huydhnpytorchmergebot
authored andcommitted
Specify the head branch when upload perf stats to Rockset (pytorch#97643)
Before this, my assumption was that the workflow was only run on the main branch. This is not correct anymore as it could also now be run as part of the PR, i.e. https://hud.pytorch.org/pr/91316. So this change does two things: * Always upload inductor-A100-perf-nightly artifacts to S3 once completed by removing the main branch gating. * Add `head_branch` to Rockset records, so that the [dashboard](https://torchci-git-fork-huydhn-add-compilers-bench-74abf8-fbopensource.vercel.app/benchmark/compilers) knows if the records come from the daily schedule on the main branch or from experimental PR. The `head_branch` would be set to `master` in the former. Pull Request resolved: pytorch#97643 Approved by: https://github.com/desertfire
1 parent 9d37cef commit 6db196b

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.github/workflows/upload-torch-dynamo-perf-stats.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
workflows: [inductor-A100-perf-nightly]
66
types:
77
- completed
8-
branches:
9-
- master
10-
- main
118

129
jobs:
1310
get-conclusion:
@@ -59,5 +56,6 @@ jobs:
5956
WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }}
6057
WORKFLOW_RUN_ATTEMPT: ${{ github.event.workflow_run.run_attempt }}
6158
REPO_FULLNAME: ${{ github.event.workflow_run.repository.full_name }}
59+
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
6260
run: |
63-
python3 -m tools.stats.upload_dynamo_perf_stats --workflow-run-id "${WORKFLOW_RUN_ID}" --workflow-run-attempt "${WORKFLOW_RUN_ATTEMPT}" --repo "${REPO_FULLNAME}"
61+
python3 -m tools.stats.upload_dynamo_perf_stats --workflow-run-id "${WORKFLOW_RUN_ID}" --workflow-run-attempt "${WORKFLOW_RUN_ATTEMPT}" --repo "${REPO_FULLNAME}" --head-branch "${HEAD_BRANCH}"

tools/stats/upload_dynamo_perf_stats.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818

1919

2020
def upload_dynamo_perf_stats_to_rockset(
21-
repo: str, workflow_run_id: int, workflow_run_attempt: int
21+
repo: str,
22+
workflow_run_id: int,
23+
workflow_run_attempt: int,
24+
head_branch: str,
2225
) -> List[Dict[str, Any]]:
2326
perf_stats = []
2427
with TemporaryDirectory() as temp_dir:
@@ -65,6 +68,7 @@ def upload_dynamo_perf_stats_to_rockset(
6568
"runner": runner,
6669
"job_id": job_id,
6770
"filename": filename,
71+
"head_branch": head_branch,
6872
}
6973
)
7074
perf_stats.append(row)
@@ -97,9 +101,15 @@ def upload_dynamo_perf_stats_to_rockset(
97101
required=True,
98102
help="which GitHub repo this workflow run belongs to",
99103
)
104+
parser.add_argument(
105+
"--head-branch",
106+
type=str,
107+
required=True,
108+
help="Head branch of the workflow",
109+
)
100110
args = parser.parse_args()
101111
perf_stats = upload_dynamo_perf_stats_to_rockset(
102-
args.repo, args.workflow_run_id, args.workflow_run_attempt
112+
args.repo, args.workflow_run_id, args.workflow_run_attempt, args.head_branch
103113
)
104114
upload_to_rockset(
105115
collection="torch_dynamo_perf_stats",

0 commit comments

Comments
 (0)