Add Qwen3.8 support and testing - #6764
Open
qgallouedec wants to merge 1 commit into
Open
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
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.
Released 2026-08-14: Qwen/Qwen3.8-27B the dense open-weights member of the Qwen3.8 family (+ an FP8 variant), reusing the existing
Qwen3_5ForConditionalGenerationarchitecture, so no transformers gate beyond the Qwen3.5 floor.qwen3_8_for_conditional_generation.py, mirroring the Qwen3.5 script (samelayer_types/full_attention_intervalworkaround, same visiondepth/num_headskeys), pinned totransformers==5.2.0. The checkpoint is all-bf16, so unlike Qwen3.5 no fp32 restore is needed. Config diff vs the reference is 11 entries, all scale-downs.qwen3_8.jinja+qwen3_8_training.jinja. The template is new: it adds areasoning_effortflag (xhighdefault /medium/low) that prepends a reasoning-effort instruction to the system prompt, and defaultspreserve_thinkingto enabled. Tool calls keep the Qwen3.5 Hermes-style syntax, so it reusesqwen3_5_schema/qwen3_5_template.test_chat_template_utils.py(4 lists) andtest_data_utils.py. Trainer tests keep the existing Qwen3.5 models as the architecture representatives.trl-internal-testing/tiny-Qwen3_5ForConditionalGeneration-3.8.Note
Low Risk
Additive support mirroring Qwen3.5/3.6; changes are limited to chat templating, docs, and test fixtures with no auth or data-handling impact.
Overview
Adds Qwen3.8 to TRL’s supported chat-template families so SFT (
assistant_only_loss) and GRPO (tool calls) can auto-swap training templates like other Qwen VL models.Vendors
qwen3_8.jinja(upstream-style template withreasoning_effortsystem instructions and defaultpreserve_thinking) andqwen3_8_training.jinja(always emits thinking blocks for prefix-preservation; wraps assistant output in{% generation %}markers).chat_template_utilsmaps the stock template to existingqwen3_5_schemafor tool response parsing and returns the training template fromget_training_chat_template.Includes a tiny VLM hub script (
qwen3_8_for_conditional_generation.py) fortrl-internal-testing/tiny-Qwen3_5ForConditionalGeneration-3.8, and extends chat-template / data-utils tests plus docs to cover Qwen3.8 alongside Qwen3.6.Reviewed by Cursor Bugbot for commit 2384046. Bugbot is set up for automated code reviews on this repo. Configure here.