From a3df19794243239963d51a91e19084e322a212ec Mon Sep 17 00:00:00 2001 From: Huy Do Date: Thu, 16 Jan 2025 02:15:02 -0800 Subject: [PATCH] Compute speedup using the base commit value --- torchci/lib/benchmark/aoUtils.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/torchci/lib/benchmark/aoUtils.ts b/torchci/lib/benchmark/aoUtils.ts index 26afb4df64..c50cc1ca2d 100644 --- a/torchci/lib/benchmark/aoUtils.ts +++ b/torchci/lib/benchmark/aoUtils.ts @@ -79,7 +79,14 @@ export function computeSpeedup( return; } - const k = `${r.workflow_id} ${r.job_id} ${r.model} ${r.metric} ${r.device} ${r.arch}`; + const k = `${r.model} ${r.metric} ${r.device} ${r.arch}`; + // Compare against the oldest base commit + if ( + k in baselineMetrics && + baselineMetrics[k].workflow_id < r.workflow_id + ) { + return; + } baselineMetrics[k] = r; }); @@ -91,11 +98,12 @@ export function computeSpeedup( } if (SPEEDUP_METRICS.includes(r.metric)) { - const k = `${r.workflow_id} ${r.job_id} ${r.model} ${r.metric} ${r.device} ${r.arch}`; + const k = `${r.model} ${r.metric} ${r.device} ${r.arch}`; if ( k in baselineMetrics && baselineMetrics[k].actual !== 0 && - r.actual !== 0 + r.actual !== 0 && + baselineMetrics[k].workflow_id <= r.workflow_id ) { const speedup = r.metric.includes("time") ? baselineMetrics[k].actual / r.actual