[megatron] support bailing_v25 megatron#9442
Conversation
There was a problem hiding this comment.
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.
|
/gemini review |
There was a problem hiding this comment.
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.
| mg_inputs = to_device( | ||
| template.data_collator([inputs] * (2 if args.padding_free else 1), padding_to=get_padding_to(args)), 'cuda') |
There was a problem hiding this comment.
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.
| 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') |
| |[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)| |
There was a problem hiding this comment.
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.
| |[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)| |
| |[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)| |
There was a problem hiding this comment.
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.
| |[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)| |
modelscope/mcore-bridge#85