Skip to content

fix(train): initialize DeepSpeed mode from top-level config - #3471

Merged
LauraGPT merged 3 commits into
modelscope:mainfrom
YuCeong-May:fix/deepspeed-trainer-config
Aug 5, 2026
Merged

fix(train): initialize DeepSpeed mode from top-level config#3471
LauraGPT merged 3 commits into
modelscope:mainfrom
YuCeong-May:fix/deepspeed-trainer-config

Conversation

@YuCeong-May

Copy link
Copy Markdown
Contributor

Summary

Type of change

  • Bug fix
  • Documentation
  • Example or demo
  • Runtime or deployment
  • Benchmark or evaluation
  • Model/training change

Validation

  • python -m compileall funasr examples tests
  • Docs or links checked
  • Runtime/deployment command tested

User impact

Notes for reviewers

@LauraGPT LauraGPT left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for fixing the DeepSpeed mode propagation. There is one blocking compatibility issue before this can merge.

All current DeepSpeed training examples put both settings under train_conf, for example:

++train_conf.use_deepspeed=false
++train_conf.deepspeed_config=...

This patch also passes use_deepspeed= and deepspeed_config= explicitly and then expands **kwargs.get("train_conf"). Python therefore raises before entering Trainer:

TypeError: Trainer() got multiple values for keyword argument use_deepspeed

Please normalize the effective values once, with top-level values taking precedence and train_conf retained as a backwards-compatible fallback. Then pass a copied train_conf with the consumed distributed-mode keys removed, so use_ddp, use_fsdp, use_deepspeed, and deepspeed_config cannot be supplied twice.

Please also add focused regression coverage for:

  1. the existing nested train_conf form;
  2. the new top-level form overriding nested defaults;
  3. rejecting simultaneous FSDP and DeepSpeed.

compileall passes because this is a call-time configuration failure, so a behavioral test is needed.

@LauraGPT LauraGPT left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-reviewed head 241dea6. The blocking duplicate-key path is resolved.

Verified:

  • existing nested train_conf DeepSpeed settings remain supported
  • top-level values override nested defaults
  • consumed distributed keys are removed before Trainer receives **trainer_conf
  • FSDP plus DeepSpeed is rejected
  • DDP is disabled when either FSDP or DeepSpeed is selected
  • focused tests: 3 passed
  • additional precedence/invalid-combination matrix passed
  • py_compile and diff checks passed
  • synthetic merge with current main d410a56 is clean and limited to the intended two files

Approved.

@LauraGPT
LauraGPT merged commit 112b80f into modelscope:main Aug 5, 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