Repository navigation
[rl] Verifiers: the generation server keeps one session per trace - #6106
Draft
felipemello1 wants to merge 1 commit into
Draft
felipemello1 wants to merge 1 commit into
felipemello1 wants to merge 1 commit into
Conversation
felipemello1
force-pushed
the
felipemello1/verifiers-v2/2-verifiers-0.4.1
branch
from
November 15, 2026 23:40
fe14957 to
f242c05
Compare
felipemello1
force-pushed
the
felipemello1/verifiers-v2/2b-generation-sessions
branch
from
November 15, 2026 23:40
da8849e to
58d7f7c
Compare
5 tasks
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 (human-written)
Agent details
TLDR: The Verifiers generation server keeps one session per trace: opened when Verifiers starts the trace, closed only after the trace's model calls return. It accepts prompts up to 1 GiB of JSON, and Verifiers' renderer, not the server, refuses a prompt with no room for an output token.
Stack (15 PRs, bottom first; merging a PR also merges every PR below it; this PR in bold)
Alone on main, not in this stack: "Validation reads each prompt at most once; ValidationConfig.steps defaults to -1" and "Terminal-Bench 35B-A3B recipe: Dist-MoE in both roles, FULL CUDA graph generators, DAPO loss".
Problem
generate_fncall still runs, and the worker could release its routing session first (the TODO the previous PR left).Solution
GenerationServer.open_session(trace_id, group_id=...)runs for each trace Verifiers starts.close_sessionrefuses further calls, waits for the calls in flight, and returns the trace's policy-version range and generator metrics./v1/modelsadvertisesmax_model_len = max_rollout_tokens - 1. Verifiers' renderer refuses a longer prompt before sending it, as aProviderErrorwith status 400._sampling_configrefuses a param the generator can't apply, e.g. an env'srepetition_penalty, anothertop_kormin_p, or top-k logprobs. Any failure answers 500.VerifiersRolloutWorker.Config.max_rollout_tokensreplacesgeneration_server=GenerationServer.Config(...).logprobs.content, what renderers 0.1.12 reads), the trace converter, the statuses.NOTE: not run on GPUs, on Verifiers 0.4.0. Merge it with PRs 6, 8 and 9, after the Terminal-Bench run at PR 9's head.
NOTE: the RDMA TODO in
RolloutWorkerActor.run_groupcomes with this PR's size limits: once a group's per-token arrays pass about 3 GiB, the group reply should carry RDMA handles.TODOs in this PR: per-token policy versions; generators serve this endpoint; a faster JSON parser; only new tokens to the generator; score centering's top-k;
usage; othertop_k,min_por top-k logprobs (raise early); check an env's agent sampling keys when the env loads; router replay rows, withrdma_min_tensor_bytesin its recipes; rollout-side RDMA handles.Test plan
pip install -e torchtitan/rl/examples/verifiers/dapo_math -e torchtitan/rl/examples/verifiers/terminal_bench pytest tests/rl/unit_tests/cpu tests/unit_tests/cpu/components/test_renderer.py tests/unit_tests/cpu/config # Verifiers 0.4.0: 969 passed, 1 skippedNew:
test_generation_server_serves_generate_fn_per_session(two calls, one prompt over 1 MiB; the reply read as renderers 0.1.12 reads it),test_generation_server_answers_500_without_a_usable_completion,test_closing_a_session_waits_for_its_call_in_flight,test_renderer_refuses_a_prompt_with_no_room_for_an_output_token,test_sampling_config_takes_only_what_the_generator_honors.