Adding Evaluation suite to test hardware and Network#3135
Adding Evaluation suite to test hardware and Network#3135rushabhdhoke wants to merge 14 commits into
Conversation
Greptile SummaryThis PR adds hardware and network evaluation tools for DimOS. The main changes are:
Confidence Score: 5/5The latest changes look safe to merge.
Important Files Changed
Reviews (4): Last reviewed commit: "Merge branch 'main' into main" | Re-trigger Greptile |
|
|
||
| def _display_name(case: Any) -> str: | ||
| """Pretty transport label, shared with the benchmark's pubsub_id.""" | ||
| from dimos.protocol.pubsub.benchmark.measure import transport_name |
There was a problem hiding this comment.
Both _display_name() and run_network_eval() import helpers from dimos.protocol.pubsub.benchmark.measure, but that module is absent from the repository. The documented network run fails with ModuleNotFoundError before measuring a transport, and --list fails when it calls _display_name().
There was a problem hiding this comment.
module.py was existing in previous dimos versions, current version doesn't have that file, so this was failing. Added the file in my folder and referenced it.
|
|
||
| def networked_cases() -> list[Any]: | ||
| """The subset of the benchmark's testcases that actually cross a link.""" | ||
| from dimos.protocol.pubsub.benchmark.testdata import testcases |
There was a problem hiding this comment.
There was a problem hiding this comment.
Wrapped the from testdata import testcases in a try/except ImportError that gives a clear error message telling the user to install dev dependencies.
| worker_source = cast("WorkerManagerPython", coordinator._managers["python"]) | ||
| monitor = StatsMonitor(worker_source, resource_logger=resource_logger, interval=interval) | ||
|
|
||
| monitor.start() |
There was a problem hiding this comment.
There was a problem hiding this comment.
Added monitor.stop() to the finally block. The monitor variable is now tracked in the outer scope (initialized to None) so finally can always reach it, even if the exception happens after monitor.start().
| build_start = time.monotonic() | ||
| from dimos.core.coordination.module_coordinator import ModuleCoordinator | ||
|
|
||
| coordinator = ModuleCoordinator.build(bp) |
There was a problem hiding this comment.
There was a problem hiding this comment.
Changed the build to built = ModuleCoordinator.build(bp) then coordinator = built on the next line. If build() raises partway through, coordinator stays None so finally won't try to call .stop() on a half-built object. The actual teardown of any partially-started managers is ModuleCoordinator's responsibility.
| help="Steady-state sampling window in seconds (default: 15).") | ||
| parser.add_argument("--warmup", type=float, default=3.0, |
There was a problem hiding this comment.
Fixed in runner.py + main.py, run_eval() now raises ValueError if interval <= 0
The CLI in main.py validates --interval > 0 before calling run_eval()
Adjusted formatting of the 'status' field in the EvalResult dataclass for consistency.
| from dimos.protocol.pubsub.benchmark.testdata import testcases | ||
| except ImportError as exc: | ||
| raise ImportError( | ||
| "The transport benchmark test-data module requires pytest and its " | ||
| "dependencies to be installed. Install with: uv sync --all-extras" | ||
| ) from exc |
There was a problem hiding this comment.
Runtime dependency remains unresolved
Importing benchmark.testdata still executes its unconditional import pytest. A normal installation without test dependencies therefore cannot run --list or any network evaluation. This handler only replaces the original exception, and its suggested uv sync --all-extras command does not install the test group containing pytest. Move the reusable cases out of the pytest module or declare the required runtime dependency.
| built = ModuleCoordinator.build(bp) | ||
| coordinator = built |
There was a problem hiding this comment.
ModuleCoordinator.build() starts worker processes before connecting streams and references or starting modules. If one of those later steps raises, build() never returns, so coordinator remains None. The finally block then skips coordinator.stop(), leaving workers or partially started modules running. Cleanup must happen inside ModuleCoordinator.build() for every exception after startup, or the coordinator must be available before those fallible steps run.
Contribution path
Problem
Requirement of an FDE-facing eval utility for Jetson, Nvidia, AGX systems. Added Network eval for simulating network stability for real world deployments.
Solution
Introduced "dimos/eval` with two standalone tools that reusing existing DimOS infrastructure.
StatsMonitor(used bydtop) to an in-memory logger to calculate startup cost. Measures CPU, PSS Memory, GPU utilization and startup times for Jetson and Nividia hardware. Outputs a JSON file with a hardware profile.measure_throughputfunction as the existing benchmark then runs the 'tc netem'. It evaluates the transport, profilepair and calculates % loss and latency.How to Test
Resource eval — list available blueprints
python -m dimos.eval --list
Network eval (smoke test)
python -m dimos.eval.network --baseline-only
Full netem sweep (Linux + root )
sudo -E python -m dimos.eval.network --iface lo
AI assistance
Gemini 3.5 Flash & Claude Sonnet 4.6
Checklist