Skip to content

[rl] Verifiers generation server: no per-request access log (3/14) - #5453

Merged
felipemello1 merged 4 commits into
mainfrom
felipemello1/genserver-no-access-log
Nov 5, 2026
Merged

felipemello1 merged 4 commits into
mainfrom
felipemello1/genserver-no-access-log

Conversation

@felipemello1

@felipemello1 felipemello1 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

TLDR: The Verifiers generation server logged one INFO line per generate call: 79-87% of the controller's log lines and ~6-9% of the controller thread's samples. AppRunner(access_log=None) turns it off.

Stack (14 PRs, merge bottom-up; this PR is in bold)

PRs 2-7 don't need the HTTP design and can be reviewed now. PRs 8-14 wait on the design discussion on PRs 9 and 10.

# PR Independent? Needs (stack positions)
1 Verifiers 0.4.0 (merged) yes —
2 Verifiers: release each finished rollout's routing session yes — (resolves its test overlap with 1)
3 Verifiers generation server: no per-request access log yes —
4 Verifiers generation server: faster request path, required sampling params yes — (resolves its test overlap with 1-3)
5 Rollout workers write structured logs yes —
6 Drain in-flight rollouts during shutdown yes —
7 Rollouts that fail outside the policy are recorded, not trained no 2 (resolves its overlap with 4-6)
8 Generator drains itself before a hot_swap=False weight load yes —
9 Move GenerationServer to torchtitan/rl/generator yes, in code — (it moves the file 3 and 4 edit)
10 Every generate call goes over HTTP to its generator no 1, 2, 3, 4, 7, 8, 9
11 Generator aborts a request whose caller left no 10
12 Cancel a rollout group on its worker no 5, 6, 7, 10
13 Run Verifiers groups in rollout workers no 7, 10, 12
14 Optional native rollout timeout no 7, 13

Results

Terminal-Bench RL runs on GB300, controller log
aiohttp.access lines    79-87% of lines (4 runs)
                        1.7-2.0M lines, 334-386 MB (the two longest runs)

py-spy --gil, controller thread, 120 s, 10-node SWE RL run
access log + logging    ~6-9% of samples

You may ask:

  • What about errors? Every response loses its access line, errors included. A GenerateFn exception still logs with logger.exception; other error responses reach the client, and failed rollouts log their reason.
  • Where is per-call timing? Each generate call still gets a generate span in the controller's structured log.

Test plan

pytest tests/rl/unit_tests/cpu/test_verifiers.py -k generation_server

test_generation_server_does_not_log_each_request fails on main. It pins the aiohttp.access logger at INFO, since aiohttp skips the line above INFO and the inherited level depends on imports.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 16, 2026
@felipemello1
felipemello1 force-pushed the felipemello1/genserver-no-access-log branch from b75b63c to 79adc15 Compare October 18, 2026 23:30
@felipemello1
felipemello1 changed the base branch from main to felipemello1/verifiers-release-sessions October 18, 2026 23:30
@felipemello1
felipemello1 added this pull request to stack #5513 October 18, 2026 23:32
@felipemello1
felipemello1 force-pushed the felipemello1/genserver-no-access-log branch from 79adc15 to 9e3f328 Compare October 19, 2026 01:15
Comment on lines +118 to +119
# aiohttp logs one INFO line per request: most of the controller's log lines.
runner = web.AppRunner(app, access_log=None)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets add a comment that rollotus still carry the log? Is this how other libraries manage their logs as well?

@felipemello1 felipemello1 changed the title [rl] Verifiers generation server: no per-request access log [rl] Verifiers generation server: no per-request access log (3/14) Oct 19, 2026
@felipemello1
felipemello1 force-pushed the felipemello1/genserver-no-access-log branch from 9e3f328 to 12e19f1 Compare October 22, 2026 23:31
@felipemello1

Copy link
Copy Markdown
Contributor Author

reply from claude: added the comment: the rollouts still carry each call's prompt and completion. Other servers have the same switch, e.g. vLLM's --disable-uvicorn-access-log. Here, the access lines were 79-87% of the controller's log lines in 4 Terminal-Bench runs.

@felipemello1
felipemello1 removed this pull request from stack #5513 October 27, 2026 14:27
@felipemello1
felipemello1 added this pull request to stack #5639 October 27, 2026 14:33
@felipemello1
felipemello1 force-pushed the felipemello1/genserver-no-access-log branch from c9dede1 to 3ae063d Compare November 5, 2026 00:34
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude review

@claude

claude Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 53s —— View job


Approve, see the review.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Approve -- one aiohttp kwarg removes a measured log/CPU cost on the controller, and the change is confined to the Verifiers example.

What this PR does. GenerationServer.start() builds its web.AppRunner with access_log=None, so aiohttp's RequestHandler gets no access logger and emits no aiohttp.access line per request. A CPU test starts the server, hits /healthz with aiohttp.access pinned at INFO, and checks that no access record shows up.

Example.

Rollout makes N calls to POST /inference/v1/generate
before: N lines like  INFO aiohttp.access: 127.0.0.1 "POST /inference/v1/generate HTTP/1.1" 200 ...
        (79-87% of controller log lines, ~6-9% of controller-thread samples)
after:  0 such lines; a GenerateFn exception still goes through logger.exception,
        and each call still gets its `generate` span in the structured log
Details
  • Gate: the problem is measured (line counts across 4 runs, py-spy samples), the fix is at the layer that owns it (the server construction), and it adds no knob. aiohttp has no setting that is smaller than this.
  • Maintainer comment (felipemello1, generation_server.py:118): asked for a comment saying the rollouts still carry the data. Addressed at HEAD, lines 118-119.
  • Test value: it is cheap (CPU, loopback only) and guards a regression nothing else would surface, e.g. losing the kwarg when PR 9 moves this file into torchtitan/rl/generator. Pinning aiohttp.access at INFO is needed because aiohttp skips building the access line when the logger isn't enabled for INFO, so without the pin the test could pass on main.
  • Scope: two files, no unrelated changes.

Not verified: I couldn't run the tests in this environment (permission denied); the reasoning above comes from reading the code.

@felipemello1
felipemello1 marked this pull request as ready for review November 5, 2026 05:34
@pytorch-bot pytorch-bot Bot added the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Nov 5, 2026
@github-actions
github-actions Bot requested a review from pzhan9 November 5, 2026 05:34
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: per Felipe, the access log is now at DEBUG instead of off (227cab6, 61902f7). _DebugAccessLogger logs one line per request on aiohttp.access, e.g. GET /inference/v1/generate 200 0.412s session=<trace id>. At the default INFO level, aiohttp sees the logger is off and skips the timing and the log call, so the cost is the same as access_log=None. To see the lines, run with TITAN_LOG_LEVEL=DEBUG (aiohttp checks the level once per connection, so set it before the server starts).

Base automatically changed from felipemello1/verifiers-release-sessions to main November 5, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/fake-pg Run 1-GPU Fake PG integration tests ciflow/rl CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants