Skip to content

Fix DDP normalization type check logic#1715

Open
Mr-Neutr0n wants to merge 1 commit intojunyanz:masterfrom
Mr-Neutr0n:fix-ddp-norm-check
Open

Fix DDP normalization type check logic#1715
Mr-Neutr0n wants to merge 1 commit intojunyanz:masterfrom
Mr-Neutr0n:fix-ddp-norm-check

Conversation

@Mr-Neutr0n
Copy link

Summary

  • Fix inverted condition in DDP normalization check
  • Correct 'inst' to 'instance' in error message

Problem

The current code raises an error when norm == 'syncbatch':

if self.opt.norm == "syncbatch":
    raise ValueError(...)

This is the opposite of the intended behavior. The code should raise an error when norm is NOT 'syncbatch' or 'instance'.

Solution

Changed the condition to:

if self.opt.norm != "syncbatch" and self.opt.norm != "instance":
    raise ValueError(...)

Also fixed the error message to reference 'instance' instead of 'inst' for clarity.

Test plan

  • Run DDP training with --norm syncbatch
  • Run DDP training with --norm instance
  • Verify error is raised for other norm types (e.g., 'batch')

Fixes #1709

The condition was checking if norm == 'syncbatch' and raising an error,
but it should raise an error when norm is NOT 'syncbatch' or 'instance'.

Also fixed the error message to say 'instance' instead of 'inst'.

Fixes junyanz#1709
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.

Minor typo bug when checking normalization choice for DDP training

1 participant