You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[NVBug 6978294] Report null usage when a finished call's usage is lost, and zero when no call finished #4940
Agents that sum per-call token usage break two of the three cases in Gym's documented contract
(rollout-evidence.mdx L163-167, rollout-health.mdx L145-150, from #4287):
When a finished response's usage is missing or malformed, the usage must be null. Instead, the agents sum the
other calls (accumulate_response_usage skips a None), so a subtotal reads as the rollout's total.
When no call finished, the usage must be zero. Instead, conversational_tool_use_scenario_generation reports null when every request fails.
Reproduction
Model-free script, run on a git archive of main 9334fa27c:
aviary: 2 finished calls, the second without usage → usage = 300/1400/1700 (expected null).
A shared helper in nemo_gym/openai_utils.py that returns the sum, zero, or null with a completeness flag, as scicode_agent's usage_complete does. Switch every summing agent to it. Tests per agent: a known and a lost-usage
finished call in both orders → null; no finished call → zero where the agent sees every call. This is the
follow-up yaoyu-33 asked for on #4761.
Triage
Waiting for #4761 to merge so that one PR covers every agent off main. No GPU needed for unit tests; a capture
smoke on h100 for the live check.
Activity