fix(perf): render live HW chart for --monitor in --module mode (#654)#920
Open
xieofxie wants to merge 2 commits into
Open
fix(perf): render live HW chart for --monitor in --module mode (#654)#920xieofxie wants to merge 2 commits into
xieofxie wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #654 —
perf --monitordid nothing visible in--modulemode.In single-model mode,
--monitordrives 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
--modulemode, the monitored branch created anHWMonitorand 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--monitorappeared 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, whilehw_monitormetrics are still persisted to the JSON report (unchanged).Testing
TestPerfModuleMonitor::test_monitor_drives_live_chart_per_module, which asserts_run_monitored_loopis invoked once per module instance under--module --monitorand 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