feat(perf): add ipc diff comparison script#135
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new Python utility under perf/ to compare IPC values across multiple SPEC result directories (treating the first directory as the baseline) and emit a CSV report plus a short “top diffs” log-file list.
Changes:
- Introduce
perf/ipc_diff_pro.pyto load checkpoint sets from a JSON file and compute per-checkpoint IPC fromsimulator_err.txt. - Add multiprocessing-based IPC collection across checkpoints for faster aggregation.
- Output a CSV with per-dir IPC columns and baseline-relative deltas.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import argparse | ||
| import csv | ||
| import json | ||
| import os | ||
| from multiprocessing import Process, Queue | ||
|
|
||
| from perf import PerfCounters |
There was a problem hiding this comment.
Fixed by adding import sys and sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) before the from perf import PerfCounters import, ensuring the perf/ directory is always first in the search path regardless of how the script is invoked.
| def worker(task_q, result_q): | ||
| while not task_q.empty(): | ||
| ckpt, sim_err = task_q.get() | ||
| result_q.put((ckpt, read_ipc(sim_err))) |
There was a problem hiding this comment.
Fixed — worker() now uses a get_nowait() / queue.Empty loop instead of empty() check, so it reliably drains all tasks regardless of race conditions between processes.
No description provided.