Skip to content

fix(perf): render live HW chart for --monitor in --module mode (#654)#920

Open
xieofxie wants to merge 2 commits into
mainfrom
hualxie/module_monitor
Open

fix(perf): render live HW chart for --monitor in --module mode (#654)#920
xieofxie wants to merge 2 commits into
mainfrom
hualxie/module_monitor

Conversation

@xieofxie

Copy link
Copy Markdown
Contributor

Summary

Fixes #654perf --monitor did nothing visible in --module mode.

In single-model mode, --monitor drives a live hardware-utilization chart via _run_monitored_loop()LiveMonitorDisplay, which is exactly what the flag's help promises ("Show live hardware utilization chart").

In --module mode, the monitored branch created an HWMonitor and collected metrics into the JSON report, but never instantiated the live chart — it just spun the raw inference loop. So from the user's perspective --monitor appeared to do nothing for --module.

Fix

Route the per-module monitored loop through the same shared _run_monitored_loop() helper that single-model mode already uses. Each module instance now renders the live chart, while hw_monitor metrics are still persisted to the JSON report (unchanged).

Testing

  • Added TestPerfModuleMonitor::test_monitor_drives_live_chart_per_module, which asserts _run_monitored_loop is invoked once per module instance under --module --monitor and that the HW metrics still land in the JSON report. Verified it fails without the source fix and passes with it.
  • uv run pytest tests/unit/commands/test_perf_module.py — 12 passed.

🤖 Generated with Claude Code

hualxie added 2 commits June 18, 2026 17:12
In --module mode, --monitor created an HWMonitor and collected metrics
into the JSON report but never drove the live utilization chart, so the
flag appeared to do nothing (the --monitor help promises a live chart).

Route the per-module monitored loop through the shared _run_monitored_loop
helper that single-model mode already uses, so each module instance renders
the same live chart while still persisting hw_monitor metrics to JSON.
@xieofxie xieofxie requested a review from a team as a code owner June 18, 2026 09:16
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.

perf --monitor is not working for --module

1 participant