From 0a9cf58e1999ece7b93d5d9bdc08644d8f34b51a Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Sun, 13 Sep 2026 13:25:44 -0700 Subject: [PATCH] fix(mtp-bench): peak-power summary mis-keyed GPU 0 by timestamp power.log lines begin ' 0, W, ...', so splitting the first pipe-field on ', ' yields a[1] = '20:18:00 0' rather than '0'. GPU 0 was therefore keyed by sample timestamp, emitting one bogus row per sample and no recoverable peak, while GPUs 1-3 aggregated correctly. Take the GPU index as the last whitespace-separated token of a[1]. Verified against a two-sample fixture: the old parser emits a spurious row per timestamp, the patched one reports 0/1/2/3 once each at the correct peaks. The end-of-campaign summary is the GPU-side input to the fv-ml1 circuit budget, so a silently wrong GPU 0 row is a measurement fault, not cosmetic. The in-flight campaign still runs the old on-host copy (editing a running bash script corrupts execution by byte offset); its summary will be recomputed from the raw power.log. --- services/flash-next-mtp-bench/run-campaign.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/flash-next-mtp-bench/run-campaign.sh b/services/flash-next-mtp-bench/run-campaign.sh index 7cbdad8..a64433e 100755 --- a/services/flash-next-mtp-bench/run-campaign.sh +++ b/services/flash-next-mtp-bench/run-campaign.sh @@ -182,4 +182,4 @@ log "########## CAMPAIGN DONE -- results in $OUT ##########" # serving the operator's `gen-large` traffic throughout; this campaign only ever # created and removed `fn-mtp-bench` on GPU 3. log "peak power draw seen per card:" -awk -F'|' '{for(i=1;i<=NF;i++) if($i ~ /W/){split($i,a,", "); gsub(/^ +/,"",a[1]); gsub(/ W/,"",a[2]); if(a[2]+0>m[a[1]]) m[a[1]]=a[2]+0}} END{for(g in m) printf " GPU %s peak %.0f W\n", g, m[g]}' "$OUT/power.log" | sort | tee -a "$OUT/campaign.log" +awk -F'|' '{for(i=1;i<=NF;i++) if($i ~ /W/){split($i,a,", "); n=split(a[1],b," "); idx=b[n]; gsub(/ W/,"",a[2]); if(a[2]+0>m[idx]) m[idx]=a[2]+0}} END{for(g in m) printf " GPU %s peak %.0f W\n", g, m[g]}' "$OUT/power.log" | sort | tee -a "$OUT/campaign.log"