[rl] Pin renderers 0.1.11, render with TorchTitan's tokenizer, forward renderer knobs strictly - #42
Open
felipemello1 wants to merge 1 commit into
Open
[rl] Pin renderers 0.1.11, render with TorchTitan's tokenizer, forward renderer knobs strictly#42felipemello1 wants to merge 1 commit into
felipemello1 wants to merge 1 commit into
Conversation
felipemello1
force-pushed
the
80-renderers
branch
5 times, most recently
from
September 2, 2026 18:43
fe27112 to
622e324
Compare
…enderer options through renderers 0.1.11 makes transformers optional and accepts a bring-your-own tokenizer, so RendererConfig.build now takes TorchTitan's HuggingFaceTokenizer (wrapped in RendererTokenizer to satisfy renderers.OffsetTokenizer) instead of loading transformers.AutoTokenizer. The controller reads pad_id off its own tokenizer instead of renderer._tokenizer. RendererConfig is now `name` + `options`: the options dict is passed unchanged to the renderer's typed pydantic config, which rejects options that renderer does not have (extra="forbid") instead of TorchTitan silently dropping them (pytorch#4365). TorchTitan no longer mirrors renderer fields; the removed preserve_* knobs and the DefaultRenderer-only tool_parser/reasoning_parser are gone, and renderer names are the library's names (_RENDERER_BY_MODEL removed). Recipes move to options={...}; the gpt-oss alphabet-sort recipe, whose enable_thinking=False was being dropped, now sets reasoning_effort="low". Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
felipemello1
force-pushed
the
80-renderers
branch
from
September 2, 2026 18:44
622e324 to
21bf554
Compare
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
renderers==0.1.11(first release with bring-your-own-tokenizer; transformers is now an optional extra we do not install) instead of trackinggit+...@main.HuggingFaceTokenizer:RendererConfig.build(tokenizer=...)wraps it inRendererTokenizer(therenderers.OffsetTokenizerprotocol) instead of loadingtransformers.AutoTokenizer. The controller readspad_idoff its own tokenizer instead ofrenderer._tokenizer.RendererConfigis nowname+options: the options dict is passed unchanged to the renderer's typed pydantic config, which rejects options that renderer does not have (extra="forbid") instead of TorchTitan silently dropping them ([rl] RendererConfig silently drops the removed preserve_* renderer knobs pytorch/torchtitan#4365). TorchTitan mirrors no renderer fields; renderer names are the library's names.Why
requirements.txttracked renderersmain. renderers#88 replacedpreserve_all_thinking/preserve_thinking_between_tool_callswiththinking_retention; ourbuild()filtered knobs byfield.name in config_type.model_fields, so both became inert with no failing test (pytorch#4365). Two in-tree configs were already hitting the same silent drop:RendererConfig(name="gpt_oss", enable_thinking=False)(gpt-oss has noenable_thinking) andRendererConfig(name="muse_glimmer", enable_thinking=True).renderers 0.1.11 ships the BYO-tokenizer protocol we were waiting on (
TODO(renderers#70)inrenderer.pyandcontroller.py), so thetransformersimport and therenderer._tokenizerreach-in can go.Previous behavior
New behavior
RendererConfigfields:name: str(library renderer name:qwen3,gpt-oss,llama-3,deepseek-v3, or in-treemuse_glimmer) andoptions: dict[str, Any], passed through to that renderer's config; the renderers docs list each renderer's options. Removed: the mirrored fields (enable_thinking,tool_parser,reasoning_parser,preserve_*), and the_RENDERER_BY_MODELmap (gpt_oss->gpt-ossis the only name that changes). Recipes move tooptions={...}. CLI override of renderer options is not supported (tyro cannot add dict keys); the 8 redundant--renderer.enable-thinking Falseflags intests/integration_tests.pyare deleted (their recipes already set it)."auto"was never useful here: renderers resolves it by exact match oftokenizer.name_or_pathagainstMODEL_RENDERER_MAP, andhf_assets_pathis a local directory, so it always fell back toDefaultRenderer.Validation
tests/test_renderer.py(new, 12 tests): strict forwarding, unsupported-knob and unknown-name errors,auto/defaultrefusal, union round-trip,RendererTokenizerprotocol conformance, and byte-identical parity (token ids,is_content,sampled_mask,message_indices) betweenRendererTokenizerandtransformers.AutoTokenizerunderQwen3Renderer. 168 tests pass across the touched RL test files. The same parity also holds on the real Qwen3-0.6B tokenizer with tools,parse_response,bridge_to_next_turn, and stop ids (offline probe).grep -rn "transformers" torchtitan/experiments/rl --include='*.py' | grep importnow only matches the vLLM registry.Review focus
RendererTokenizer(wraps thetokenizers.Tokenizerbackend as_tokenizer_backend):encodenever adds BOS/EOS (TorchTitan'sencodewould, peradd_bosdefaults);unk_token_id = Nonebecause thetokenizersbackend returnsNonefor unknown tokens;__call__returnsoffset_mappingsois_contentstays precise.to_renderers_config()as a separate method: PR [rl] Add optional Verifiers rollout integration pytorch/torchtitan#4356 needs the config-only seam (verifiers builds its own renderer in the env process from the typed config).enable_thinking=Falsewas silently dropped before (gpt-oss has no such option and always has an analysis channel), so it ran atreasoning_effort="medium". It now setsoptions={"reasoning_effort": "low"}, the closest expression of the recipe's intent; this is a behavior change. Muse Glimmer'senable_thinking=Truewas also dropped; Muse always renders reasoning by default, so nothing replaces it.test_alphabet_sort/test_rollout_workernow pass the repo's debug tokenizer (tests/assets/tokenizer) because the worker opens a real tokenizer.Rebase notes for PR pytorch#4356
Those files only exist in pytorch#4356, so they are edited there when it rebases onto this PR.
as_renderers_config()->to_renderers_config()inexamples/verifiers/components/rollouter.pyandtests/test_verifiers_example.py;RendererConfig(name="qwen3", enable_thinking=True)->options={"enable_thinking": True}inexamples/verifiers/config_registry.py.renderers[transformers]==0.1.11toexamples/verifiers/requirements.txt: verifiers 0.3.0 callsrenderers.base.load_tokenizer, which needs transformers.TrainClientConfig(renderer=..., renderer_model_name=...)round-trip vsRendererConfig.build).MuseGlimmerRendererConfigis not a member of therenderers.RendererConfigunion, so the verifiers path cannot carry it yet.Risks / open questions
qwen3-vl) rendering needsrenderers[multimodal]and an HF processor; no RL config uses it, unchanged by this PR.🤖 Generated with Claude Code