Skip to content

Commit 4710a75

Browse files
authored
[ez][testing] file report: route to pytorch-dev-infra team, remove unused var, etc (#7310)
Some small changes bundled together Fix team name for pytorch dev infra Remove unused var Frequency weighting should not include cancelled jobs Fix file report HUD page overview page calculating averages across commits wrong When double clicking, set the regex to be false since it's supposed to search for that specific thing (also because the input probably isn't correct regex) Fix workflow cron if statement Remove if statement left in from testing
1 parent dacc326 commit 4710a75

File tree

4 files changed

+51
-53
lines changed

4 files changed

+51
-53
lines changed

.github/workflows/update_test_file_report.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
file-report:
1313
if: >
14-
(github.event_name == 'schedule' && github.event.schedule.cron == '0 2 * * *') ||
14+
(github.event_name == 'schedule' && github.event.schedule == '0 2 * * *') ||
1515
(github.event_name == 'workflow_dispatch')
1616
permissions:
1717
issues: write
@@ -25,7 +25,6 @@ jobs:
2525
cd tools/torchci && python3 -mpip install -e .
2626
2727
- name: Run file report generator
28-
if: false
2928
env:
3029
CLICKHOUSE_ENDPOINT: ${{ secrets.CLICKHOUSE_HUD_USER_URL }}
3130
CLICKHOUSE_USERNAME: ${{ secrets.CLICKHOUSE_HUD_USER_USERNAME }}
@@ -46,7 +45,7 @@ jobs:
4645
4746
weekly-file-report-notification:
4847
if: >
49-
(github.event_name == 'schedule' && github.event.schedule.cron == '0 3 * * 2') ||
48+
(github.event_name == 'schedule' && github.event.schedule == '0 3 * * 2') ||
5049
(github.event_name == 'workflow_dispatch')
5150
permissions:
5251
issues: write

tools/torchci/test_insights/daily_regression.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
CONFIG = [
1313
{
14-
"team": "dev-infra",
14+
"team": "pytorch-dev-infra",
1515
"condition": lambda _: True,
1616
"link": FILE_REPORT_URL,
1717
},
@@ -74,9 +74,7 @@ def gen_regression_for_team(
7474
if (info["short_job_name"], info["file"]) in relevant_keys
7575
]
7676

77-
def _sum_invoking_file_info(
78-
data: list[dict[str, Any]], field: str
79-
) -> dict[str, Any]:
77+
def _sum_invoking_file_info(data: list[dict[str, Any]]) -> dict[str, Any]:
8078
info = {
8179
"count": sum(item["count"] for item in data),
8280
"cost": sum(item["cost"] for item in data),
@@ -85,12 +83,8 @@ def _sum_invoking_file_info(
8583
}
8684
return info
8785

88-
agg_prev_file_info = _sum_invoking_file_info(
89-
relevant_prev_invoking_file_info, "prev"
90-
)
91-
agg_curr_file_info = _sum_invoking_file_info(
92-
relevant_curr_invoking_file_info, "curr"
93-
)
86+
agg_prev_file_info = _sum_invoking_file_info(relevant_prev_invoking_file_info)
87+
agg_curr_file_info = _sum_invoking_file_info(relevant_curr_invoking_file_info)
9488

9589
invoking_file_info_diff = {
9690
"count": {

tools/torchci/test_insights/file_report_generator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def _get_frequency(self) -> List[Dict[str, Any]]:
209209
where
210210
j.created_at > now() - interval 8 day
211211
and j.created_at < now() - interval 1 day
212+
and j.conclusion != 'cancelled'
212213
group by
213214
name
214215
"""

torchci/pages/tests/fileReport.tsx

Lines changed: 44 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -464,44 +464,33 @@ function Overview({
464464
);
465465

466466
const groupedRows = _.map(groupByTarget, (rows, key) => {
467-
// Sum within sha
468-
const summedBySha = _.map(_.groupBy(rows, "sha"), (shaRows) => {
469-
return _.reduce(
470-
shaRows,
471-
(acc, row) => {
472-
acc.count += row.count || 0;
473-
acc.time += row.time || 0;
474-
acc.cost += row.cost || 0;
475-
acc.skipped += row.skipped || 0;
476-
acc.frequency += row.frequency || 0;
477-
return acc;
478-
},
479-
{ count: 0, time: 0, cost: 0, skipped: 0, frequency: 0 }
480-
);
481-
});
482-
// the reduce across shas for average
483-
return _.reduce(
484-
summedBySha,
485-
(acc, summed) => {
486-
acc.count += summed.count;
487-
acc.time += summed.time;
488-
acc.cost += summed.cost;
489-
acc.skipped += summed.skipped;
490-
acc.frequency += summed.frequency;
467+
// Sum
468+
const summed = _.reduce(
469+
rows,
470+
(acc, row) => {
471+
acc.count += row.count || 0;
472+
acc.time += row.time || 0;
473+
acc.cost += row.cost || 0;
474+
acc.skipped += row.skipped || 0;
475+
acc.frequency += row.frequency || 0;
491476
return acc;
492477
},
493-
{
494-
id: rows[0].id,
495-
file: rows[0].file,
496-
short_job_name: rows[0].short_job_name,
497-
labels: key,
498-
count: 0,
499-
time: 0,
500-
cost: 0,
501-
skipped: 0,
502-
frequency: 0,
503-
}
478+
{ count: 0, time: 0, cost: 0, skipped: 0, frequency: 0 }
504479
);
480+
481+
// Average across sha data points
482+
const numShas = _.uniq(rows.map((r) => r.sha)).length;
483+
return {
484+
id: rows[0].id,
485+
file: rows[0].file,
486+
short_job_name: rows[0].short_job_name,
487+
labels: key,
488+
count: summed.count / numShas,
489+
time: summed.time / numShas,
490+
cost: summed.cost / numShas,
491+
skipped: summed.skipped / numShas,
492+
frequency: summed.frequency / numShas,
493+
};
505494
});
506495

507496
return (
@@ -1069,14 +1058,29 @@ export default function Page() {
10691058
<CommitInfo data={data} />
10701059
<Overview
10711060
data={data}
1072-
setFileFilter={setFileFilter}
1073-
setJobFilter={setJobFilter}
1074-
setLabelFilter={setLabelFilter}
1061+
setFileFilter={(input) => {
1062+
setFileFilter(input);
1063+
setFileRegex(false);
1064+
}}
1065+
setJobFilter={(input) => {
1066+
setJobFilter(input);
1067+
setJobRegex(false);
1068+
}}
1069+
setLabelFilter={(input) => {
1070+
setLabelFilter(input);
1071+
setLabelRegex(false);
1072+
}}
10751073
/>
10761074
<Diffs
10771075
data={data}
1078-
setFileFilter={setFileFilter}
1079-
setJobFilter={setJobFilter}
1076+
setFileFilter={(input) => {
1077+
setFileFilter(input);
1078+
setFileRegex(false);
1079+
}}
1080+
setJobFilter={(input) => {
1081+
setJobFilter(input);
1082+
setJobRegex(false);
1083+
}}
10801084
/>
10811085
<Graphs data={data} />
10821086
<Stack spacing={2}>

0 commit comments

Comments
 (0)