Repository navigation
Conversation
Signed-off-by: Patrick Plattner <pplattner@nvidia.com>
pplattner
force-pushed
the
fix/bounded-model-retries-upstream
branch
from
August 13, 2026 09:40
8a4b7b5 to
009d2fe
Compare
8 tasks
Bounded backoff (exponential, Retry-After-aware, capped at MAX_SECONDS_TRIES) now only applies when the request isn't marked _internal. _internal already reaches this function today (NeMoGymAsyncOpenAI.internal -> _request()'s kwargs -> here). Signed-off-by: Riccardo Roveri <rroveri@nvidia.com>
# Conflicts: # tests/unit_tests/test_openai_utils.py
# Conflicts: # tests/unit_tests/test_openai_utils.py
This was referenced Sep 9, 2026
Contributor
|
This remains the provider-response implementation candidate for #2845. Before landing, it should consume the single logical request budget defined by #3159, preserve the external-vs-internal ownership added by #3079, honor Retry-After within the remaining budget, and treat terminal input errors separately. A transport retry or changing sequence of status codes must not reset accounting. |
This was referenced Oct 22, 2026
This branch has not been 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.
Summary
Retry-Afterdelay-seconds and HTTP-date valuesContext
During a five-shard benchmark evaluation against a hosted endpoint, the model endpoint began returning HTTP 429 responses. Each shard ran with concurrency 10, allowing roughly 50 concurrent agent slots for this evaluation while other hosted-model evaluations were also active.
The retry loop started with
MAX_NUM_TRIES = 3, but increasedmax_num_triesfor every rate-limit response. Because both the attempt counter and the maximum increased together, a request could never exhaust its retry budget while the endpoint continued returning 429. Every failed request was then retried after a fixed 0.5-second sleep.The affected evaluation recorded approximately 6.17 million retry attempts over about 22.5 hours. Individual logical requests reached more than 10,000 attempts, with the longest observed chain reaching 10,895. This produced a sustained lower-bound average of roughly 76 retry requests per second, in addition to normal model calls. Although the workload was a legitimate benchmark, this retry amplification made its traffic resemble a DDoS to the hosted endpoint.
This change adds a hard 120-second wall-clock retry budget so rate-limit responses cannot extend retries indefinitely. It also replaces the fixed delay with exponential backoff and honors server-provided
Retry-Afterguidance in both delay-seconds and HTTP-date formats.Tests
ruff format --check nemo_gym/openai_utils.py nemo_gym/server_utils.py tests/unit_tests/test_openai_utils.pyruff check nemo_gym/openai_utils.py nemo_gym/server_utils.py tests/unit_tests/test_openai_utils.pypytest tests/unit_tests/test_openai_utils.py -q— 128 passed