Skip to content

Avoid overwriting AutoTP-related settings when using DeepSpeed ​​configuration files. - #9691

Merged
Jintao-Huang merged 2 commits into
modelscope:mainfrom
1787648106:Keep_autotp_config
Jul 7, 2026
Merged

Avoid overwriting AutoTP-related settings when using DeepSpeed ​​configuration files.#9691
Jintao-Huang merged 2 commits into
modelscope:mainfrom
1787648106:Keep_autotp_config

Conversation

@1787648106

@1787648106 1787648106 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

PR type

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

PR information

Avoid overwriting AutoTP-related settings when using DeepSpeed ​​configuration files.
For example, if partition_config is configured in the config file, it will be overridden if the --deepspeed_autotp_size argument is passed in the training script.

Experiment results

Paste your experiment result here(if needed).

@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 modifies the initialization of DeepSpeed configuration parameters in swift/arguments/sft_args.py. The reviewer identified a potential KeyError that could occur if the 'tensor_parallel' or 'zero_optimization' keys are not pre-defined in the self.deepspeed dictionary, and suggested using setdefault to safely initialize these keys and prevent runtime crashes.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread swift/arguments/sft_args.py Outdated
@1787648106

Copy link
Copy Markdown
Contributor Author

@hjh0119 Could you please take a look at this PR? Thanks!

@Jintao-Huang

Copy link
Copy Markdown
Collaborator

Please update based on Gemini's suggestions.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@1787648106

Copy link
Copy Markdown
Contributor Author

Please update based on Gemini's suggestions.

done

@Jintao-Huang
Jintao-Huang merged commit 05a66fa into modelscope:main Jul 7, 2026
2 of 3 checks passed
Jintao-Huang pushed a commit that referenced this pull request Jul 13, 2026
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