Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/update_test_file_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
file-report:
if: >
(github.event_name == 'schedule' && github.event.schedule.cron == '0 2 * * *') ||
(github.event_name == 'schedule' && github.event.schedule == '0 2 * * *') ||
(github.event_name == 'workflow_dispatch')
permissions:
issues: write
Expand All @@ -25,7 +25,6 @@ jobs:
cd tools/torchci && python3 -mpip install -e .

- name: Run file report generator
if: false
env:
CLICKHOUSE_ENDPOINT: ${{ secrets.CLICKHOUSE_HUD_USER_URL }}
CLICKHOUSE_USERNAME: ${{ secrets.CLICKHOUSE_HUD_USER_USERNAME }}
Expand All @@ -46,7 +45,7 @@ jobs:

weekly-file-report-notification:
if: >
(github.event_name == 'schedule' && github.event.schedule.cron == '0 3 * * 2') ||
(github.event_name == 'schedule' && github.event.schedule == '0 3 * * 2') ||
(github.event_name == 'workflow_dispatch')
permissions:
issues: write
Expand Down
14 changes: 4 additions & 10 deletions tools/torchci/test_insights/daily_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

CONFIG = [
{
"team": "dev-infra",
"team": "pytorch-dev-infra",
"condition": lambda _: True,
"link": FILE_REPORT_URL,
},
Expand Down Expand Up @@ -74,9 +74,7 @@ def gen_regression_for_team(
if (info["short_job_name"], info["file"]) in relevant_keys
]

def _sum_invoking_file_info(
data: list[dict[str, Any]], field: str
) -> dict[str, Any]:
def _sum_invoking_file_info(data: list[dict[str, Any]]) -> dict[str, Any]:
info = {
"count": sum(item["count"] for item in data),
"cost": sum(item["cost"] for item in data),
Expand All @@ -85,12 +83,8 @@ def _sum_invoking_file_info(
}
return info

agg_prev_file_info = _sum_invoking_file_info(
relevant_prev_invoking_file_info, "prev"
)
agg_curr_file_info = _sum_invoking_file_info(
relevant_curr_invoking_file_info, "curr"
)
agg_prev_file_info = _sum_invoking_file_info(relevant_prev_invoking_file_info)
agg_curr_file_info = _sum_invoking_file_info(relevant_curr_invoking_file_info)

invoking_file_info_diff = {
"count": {
Expand Down
1 change: 1 addition & 0 deletions tools/torchci/test_insights/file_report_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ def _get_frequency(self) -> List[Dict[str, Any]]:
where
j.created_at > now() - interval 8 day
and j.created_at < now() - interval 1 day
and j.conclusion != 'cancelled'
group by
name
"""
Expand Down
84 changes: 44 additions & 40 deletions torchci/pages/tests/fileReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -464,44 +464,33 @@ function Overview({
);

const groupedRows = _.map(groupByTarget, (rows, key) => {
// Sum within sha
const summedBySha = _.map(_.groupBy(rows, "sha"), (shaRows) => {
return _.reduce(
shaRows,
(acc, row) => {
acc.count += row.count || 0;
acc.time += row.time || 0;
acc.cost += row.cost || 0;
acc.skipped += row.skipped || 0;
acc.frequency += row.frequency || 0;
return acc;
},
{ count: 0, time: 0, cost: 0, skipped: 0, frequency: 0 }
);
});
// the reduce across shas for average
return _.reduce(
summedBySha,
(acc, summed) => {
acc.count += summed.count;
acc.time += summed.time;
acc.cost += summed.cost;
acc.skipped += summed.skipped;
acc.frequency += summed.frequency;
// Sum
const summed = _.reduce(
rows,
(acc, row) => {
acc.count += row.count || 0;
acc.time += row.time || 0;
acc.cost += row.cost || 0;
acc.skipped += row.skipped || 0;
acc.frequency += row.frequency || 0;
return acc;
},
{
id: rows[0].id,
file: rows[0].file,
short_job_name: rows[0].short_job_name,
labels: key,
count: 0,
time: 0,
cost: 0,
skipped: 0,
frequency: 0,
}
{ count: 0, time: 0, cost: 0, skipped: 0, frequency: 0 }
);

// Average across sha data points
const numShas = _.uniq(rows.map((r) => r.sha)).length;
return {
id: rows[0].id,
file: rows[0].file,
short_job_name: rows[0].short_job_name,
labels: key,
count: summed.count / numShas,
time: summed.time / numShas,
cost: summed.cost / numShas,
skipped: summed.skipped / numShas,
frequency: summed.frequency / numShas,
};
});

return (
Expand Down Expand Up @@ -1069,14 +1058,29 @@ export default function Page() {
<CommitInfo data={data} />
<Overview
data={data}
setFileFilter={setFileFilter}
setJobFilter={setJobFilter}
setLabelFilter={setLabelFilter}
setFileFilter={(input) => {
setFileFilter(input);
setFileRegex(false);
}}
setJobFilter={(input) => {
setJobFilter(input);
setJobRegex(false);
}}
setLabelFilter={(input) => {
setLabelFilter(input);
setLabelRegex(false);
}}
/>
<Diffs
data={data}
setFileFilter={setFileFilter}
setJobFilter={setJobFilter}
setFileFilter={(input) => {
setFileFilter(input);
setFileRegex(false);
}}
setJobFilter={(input) => {
setJobFilter(input);
setJobRegex(false);
}}
/>
<Graphs data={data} />
<Stack spacing={2}>
Expand Down