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

Skip batch norm when chunk size is 1 in GhostBatchNorm #3119

Merged
merged 3 commits into from
Feb 22, 2023

Conversation

arnavgarg1
Copy link
Contributor

Causes the following error otherwise:

ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 6])

Copy link
Collaborator

@tgaddair tgaddair left a comment

Choose a reason for hiding this comment

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

Nice! Only other thing I might consider is logging a warning for each of the two cases where we skip the norm:

  • batch_size <= virtual_batch_size
  • batch_size % virtual_batch_size == 1

@arnavgarg1
Copy link
Contributor Author

Nice! Only other thing I might consider is logging a warning for each of the two cases where we skip the norm:

  • batch_size <= virtual_batch_size
  • batch_size % virtual_batch_size == 1

Added! Let me know if this makes sense

@github-actions
Copy link

Unit Test Results

         6 files  ±  0           6 suites  ±0   5h 51m 3s ⏱️ - 9m 46s
  3 968 tests +12    3 931 ✔️ +12    37 💤 ±0  0 ±0 
11 901 runs  +77  11 790 ✔️ +76  111 💤 +1  0 ±0 

Results for commit 9dc3b8a. ± Comparison against base commit c638c23.

@arnavgarg1 arnavgarg1 merged commit 0ff2825 into master Feb 22, 2023
@arnavgarg1 arnavgarg1 deleted the ghost_batch_norm branch February 22, 2023 19:17
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.

4 participants