Skip to content

feat(perf): add ipc diff comparison script#135

Merged
Maxpicca-Li merged 2 commits into
mainfrom
rtl-pf-anal
Jun 25, 2026
Merged

feat(perf): add ipc diff comparison script#135
Maxpicca-Li merged 2 commits into
mainfrom
rtl-pf-anal

Conversation

@Maxpicca-Li

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py to load checkpoint sets from a JSON file and compute per-checkpoint IPC from simulator_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.

Comment thread perf/ipc_diff_pro.py
Comment on lines +14 to +20
import argparse
import csv
import json
import os
from multiprocessing import Process, Queue

from perf import PerfCounters

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread perf/ipc_diff_pro.py
Comment on lines +49 to +52
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)))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread perf/ipc_diff_pro.py
Comment thread perf/ipc_diff_pro.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread perf/ipc_diff_pro.py
Comment thread perf/ipc_diff_pro.py
Comment thread perf/ipc_diff_pro.py
@Maxpicca-Li Maxpicca-Li requested a review from Yan-Muzi June 25, 2026 09:14
@Maxpicca-Li Maxpicca-Li changed the title anal(perf): add ipc diff comparison script feat(perf): add ipc diff comparison script Jun 25, 2026
@Maxpicca-Li Maxpicca-Li merged commit 06d21a2 into main Jun 25, 2026
1 check passed
@Maxpicca-Li Maxpicca-Li deleted the rtl-pf-anal branch June 25, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants