[codex] Fix train renderer pool cache#1889
Draft
xeophon wants to merge 1 commit into
Draft
Conversation
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
TrainClientrenderer pools by effective renderer model and serializedchat_template_kwargs.Root Cause
Commit
a8036b441/ PR #1876 threaded per-requestchat_template_kwargsintocreate_renderer_pool, butTrainClientstill cached a singleself._pool. The first request could therefore lock in one renderer pool and leak its chat-template settings into later requests with different kwargs or no kwargs.Impact
Training/eval paths using the v1 train renderer client can now safely mix requests with different chat-template options, such as Qwen thinking settings, without cross-request pool contamination.
Validation
uv run pytest tests/v1/test_train_client.pyuv run ruff check --fix verifiers/v1/clients/train.py tests/v1/test_train_client.pygit diff --checkNote: repo-wide
uv run ruff check --fixis currently blocked by an unrelated existing Python 3.11 f-string parse issue inverifiers/v1/cli/dashboard/eval.py:194. The pre-commit/pre-push hooks also reintroduced unrelateduv.lockexclude-newer churn, so the commit and push used the already-passing targeted checks while keepinguv.lockout of the PR.Note
Fix
TrainClient._renderer_poolto cache pools per model and chat template kwargs_poolattribute in train.py with a_poolsdict keyed by(renderer_model, serialized_chat_template_kwargs).enable_thinking) produce a new pool, and omitting kwargs produces a third pool.chat_template_kwargsdiffer.Macroscope summarized e8dce84.