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

fix: make a seed respect to distributed settings #60

Merged
merged 3 commits into from
Apr 10, 2021
Merged

Conversation

ydcjeff
Copy link
Member

@ydcjeff ydcjeff commented Apr 10, 2021

fix #61

  • Make a seed according to rank
  • Download datasets only on rank 0

@ydcjeff ydcjeff added bug Something isn't working templates labels Apr 10, 2021
@ydcjeff ydcjeff added this to In progress in v0.1.0 via automation Apr 10, 2021
@ydcjeff ydcjeff added this to the v0.1.0 milestone Apr 10, 2021
@ydcjeff ydcjeff requested a review from vfdev-5 April 10, 2021 07:17
@ydcjeff ydcjeff changed the title fix: make a seed in run fix: make a seed respect to distributed settings Apr 10, 2021
@ydcjeff ydcjeff merged commit b17397b into master Apr 10, 2021
v0.1.0 automation moved this from In progress to Done Apr 10, 2021
@ydcjeff ydcjeff deleted the fix/manual-seed branch April 10, 2021 14:58
Comment on lines +43 to +45
if rank > 0:
# Ensure that only rank 0 download the dataset
idist.barrier()
Copy link
Member

Choose a reason for hiding this comment

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

Sorry for delay with the review @ydcjeff . Maybe we could hide these barriers inside get_datasets. I also realized that here it should be local_rank == 0 and not rank == 0 as in case multi-node case the application wont download the data for other nodes.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK! Then Ignite examples need a fix too

Copy link
Member

Choose a reason for hiding this comment

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

I see, that can be possible. Thanks for pointing out! Can you please open an issue and someone could fix it.

Comment on lines +204 to +210
if rank == 0:
if isinstance(logger_handler, WandBLogger):
# why handle differently for wandb ?
# See : https://github.com/pytorch/ignite/issues/1894
logger_handler.finish()
elif logger_handler:
logger_handler.close()
Copy link
Member

Choose a reason for hiding this comment

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

Maybe, we can say that the code generator aims ignite nightly version and it will be also in the stable version ?

Copy link
Member Author

Choose a reason for hiding this comment

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

We are currently testing with ignite v0.4.4, we will update that once there is a new release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working templates
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

datasets are downloading twice in distributed settings
2 participants