Skip to content

[megatron] support bailing_v25 megatron#9442

Merged
Jintao-Huang merged 4 commits into
modelscope:mainfrom
Jintao-Huang:support_bailing_v25_megatron
May 28, 2026
Merged

[megatron] support bailing_v25 megatron#9442
Jintao-Huang merged 4 commits into
modelscope:mainfrom
Jintao-Huang:support_bailing_v25_megatron

Conversation

@Jintao-Huang

@Jintao-Huang Jintao-Huang commented May 28, 2026

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Contributor

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 supported models documentation in both Chinese and English. It adds three new MiniCPM5-1B models from OpenBMB and marks several Ling and Ring models from inclusionAI as supported. The reviewer noted a potential typo in the required transformers library version for the new MiniCPM5 models, suggesting it should be >=4.46 instead of >=5.6.

Comment thread docs/source/Instruction/Supported-models-and-datasets.md
Comment thread docs/source_en/Instruction/Supported-models-and-datasets.md
@Jintao-Huang

Copy link
Copy Markdown
Collaborator Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 adds support for MiniCPM5-1B models and updates the support status of several Ling and Ring models in the documentation. It also updates the Megatron conversion utility to handle padding-free arguments by duplicating inputs. Feedback highlights a potential issue in convert_utils.py where multiplying a list of mutable dictionaries ([inputs] * N) can lead to unintended side effects, suggesting the use of copy.deepcopy instead. Additionally, the documentation changes contain a typo specifying a non-existent transformers>=5.6 version, which should be corrected to a valid 4.x version.

Comment thread swift/megatron/utils/convert_utils.py Outdated
Comment on lines +234 to +235
mg_inputs = to_device(
template.data_collator([inputs] * (2 if args.padding_free else 1), padding_to=get_padding_to(args)), 'cuda')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Duplicating a list containing a mutable dictionary using [inputs] * N creates a list of references to the exact same dictionary object. If template.data_collator modifies the input dictionaries in-place (e.g., popping keys, adding padding, or converting lists to tensors in-place), this will lead to unexpected side effects, duplicate modifications, or runtime errors (such as KeyError when popping keys). To prevent this, use a list comprehension with copy.deepcopy(inputs) to ensure each element is a completely independent copy.

Suggested change
mg_inputs = to_device(
template.data_collator([inputs] * (2 if args.padding_free else 1), padding_to=get_padding_to(args)), 'cuda')
import copy
mg_inputs = to_device(
template.data_collator([copy.deepcopy(inputs) for _ in range(2 if args.padding_free else 1)], padding_to=get_padding_to(args)), 'cuda')

