Add resource/throughput benchmark metrics and offline CI smoke coverage#99
Open
Safaael25 wants to merge 3 commits into
Open
Add resource/throughput benchmark metrics and offline CI smoke coverage#99Safaael25 wants to merge 3 commits into
Safaael25 wants to merge 3 commits into
Conversation
Track CPU/memory/GPU utilization and queries/tokens-per-second throughput alongside the existing hit-rate/latency/accuracy metrics, write results to CSV as well as JSON, and add fully offline unit/integration tests so the instrumentation reruns on every commit without needing a full-scale, paid benchmark run in CI. Also commits a sample results log as documented in benchmarks/ReadMe.md.
benchmarks.benchmark.Benchmark subclasses unittest.TestCase and defines test_run_benchmark(self, max_samples), an existing quirk unrelated to this PR. Importing it at module level in a test_*.py file made pytest collect and try to run it as its own bare test case, which fails because pytest has no way to supply the required `vcache` constructor argument. Moving the import inside setUp() keeps it out of the module's top-level namespace so pytest's collector never sees it.
Contributor
Author
luis-gasparschroeder
requested changes
Jul 22, 2026
luis-gasparschroeder
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for contributing! Before merging, could you address a few comments:
- the precomputed QPS/TPS currently measures harness speed rather than simulated model latency,
- psutil is undeclared (imported in benchmarks/common/resource_metrics.py, but it is not listed under [project].dependencies or [tool.poetry.group.benchmarks.dependencies])
- NVML is repeatedly initialized without shutdown, and
- the smoke test leaks policy workers because VCache(..., VerifiedDecisionPolicy(...)) starts a background thread and a ThreadPoolExecutor. The smoke test only shuts down the eviction policy.
- The tests should also verify exact metric calculations, not only their presence
- Compute QPS/TPS from summed per-query latency instead of the benchmark loop's wall-clock time, which was dominated by harness overhead rather than simulated model latency - Initialize NVML once and cache the device handle instead of calling nvmlInit() on every sample; shut it down via atexit - Declare psutil as a project dependency (was used but undeclared) - Shut down VerifiedDecisionPolicy's executor/callback thread in the benchmark smoke test's tearDown, fixing a background-thread leak - Strengthen resource metrics and smoke tests to assert exact computed values instead of just presence/bounds
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.
No description provided.