Skip to content

[TENT] Add QoS metrics baseline to tebench#2845

Merged
staryxchen merged 7 commits into
kvcache-ai:mainfrom
catyans:qos-benchmark-metrics
Jul 15, 2026
Merged

[TENT] Add QoS metrics baseline to tebench#2845
staryxchen merged 7 commits into
kvcache-ai:mainfrom
catyans:qos-benchmark-metrics

Conversation

@catyans

@catyans catyans commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a generic --qos_classes=name:threads:slo_us:weight[:isolated_gbps],... workload contract to tebench
  • report per-class SLO attainment, P99 latency, goodput, and isolation leakage
  • report aggregate weighted goodput, weighted Jain fairness, and total link utilization
  • optionally append schema-versioned JSONL records; unavailable baseline-dependent metrics are emitted as null/N/A
  • retain link capacity and isolated baselines in JSONL so all derived metrics are reproducible
  • document metric definitions and matching isolated/mixed-run requirements

Metric semantics

  • SLO attainment is the fraction of completed batches with end-to-end transfer latency at or below the configured class SLO.
  • Jain fairness is computed over per-class throughput / weight.
  • Isolation leakage is max(0, 1 - mixed_throughput / isolated_throughput) and is only emitted when the caller supplies a matching isolated baseline.
  • Total utilization requires an explicit usable link capacity.

Validation

  • classic and USE_TENT=ON tebench targets build successfully with GCC 13.3 in a clean Ubuntu 24.04 container.
  • tebench_qos_metrics_test passes in both builds, covering contract parsing, validation, metric math, JSON validity, and null semantics.
  • TENT SHM target/initiator smoke completed about 1 million mixed batches; isolated-to-mixed recomputation matched all six derived metrics exactly.
  • classic TCP target/initiator smoke passed and produced valid two-class JSONL.
  • cross-host TENT/TCP on sinian-public-1 -> sinian-platform passed. With 64 KiB x batch 4 and four workers, the strict 1 ms foreground SLO attained 17.65%; Jain fairness was 0.8338, maximum isolation leakage 41.21%, and utilization 68.45%. All values were independently recomputed from the JSONL inputs.
  • RDMA-enabled build and metric tests pass; both hosts discover five HCAs. Cross-host RDMA transfer is not claimed as passed because the available backup pair reports peer GID/bootstrap mismatch and WQE retry timeouts.
  • format, codespell, Sphinx, and path checks pass.

Dependency

None. The branch is rebased on current main; QoS SLOs are reporting thresholds and do not change request scheduling policy.

@github-actions github-actions Bot added documentation Improvements or additions to documentation run-ci Transfer Engine labels Jul 10, 2026
@catyans

catyans commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

This replaces #2841 after renaming the fork branch from codex/qos-benchmark-baseline to qos-benchmark-metrics to comply with branch naming policy. The code and commit history are unchanged; prior review discussion and cluster validation are recorded on #2841.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces QoS metrics baseline reporting and deadline-aware bandwidth arbitration within priority tiers for the Mooncake Transfer Engine benchmark (tebench). It adds support for partitioning worker threads into QoS classes, calculating metrics like SLO attainment and Jain fairness, and ordering contending network slices by deadline urgency. The review feedback suggests optimizing the benchmark hot path by adding a bulk insertion method to XferMetricStats and using it in main.cpp to reduce lock contention when updating transfer statistics.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread mooncake-transfer-engine/benchmark/utils.h
Comment thread mooncake-transfer-engine/benchmark/main.cpp Outdated
@catyans

catyans commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Follow-up validation for the review fix at f2dd7c8:

  • built tebench_qos_metrics_test with TENT enabled
  • ctest -R tebench_qos_metrics_test --output-on-failure: 1/1 passed
  • clang-format 20 check passed for the changed files

All review threads are resolved. Full GitHub CI is now running/queued.

@codecov-commenter

codecov-commenter commented Jul 10, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 73.23944% with 114 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ke-transfer-engine/tent/src/common/qos_metrics.cpp 74.19% 64 Missing ⚠️
mooncake-transfer-engine/benchmark/main.cpp 0.00% 46 Missing ⚠️
mooncake-transfer-engine/benchmark/utils.cpp 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread docs/source/design/tent/tebench.md
Comment thread mooncake-transfer-engine/tent/include/tent/common/qos_metrics.h
@alogfans

alogfans commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the change — the direction on deadline-aware arbitration in tent/transport/rdma makes sense.

My main concern is layering: we want tebench to stay focused on benchmarking/testing, while all TENT execution logic lives under mooncake-transfer-engine/tent/.

In the current PR, a substantial part of the deadline/QoS logic is implemented in benchmark/, for example:

  • QoS class contract parsing and validation
  • thread-to-class mapping
  • converting SLO/deadline configuration into per-request deadline_ns
  • QoS metric semantics and computations (slo_attainment, goodput, weighted_goodput, jain_fairness, isolation_leakage, total_utilization)

Those are not just benchmark presentation details; they define TENT-facing workload semantics and policy, so they would be better placed under tent/, with tebench only acting as:

  • workload driver / test harness
  • request issuer
  • result printer / optional serializer

Concretely, I’d suggest:

  • move qos_metrics.{h,cpp} out of benchmark/ and into tent/
  • keep tebench responsible only for wiring inputs to TENT APIs and reporting outputs

The RDMA arbitration policy itself is already in the right direction by living under tent/transport/rdma. I think the rest of the QoS/deadline semantics should follow the same layering.

@catyans catyans force-pushed the qos-benchmark-metrics branch from f2dd7c8 to f90d7db Compare July 13, 2026 09:21
# Conflicts:
#	mooncake-transfer-engine/benchmark/main.cpp
#	mooncake-transfer-engine/benchmark/utils.cpp
#	mooncake-transfer-engine/benchmark/utils.h

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

LGTM

@staryxchen staryxchen merged commit 9c6fc51 into kvcache-ai:main Jul 15, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation run-ci Transfer Engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants