Skip to content

Commit 5d9cbdf

Browse files
authored
fix(pt): remove meaningless error raising (#5411)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Enhanced distributed training configuration handling to automatically adjust advanced optimization settings when they're enabled without proper distributed training setup, allowing training to proceed instead of failing. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 1a1dc59 commit 5d9cbdf

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

deepmd/pt/train/training.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,7 @@ def __init__(
183183
f"training.zero_stage must be 0, 1, 2, or 3, got {self.zero_stage}"
184184
)
185185
if self.zero_stage > 0 and not self.is_distributed:
186-
raise ValueError(
187-
"training.zero_stage requires distributed launch via torchrun."
188-
)
186+
self.zero_stage = 0
189187
if self.zero_stage > 0 and self.change_bias_after_training:
190188
raise ValueError(
191189
"training.zero_stage does not support change_bias_after_training."

0 commit comments

Comments
 (0)