refactor: replace bypass_render_with_parser with TinkerChatTemplateParser#489
Draft
listar2000 wants to merge 3 commits into
Draft
refactor: replace bypass_render_with_parser with TinkerChatTemplateParser#489listar2000 wants to merge 3 commits into
listar2000 wants to merge 3 commits into
Conversation
…rollout/ The experimental rollout engines (RolloutEngine, ModelOutput, TinkerEngine, VerlEngine, Completer, TITOCompleter, types) are now the canonical implementations in rllm/engine/rollout/. The experimental versions were strict supersets of the non-experimental ones, with additional support for TITO (token-in-token-out), weight version tracking, and training pipeline integration. Key changes: - Move all engine classes and types from rllm/experimental/rollout/ to rllm/engine/rollout/ (the canonical location) - Add backward-compat shim in rllm/experimental/rollout/__init__.py that re-exports from the canonical location with a DeprecationWarning - Update all 24+ consumer imports from rllm.experimental.rollout to rllm.engine.rollout - Standardize on .is_validation (not .validate) as the attribute name across all rollout engine consumers - OpenAIEngine and FireworksEngine remain in rllm/engine/rollout/ and inherit the enhanced base RolloutEngine automatically Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rser Introduce TinkerChatTemplateParser from the refactor-chat-parser branch, which wraps a tinker-cookbook Renderer as a ChatTemplateParser. This eliminates the dual-path bypass_render_with_parser flag on TinkerEngine: - TinkerEngine now always creates a TinkerChatTemplateParser(renderer) as its chat_parser, removing the conditional ChatTemplateParser vs raw-renderer branching in __init__, _get_model_response, and assemble_model_output - Remove bypass_render_with_parser parameter from TinkerEngine and all callers (configs, examples, tests, shell scripts) - Add TinkerChatTemplateParser to rllm/parser/ exports - Add test_tinker_parser.py with comprehensive parser tests The TinkerChatTemplateParser provides: - parse() for prompt string generation via the renderer - build_prompt() returning ModelInput (preserves image chunks for VLM) - parse_completion() for structured output extraction (content, reasoning, tool_calls) via renderer.parse_response() - tokenize_and_mask() / tokenize_and_mask_cumulative() for SFT training - Full tool calling support via renderer.create_conversation_prefix_with_tools Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
TinkerChatTemplateParser(rllm/parser/tinker_parser.py) wrapping tinker-cookbookRendereras aChatTemplateParserTinkerEngineto always useTinkerChatTemplateParser, removing thebypass_render_with_parserflag and all conditional branching_convert_openai_messages,_prepare_messages_with_tools,_parse_tinker_message) fromtinker_engine.pytest_tinker_parser.pybypass_render_with_parserfrom YAML configs and shell scriptsDepends on: #488 (first commit is shared — diff will clean up after #488 merges)
Test plan
pytest tests/engine/test_tinker_engine.py— 19 tests passpytest tests/parser/test_tinker_parser.py— 25 tests pass (14 existing + 11 new)🤖 Generated with Claude Code