Skip to content

Add resource/throughput benchmark metrics and offline CI smoke coverage#99

Open
Safaael25 wants to merge 3 commits into
vcache-project:masterfrom
Safaael25:feat/benchmark-metrics
Open

Add resource/throughput benchmark metrics and offline CI smoke coverage#99
Safaael25 wants to merge 3 commits into
vcache-project:masterfrom
Safaael25:feat/benchmark-metrics

Conversation

@Safaael25

Copy link
Copy Markdown
Contributor

No description provided.

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.
@Safaael25

Copy link
Copy Markdown
Contributor Author

@luis-gasparschroeder

@luis-gasparschroeder luis-gasparschroeder left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing! Before merging, could you address a few comments:

  1. the precomputed QPS/TPS currently measures harness speed rather than simulated model latency,
  2. psutil is undeclared (imported in benchmarks/common/resource_metrics.py, but it is not listed under [project].dependencies or [tool.poetry.group.benchmarks.dependencies])
  3. NVML is repeatedly initialized without shutdown, and
  4. 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.
  5. 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
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.

2 participants