Repository navigation
fix(instruments): minute-scale buckets for Gym and HTTP duration histograms - #79
Draft
iguehring-nvidia wants to merge 1 commit into
Draft
iguehring-nvidia wants to merge 1 commit into
iguehring-nvidia wants to merge 1 commit into
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
…ograms gym.rollout.duration_ms, gym.verify.duration_ms and gym.server.request_duration_ms were created without bucket boundaries, so the SDK default applied, whose last edge is 10 s. A Gym rollout runs for minutes to tens of minutes, so every sample landed in the overflow bucket and histogram_quantile reported 10 s for any quantile. The same holds for the FastAPI histograms (http.server.duration in ms, http.server.request.duration in s), because a /run request lasts as long as its rollout. The Gym histograms now advise explicit boundaries from 100 ms to 60 min (older opentelemetry-api without the advisory parameter falls back to the default), and the MeterProvider carries views with the same boundaries for the two HTTP histograms. Observed on a Gym eval run (Terminal-Bench 4, 8 rollouts of 300 to 530 s): all 8 samples in +Inf, p95 read 10 s; from spans the true p95 was 517 s. Signed-off-by: Ingo Guehring <iguehring@nvidia.com>
iguehring-nvidia
force-pushed
the
iguehring/gym-duration-buckets
branch
from
October 8, 2026 01:49
8906064 to
a2fd7c6
Compare
|
Thanks for this, @iguehring-nvidia. Field data that supports merging it:
Happy to test it on a Slurm cluster with Apptainer. |
This branch was successfully deployed
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.
What
gym.rollout.duration_ms,gym.verify.duration_msandgym.server.request_duration_msare created without bucket boundaries, so the SDK default applies and its last edge is 10 s. A Gym rollout runs for minutes to tens of minutes, so every sample lands in the overflow bucket andhistogram_quantilereports 10 s for any quantile. The FastAPI histograms (http.server.durationin ms,http.server.request.durationin s) have the same problem, because a/runrequest lasts as long as its rollout.instruments/gym.py: the three duration histograms advise explicit boundaries from 100 ms to 60 min viaexplicit_bucket_boundaries_advisory; anopentelemetry-apiwithout that parameter falls back to the default.providers.py: theMeterProvidercarries two views with the same boundaries (ms and s) for the HTTP histograms.Evidence
A Gym eval run (Terminal-Bench 4, 8 rollouts lasting 300 to 530 s) exported
gym.rollout.duration_mswith all 8 samples in+Infand bounds[0, 5, …, 10000]; its p95 read 10 s on the dashboard while the span durations put it at 517 s.Tests
test_duration_histograms_resolve_minutes_not_just_seconds(a 20-minute rollout lands in the 20-minute bucket, nothing in overflow) andTestHttpDurationViews(both HTTP histograms get the boundaries, in their own units). Full suite: 464 passed.