Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions miles/rollout/generate_hub/agentic_tool_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ async def generate(input: GenerateFnInput) -> GenerateFnOutput:
for s in samples:
s.metadata.update(agent_metadata or {})

# If the agent function reports wall-clock time spent outside policy generation
# (env/tool steps), surface it on Sample.non_generation_time so throughput
# accounting subtracts it. Must be equal across all turn-samples: merge_samples
# collapses them with _merge_equal_value, which asserts the values match.
ngt = ((agent_metadata or {}).get("agent_metrics") or {}).get("total_tool_time")
if ngt is not None:
for s in samples:
s.non_generation_time = ngt
Comment thread
Shi-Dong marked this conversation as resolved.

if max_seq_len is not None:
samples = truncate_samples_by_total_tokens(samples, max_seq_len, input.state.tokenizer)

Expand Down
Loading