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

add a check to determine if horovod.torch import succeeds #604

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zaoliu-aws
Copy link
Contributor

import horovod.torch does not raise exception even if it is not fully successful. Add init() function to catch it.

try:
import horovod.torch as hvd

# This redundant import is necessary because horovod does not raise an ImportError if the library is not present
import torch # noqa
#make sure the library is correctly imported
hvd.init()
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know if this could interfer with other distribution strategies? I'm worried running init on horovod might cause a problem if the user is running SMDDP or DDP.

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.

2 participants