Skip to content

Add Qwen3.8 support and testing - #6764

Open
qgallouedec wants to merge 1 commit into
mainfrom
add-qwen3-8
Open

Add Qwen3.8 support and testing#6764
qgallouedec wants to merge 1 commit into
mainfrom
add-qwen3-8

Conversation

@qgallouedec

@qgallouedec qgallouedec commented Aug 14, 2026

Copy link
Copy Markdown
Member

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_5ForConditionalGeneration architecture, so no transformers gate beyond the Qwen3.5 floor.

  • Tiny model script qwen3_8_for_conditional_generation.py, mirroring the Qwen3.5 script (same layer_types / full_attention_interval workaround, same vision depth / num_heads keys), pinned to transformers==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.
  • Vendored qwen3_8.jinja + qwen3_8_training.jinja. The template is new: it adds a reasoning_effort flag (xhigh default / medium / low) that prepends a reasoning-effort instruction to the system prompt, and defaults preserve_thinking to enabled. Tool calls keep the Qwen3.5 Hermes-style syntax, so it reuses qwen3_5_schema / qwen3_5_template.
  • Test params next to Qwen3.6 in test_chat_template_utils.py (4 lists) and test_data_utils.py. Trainer tests keep the existing Qwen3.5 models as the architecture representatives.
  • Tiny model pushed: 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 with reasoning_effort system instructions and default preserve_thinking) and qwen3_8_training.jinja (always emits thinking blocks for prefix-preservation; wraps assistant output in {% generation %} markers). chat_template_utils maps the stock template to existing qwen3_5_schema for tool response parsing and returns the training template from get_training_chat_template.

Includes a tiny VLM hub script (qwen3_8_for_conditional_generation.py) for trl-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.

@bot-ci-comment

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant