fix(nemo-gym): emit structured response summary on empty generation#2367
Open
jthomson04 wants to merge 2 commits intoNVIDIA-NeMo:mainfrom
Open
fix(nemo-gym): emit structured response summary on empty generation#2367jthomson04 wants to merge 2 commits intoNVIDIA-NeMo:mainfrom
jthomson04 wants to merge 2 commits intoNVIDIA-NeMo:mainfrom
Conversation
When NeMo-Gym returned a result with no generation data, the existing `ValueError` claimed the prompt exceeded `vLLM max_model_len` and told the user to bump `policy.max_total_sequence_length`. This is only one of several possible causes — the response can also come back empty due to `max_output_tokens` truncation, an upstream error, or a refusal — and the misleading message sent users on a wild goose chase. Replace the canned hint with a structured summary of the response: status, finish reason, incomplete details, error, usage, and a per- output-item breakdown (type, role, status, finish reason, content shape). The full response is JSON-dumped so the actual cause is visible at the failure site. Add unit tests for the summarizer that cover the typical truncated- generation case and the malformed-response fallback. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Author
|
/ok to test 02f609f |
The empty-generation summary previously surfaced only response-side fields. With many concurrent rollouts in flight, an operator also needs request-side identifiers (model, max_output_tokens, metadata/user) to pinpoint which call failed. Add `_summarize_nemo_gym_request_params` and include its output under a `request` key in both the well-formed and malformed-response branches of `_summarize_nemo_gym_empty_generation_result`. Extend the existing tests to cover the new fields and the malformed-response path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
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
ValueErrorclaimed the prompt exceededvLLM max_model_lenand told the user to bumppolicy.max_total_sequence_length. That is only one of several possible causes — empty responses also come back frommax_output_tokenstruncation, upstream errors, refusals, etc. — and the misleading message sent users on a wild goose chase._truncate_error_value,_summarize_nemo_gym_output_item,_summarize_nemo_gym_empty_generation_result) are module-level so they're directly testable.Test plan
tests/unit/environments/test_nemo_gym.py::test_summarize_nemo_gym_empty_generation_result_is_diagnosablepasses.tests/unit/environments/test_nemo_gym.py::test_summarize_nemo_gym_empty_generation_result_handles_non_dict_responsepasses.max_output_tokens) and confirm the new error message includesincomplete_details/finish_reason/ per-output content info.🤖 Generated with Claude Code