Skip to content

Update cookbok to qwen35#98

Merged
tastelikefeet merged 5 commits intomodelscope:mainfrom
tastelikefeet:feat/update_cookbok_to_qwen35
Mar 3, 2026
Merged

Update cookbok to qwen35#98
tastelikefeet merged 5 commits intomodelscope:mainfrom
tastelikefeet:feat/update_cookbok_to_qwen35

Conversation

@tastelikefeet
Copy link
Collaborator

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

Write the detail information belongs to this PR.

Experiment results

Paste your experiment result here(if needed).

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates the Qwen3.5 series of large language models into the system, expanding the range of supported models. The changes involve updating model identifiers in various scripts and configuration files, alongside specific code adjustments in the Megatron model bridge to properly handle the architecture of Qwen3.5 models. The documentation has also been revised to reflect these new additions and provide up-to-date examples.

Highlights

  • Qwen3.5 Model Support: Introduced comprehensive support for the Qwen3.5 series of large language models, including both base and Mixture-of-Experts (MoE) variants.
  • Configuration Updates: Updated numerous configuration files and Python scripts across the cookbook and documentation to reference 'Qwen3.5-4B' instead of 'Qwen3-4B' as the default or example model ID.
  • Megatron Model Bridge Enhancements: Modified the Megatron model bridge to include specific handling for Qwen3.5 models, ensuring correct layer normalization and linear layer configurations.
  • Documentation Refresh: Updated both English and Chinese READMEs and usage guides to reflect the new Qwen3.5 model support and removed the detailed supported model list from quick start guides.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • README.md
    • Updated model table to include Qwen3.5 series and Qwen3.5 MoE series.
    • Updated base model reference in the train function example.
  • README_ZH.md
    • Updated model table to include Qwen3.5 series and Qwen3.5 MoE series.
    • Updated base model reference in the train function example.
  • cookbook/client/tinker/custom_service/lora.py
    • Updated base_model variable from 'Qwen/Qwen3-4B' to 'Qwen/Qwen3.5-4B'.
  • cookbook/client/tinker/custom_service/megatron/server_config.yaml
    • Updated supported model ID from 'Qwen/Qwen3-4B' to 'Qwen/Qwen3.5-4B'.
    • Updated route prefix and model ID for the 'models-Qwen3-4B' service.
    • Updated route prefix and model ID for the 'sampler-Qwen3-4B' service.
  • cookbook/client/tinker/custom_service/sample.py
    • Updated base_model variable from 'Qwen/Qwen3-4B' to 'Qwen/Qwen3.5-4B'.
  • cookbook/client/tinker/custom_service/self_cognition.py
    • Updated base_model variable from 'Qwen/Qwen3-4B' to 'Qwen/Qwen3.5-4B'.
  • cookbook/client/tinker/custom_service/short_math_grpo.py
    • Updated BASE_MODEL variable from 'Qwen/Qwen3-4B' to 'Qwen/Qwen3.5-4B'.
  • cookbook/client/tinker/custom_service/transformer/server_config.yaml
    • Updated supported model ID from 'Qwen/Qwen3-4B' to 'Qwen/Qwen3.5-4B'.
    • Updated route prefix and model ID for the 'models-Qwen3-4B' service.
    • Updated route prefix and model ID for the 'sampler-Qwen3-4B' service.
  • cookbook/client/twinkle/grpo.py
    • Updated MODEL_ID variable from 'ms://Qwen/Qwen3-4B' to 'ms://Qwen/Qwen3.5-4B'.
  • cookbook/client/twinkle/megatron/server_config.yaml
    • Updated route prefix and model ID for the 'models-Qwen3-4B' service.
  • cookbook/client/twinkle/sample.py
    • Updated MODEL_ID variable from 'Qwen/Qwen3-4B' to 'Qwen/Qwen3.5-4B'.
  • cookbook/client/twinkle/self_congnition.py
    • Updated model_id in dataset.set_template from 'ms://Qwen/Qwen3-4B' to 'ms://Qwen/Qwen3.5-4B'.
    • Updated model_id in MultiLoraTransformersModel initialization from 'ms://Qwen/Qwen3-4B' to 'ms://Qwen/Qwen3.5-4B'.
  • cookbook/client/twinkle/transformer/server_config.yaml
    • Updated route prefix and model ID for the 'models-Qwen3-4B' service.
    • Updated route prefix and model ID for the 'sampler-Qwen3-4B' service.
  • cookbook/megatron/tp.py
    • Modified device_mesh configuration by changing dp_size and removing cp_size.
    • Updated model_id in dataset.set_template from 'ms://Qwen/Qwen3-4B' to 'ms://Qwen/Qwen3.5-4B'.
    • Updated model_id in MegatronModel initialization from 'ms://Qwen/Qwen3-4B' to 'ms://Qwen/Qwen3.5-4B'.
  • cookbook/ray/single_controller.py
    • Updated model_id in dataset.set_template from 'ms://Qwen/Qwen3-4B' to 'ms://Qwen/Qwen3.5-4B'.
    • Updated model_id in TransformersModel initialization from 'ms://Qwen/Qwen3-4B' to 'ms://Qwen/Qwen3.5-4B'.
  • cookbook/rl/grpo.py
    • Updated default MODEL_ID environment variable to 'ms://Qwen/Qwen3.5-4B'.
    • Updated default USE_MEGATRON environment variable to '0'.
  • cookbook/transformers/fsdp2.py
    • Updated model_id in dataset.set_template from 'ms://Qwen/Qwen3-4B' to 'ms://Qwen/Qwen3.5-4B'.
    • Updated model_id in TransformersModel initialization from 'ms://Qwen/Qwen3-4B' to 'ms://Qwen/Qwen3.5-4B'.
    • Added _no_split_modules for Qwen3_5DecoderLayer to the model.
  • cookbook/transformers/sp_fsdp_dense.py
    • Updated MODEL_ID variable from 'ms://Qwen/Qwen3-4B' to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_en/Components/Advantage/GRPOAdvantage.md
    • Updated model_id for TransformersModel and vLLMSampler to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_en/Components/Advantage/RLOOAdvantage.md
    • Updated model_id for TransformersModel and vLLMSampler to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_en/Components/Data Format/Sampling.md
    • Updated model_id for vLLMSampler to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_en/Components/Dataset/Dataset.md
    • Updated model_id in dataset.set_template example to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_en/Components/Model/MegatronModel.md
    • Updated model_id for MegatronModel to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_en/Components/Model/TransformersModel.md
    • Updated model_id for TransformersModel to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_en/Components/Reward/Reward.md
    • Updated model_id for vLLMSampler to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_en/Components/Sampler/TorchSampler.md
    • Updated model_id for TorchSampler to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_en/Components/Sampler/vLLMSampler.md
    • Updated model_id for vLLMSampler in multiple examples to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_en/Usage Guide/Quick-Start.md
    • Updated model_id in dataset.set_template and TransformersModel initialization in several examples to 'ms://Qwen/Qwen3.5-4B'.
    • Removed the 'Supported Large Language Models List' section.
  • docs/source_zh/使用指引/快速开始.md
    • Updated model_id in dataset.set_template and TransformersModel initialization in several examples to 'ms://Qwen/Qwen3.5-4B'.
    • Removed the '支持的大语言模型列表' section.
  • docs/source_zh/组件/优势/GRPOAdvantage.md
    • Updated model_id for TransformersModel and vLLMSampler to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_zh/组件/优势/RLOOAdvantage.md
    • Updated model_id for TransformersModel and vLLMSampler to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_zh/组件/奖励/Reward.md
    • Updated model_id for vLLMSampler to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_zh/组件/数据格式/Sampling.md
    • Updated model_id for vLLMSampler to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_zh/组件/数据集/Dataset.md
    • Updated model_id in dataset.set_template example to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_zh/组件/模型/MegatronModel.md
    • Updated model_id for MegatronModel to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_zh/组件/模型/TransformersModel.md
    • Updated model_id for TransformersModel to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_zh/组件/采样器/TorchSampler.md
    • Updated model_id for TorchSampler to 'ms://Qwen/Qwen3.5-4B'.
  • docs/source_zh/组件/采样器/vLLMSampler.md
    • Updated model_id for vLLMSampler in multiple examples to 'ms://Qwen/Qwen3.5-4B'.
  • src/twinkle/model/megatron/model/constant.py
    • Added qwen3_5_moe to MLLMMegatronModelType enum.
  • src/twinkle/model/megatron/model/gpt_bridge.py
    • Added conditional logic to set pre_mlp_layernorm.weight specifically for qwen3_5 model type.
  • src/twinkle/model/megatron/model/gpts/qwen3_next.py
    • Added specific handling for qwen3_5 model type to replace linear_fc1 with TEColumnParallelLinear in MLP.
    • Added comments to clarify layernorm replacements.
  • src/twinkle/model/megatron/model/mm_gpts/qwen3_5.py
    • Refactored model registration to separate qwen3_5 and qwen3_5_moe types.
    • Used specific Qwen3_5ForConditionalGeneration and Qwen3_5MoeForConditionalGeneration for auto model classes.
  • src/twinkle/server/main.py
    • Updated default model-id in the quick start example to 'Qwen/Qwen3.5-4B'.
  • src/twinkle/server/twinkle/sampler.py
    • Updated model_id example in the docstring to 'Qwen/Qwen3.5-4B'.
Activity
  • The pull request was opened by tastelikefeet.
  • The pull request is categorized as a 'New Feature' and 'More Models or Datasets Support'.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the cookbook, documentation, and source code to use qwen3.5 models, replacing qwen3. The changes are largely consistent with this goal. I've identified a few areas for improvement, mainly around maintaining consistency in configuration files and documentation. There is also a change in default behavior in one of the scripts that should be made more explicit. Overall, the changes are good, but addressing these points will improve the quality and clarity of the codebase.

@tastelikefeet tastelikefeet merged commit c5ae409 into modelscope:main Mar 3, 2026
1 of 3 checks passed
tastelikefeet added a commit that referenced this pull request Mar 3, 2026
(cherry picked from commit c5ae409)
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.

2 participants