perf: speed up CLI monitor startup and fix wrapped commands (4/4)#1254
Merged
Conversation
This was referenced Jun 21, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1254 +/- ##
==========================================
+ Coverage 89.62% 89.68% +0.06%
==========================================
Files 48 48
Lines 4761 4771 +10
==========================================
+ Hits 4267 4279 +12
+ Misses 494 492 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
5fc6acd to
e933dea
Compare
07b82eb to
928621d
Compare
e933dea to
11f3f20
Compare
Add process-level hardware setup cache, probe result caching, platform-aware CPU backend selection, and parallel CPU/GPU setup for faster repeat runs. Co-authored-by: Cursor <cursoragent@cursor.com>
Import GPU/CPU probe modules before clearing caches so lru_cache state does not leak across tests in the full suite. Co-authored-by: Cursor <cursoragent@cursor.com>
11f3f20 to
8f5e960
Compare
Collaborator
Author
928621d to
85a0b1f
Compare
Cover scalar GPU id normalization, defensive error paths, power gadget setup, and fallback tracking branches missing from the PR patch report. Co-authored-by: Cursor <cursoragent@cursor.com>
Skip POST /runs during tracker startup and create the run lazily on the first live_out/out call when an experiment id is configured. Co-authored-by: Cursor <cursoragent@cursor.com>
Lazy-import heavy CLI dependencies, add --log-level to monitor, and strip nested monitor/-- tokens when delegating to wrapped user commands. Co-authored-by: Cursor <cursoragent@cursor.com>
85a0b1f to
e8e07e9
Compare
8f5e960 to
ff49674
Compare
Base automatically changed from
davidberenstein1957/perf-3-lazy-api-run
to
master
June 29, 2026 12:16
inimaz
approved these changes
Jun 29, 2026
inimaz
left a comment
Collaborator
There was a problem hiding this comment.
Nice thanks @davidberenstein1957 !
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
Part 4/4 of the tracker performance stack. Depends on #1251 → #1252 → #1253.
cc @inimaz — final CLI layer of the #1246 split. Merging #1251 → #1252 → #1253 → this PR restores the full change set.
Speeds up
codecarbon monitorstartup and fixes wrapped-command delegation:questionary,requests, tracker classes, etc.)--log-leveloption tocodecarbon monitor(default:error)monitor/--tokens before exec--log-leveldefaultBenchmarks (measured locally, offline Mac ARM, 2026-06-21)
Full stack cumulative vs
master:__init__p50init→start→stop)Stack
CI / quality
pre-commit run --all-files— passed (autoflake, isort, black, flake8)pytest tests/cli/— 59 passedCODECARBON_ALLOW_MULTIPLE_RUNS=True pytest --ignore=tests/test_viz_data.py -m 'not integ_test' tests/)Test plan
codecarbon monitor --offline --country-iso-code FRA -- sleep 1codecarbon monitor --offline --country-iso-code FRA --log-level debug -- python train.pyReplaces
Split from #1246.