Comment on lines +356 to +358
|[OpenBMB/MiniCPM5-1B](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B)|llama|minicpm5|transformers>=5.6|✔|-|[openbmb/MiniCPM5-1B](https://huggingface.co/openbmb/MiniCPM5-1B)|
|[OpenBMB/MiniCPM5-1B-Base](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B-Base)|llama|minicpm5|transformers>=5.6|✔|-|[openbmb/MiniCPM5-1B-Base](https://huggingface.co/openbmb/MiniCPM5-1B-Base)|
|[OpenBMB/MiniCPM5-1B-SFT](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B-SFT)|llama|minicpm5|transformers>=5.6|✔|-|[openbmb/MiniCPM5-1B-SFT](https://huggingface.co/openbmb/MiniCPM5-1B-SFT)|

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The Hugging Face transformers library does not currently have a version 5.6 (the latest is in the 4.x range). This is likely a typo for transformers>=4.40 or similar. Please verify and correct the required version.

Suggested change
|[OpenBMB/MiniCPM5-1B](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B)|llama|minicpm5|transformers>=5.6|✔|-|[openbmb/MiniCPM5-1B](https://huggingface.co/openbmb/MiniCPM5-1B)|
|[OpenBMB/MiniCPM5-1B-Base](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B-Base)|llama|minicpm5|transformers>=5.6|✔|-|[openbmb/MiniCPM5-1B-Base](https://huggingface.co/openbmb/MiniCPM5-1B-Base)|
|[OpenBMB/MiniCPM5-1B-SFT](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B-SFT)|llama|minicpm5|transformers>=5.6|✔|-|[openbmb/MiniCPM5-1B-SFT](https://huggingface.co/openbmb/MiniCPM5-1B-SFT)|
|[OpenBMB/MiniCPM5-1B](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B)|llama|minicpm5|transformers>=4.40|✔|-|[openbmb/MiniCPM5-1B](https://huggingface.co/openbmb/MiniCPM5-1B)|
|[OpenBMB/MiniCPM5-1B-Base](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B-Base)|llama|minicpm5|transformers>=4.40|✔|-|[openbmb/MiniCPM5-1B-Base](https://huggingface.co/openbmb/MiniCPM5-1B-Base)|
|[OpenBMB/MiniCPM5-1B-SFT](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B-SFT)|llama|minicpm5|transformers>=4.40|✔|-|[openbmb/MiniCPM5-1B-SFT](https://huggingface.co/openbmb/MiniCPM5-1B-SFT)|

Comment on lines +357 to +359
|[OpenBMB/MiniCPM5-1B](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B)|llama|minicpm5|transformers>=5.6|✔|-|[openbmb/MiniCPM5-1B](https://huggingface.co/openbmb/MiniCPM5-1B)|
|[OpenBMB/MiniCPM5-1B-Base](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B-Base)|llama|minicpm5|transformers>=5.6|✔|-|[openbmb/MiniCPM5-1B-Base](https://huggingface.co/openbmb/MiniCPM5-1B-Base)|
|[OpenBMB/MiniCPM5-1B-SFT](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B-SFT)|llama|minicpm5|transformers>=5.6|✔|-|[openbmb/MiniCPM5-1B-SFT](https://huggingface.co/openbmb/MiniCPM5-1B-SFT)|

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The Hugging Face transformers library does not currently have a version 5.6 (the latest is in the 4.x range). This is likely a typo for transformers>=4.40 or similar. Please verify and correct the required version.

Suggested change
|[OpenBMB/MiniCPM5-1B](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B)|llama|minicpm5|transformers>=5.6|✔|-|[openbmb/MiniCPM5-1B](https://huggingface.co/openbmb/MiniCPM5-1B)|
|[OpenBMB/MiniCPM5-1B-Base](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B-Base)|llama|minicpm5|transformers>=5.6|✔|-|[openbmb/MiniCPM5-1B-Base](https://huggingface.co/openbmb/MiniCPM5-1B-Base)|
|[OpenBMB/MiniCPM5-1B-SFT](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B-SFT)|llama|minicpm5|transformers>=5.6|✔|-|[openbmb/MiniCPM5-1B-SFT](https://huggingface.co/openbmb/MiniCPM5-1B-SFT)|
|[OpenBMB/MiniCPM5-1B](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B)|llama|minicpm5|transformers>=4.40|✔|-|[openbmb/MiniCPM5-1B](https://huggingface.co/openbmb/MiniCPM5-1B)|
|[OpenBMB/MiniCPM5-1B-Base](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B-Base)|llama|minicpm5|transformers>=4.40|✔|-|[openbmb/MiniCPM5-1B-Base](https://huggingface.co/openbmb/MiniCPM5-1B-Base)|
|[OpenBMB/MiniCPM5-1B-SFT](https://modelscope.cn/models/OpenBMB/MiniCPM5-1B-SFT)|llama|minicpm5|transformers>=4.40|✔|-|[openbmb/MiniCPM5-1B-SFT](https://huggingface.co/openbmb/MiniCPM5-1B-SFT)|

@Jintao-Huang
Jintao-Huang merged commit 637e8da into modelscope:main May 28, 2026
1 of 3 checks passed
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