[megatron] Add extra args and provider support for easily customize megatron #4240
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.
PR type
PR information
CN
我们正在使用swift训练一个具有自定义架构的LLM,现在通过MegatronModelMeta,我们可以使用我们自定义的model_provider,但是还有一部分数据无法通过参数传入provider。为了加入这些参数我们需要同时修改megatron和swift中的argument,因此我们添加了自定义参数的功能。
核心改动如下:
ENG
We are training a model with some custom arch modify. With MegatronModelMeta we can use our customized model_provider, but there is still a part of the data that can't be passed into the provider via arguments. in order to add these arguments we need to modify the arguments in megatron and swift at the same time, so we added the ability to customize the arguments.
The core changes are as follows:
Translated with DeepL.com (free version)
示例:
Experiment results
Paste your experiment result here(if needed).