Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用多卡训练报错 AssertionError: no_sync context manager is incompatible with gradient partitioning logic of ZeRO stage 2 #298

Open
lhhchanger opened this issue Nov 26, 2024 · 2 comments

Comments

@lhhchanger
Copy link

wandb: W&B syncing is set to offline in this directory.
wandb: Run wandb online or set WANDB_MODE=online to enable cloud syncing.
0%| | 0/27 [00:00<?, ?it/s]Traceback (most recent call last):
File "/data/new0530/DB-GPT-Hub/src/dbgpt-hub-sql/dbgpt_hub_sql/train/sft_train.py", line 164, in
train()
File "/data/new0530/DB-GPT-Hub/src/dbgpt-hub-sql/dbgpt_hub_sql/train/sft_train.py", line 141, in train
run_sft(
File "/data/new0530/DB-GPT-Hub/src/dbgpt-hub-sql/dbgpt_hub_sql/train/sft_train.py", line 94, in run_sft
train_result = trainer.train(
File "/data/datatxt/conda/envs/dbgpt_hub/lib/python3.10/site-packages/transformers/trainer.py", line 2123, in train
return inner_training_loop(
File "/data/datatxt/conda/envs/dbgpt_hub/lib/python3.10/site-packages/transformers/trainer.py", line 2480, in _inner_training_loop
with context():
File "/data/datatxt/conda/envs/dbgpt_hub/lib/python3.10/contextlib.py", line 135, in enter
return next(self.gen)
File "/data/datatxt/conda/envs/dbgpt_hub/lib/python3.10/site-packages/accelerate/accelerator.py", line 973, in no_sync
with context():
File "/data/datatxt/conda/envs/dbgpt_hub/lib/python3.10/contextlib.py", line 135, in enter
return next(self.gen)
File "/data/datatxt/conda/envs/dbgpt_hub/lib/python3.10/site-packages/deepspeed/runtime/engine.py", line 1995, in no_sync
assert not self.zero_optimization_partition_gradients(),
AssertionError: no_sync context manager is incompatible with gradient partitioning logic of ZeRO stage 2

@hychaochao
Copy link

遇到了同样的问题,请问解决了吗

@zruiii
Copy link

zruiii commented Jan 2, 2025

应该是 DeepSpeed 版本问题,我这边从 0.16 切换到 0.15.4 问题解决

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

No branches or pull requests

3 participants