Skip to content

Commit

Permalink
friendly errors for issue pytorch#2207
Browse files Browse the repository at this point in the history
  • Loading branch information
DebarshiChanda committed Oct 2, 2021
1 parent eefd033 commit 41e9d8d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/contrib/cifar10/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ def run(
**spawn_kwargs: Other kwargs to spawn run in child processes: master_addr, master_port, node_rank, nnodes
"""
# raise error if num_warmup_epochs is less than num_epochs
assert num_epochs >= num_warmup_epochs, 'num_epochs is less than num_warmup_epochs, Consider increasing num_epochs aor decreasing num_warmup_epochs'

# catch all local parameters
config = locals()
config.update(config["spawn_kwargs"])
Expand Down
3 changes: 3 additions & 0 deletions examples/contrib/cifar10_qat/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ def run(
**spawn_kwargs: Other kwargs to spawn run in child processes: master_addr, master_port, node_rank, nnodes
"""
# raise error if num_warmup_epochs is less than num_epochs
assert num_epochs >= num_warmup_epochs, 'num_epochs is less than num_warmup_epochs, Consider increasing num_epochs aor decreasing num_warmup_epochs'

# catch all local parameters
config = locals()
config.update(config["spawn_kwargs"])
Expand Down
3 changes: 3 additions & 0 deletions examples/contrib/transformers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ def run(
with_amp (bool): if True, enables native automatic mixed precision. Default, False.
**spawn_kwargs: Other kwargs to spawn run in child processes: master_addr, master_port, node_rank, nnodes
"""
# raise error if num_warmup_epochs is less than num_epochs
assert num_epochs >= num_warmup_epochs, 'num_epochs is less than num_warmup_epochs, Consider increasing num_epochs aor decreasing num_warmup_epochs'

# catch all local parameters
config = locals()
config.update(config["spawn_kwargs"])
Expand Down

0 comments on commit 41e9d8d

Please sign in to comment.