-
Notifications
You must be signed in to change notification settings - Fork 20
feat(experiments): Expose end-to-end latency metric on Evaluations #1133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
76967d0
63142e4
b8bec21
ba60e4c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """``end_to_end_latency_ms`` computed field on EvaluationResponse. | ||
|
|
||
| It names ``latency_ms.sum`` — the test-case-weighted latency sum (per-test-case latency, with a | ||
| test case's attempts averaged, summed across test cases), i.e. end-to-end latency assuming tasks | ||
| run serially. The rollup already computes ``latency_ms.sum`` with that semantics; the field only | ||
| surfaces it so consumers don't have to know the convention. | ||
| """ | ||
|
|
||
| from nmp.intake.api.v2.experiments.schemas import EvaluationResponse, EvaluatorAggregate | ||
|
|
||
|
|
||
| def _response(latency: EvaluatorAggregate | None) -> EvaluationResponse: | ||
| return EvaluationResponse( | ||
| id="e", | ||
| name="e", | ||
| workspace="default", | ||
| experiment_ids=["grp"], | ||
| dataset_name="ds", | ||
| latency_ms=latency, | ||
| ) | ||
|
|
||
|
|
||
| def test_end_to_end_latency_equals_latency_sum() -> None: | ||
| resp = _response(EvaluatorAggregate(sum=1234.5, mean=411.5, count=3)) | ||
| assert resp.end_to_end_latency_ms == 1234.5 | ||
| # and it serializes under the field name | ||
| assert resp.model_dump()["end_to_end_latency_ms"] == 1234.5 | ||
|
|
||
|
|
||
| def test_end_to_end_latency_is_none_without_latency() -> None: | ||
| assert _response(None).end_to_end_latency_ms is None | ||
| # latency present but no summable value (no session carried latency) | ||
| assert _response(EvaluatorAggregate()).end_to_end_latency_ms is None |
Uh oh!
There was an error while loading. Please reload this page.