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

allow for non-distributed envs (Windows) #531

Merged
merged 1 commit into from
Oct 9, 2019
Merged

allow for non-distributed envs (Windows) #531

merged 1 commit into from
Oct 9, 2019

Conversation

BramVanroy
Copy link
Contributor

closes #429

@mcarilli
Copy link
Contributor

mcarilli commented Oct 9, 2019

Looks good to me, thanks! Note that Windows is technically not officially supported...

@mcarilli mcarilli merged commit fab319f into NVIDIA:master Oct 9, 2019
@BramVanroy
Copy link
Contributor Author

Looks good to me, thanks! Note that Windows is technically not officially supported...

I am aware. Luckily I was able to build Apex on Windows 10 including all extensions (64bit, CUDA 10.1) and so the only thing stopping me from using it was this small issue. If I recall correctly, DDP will still not work on Windows (?), but at least AMP should work well out-of-the-box.

PS: credit where credit is due: I did nothing more than push the changes that @ptrblck made to the current head. His fork is here.

from .amp import init as amp_init

optimizers_was_list = False
if isinstance(optimizers, torch.optim.Optimizer) or isinstance(optimizers, LARC):
if isinstance(optimizers, torch.optim.Optimizer) or ('LARC' in sys.modules and isinstance(optimizers, LARC)):
Copy link

Choose a reason for hiding this comment

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

This line does not work in linux, because 'LARC' is always not in sys.modules. Please revert this commit.

>>> import sys
>>> import apex
>>> 'LARC' in sys.modules
False
>>> 'apex.parallel.LARC' in sys.modules
True

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, perhaps @ptrblck can comment on this. I am not sure what that change is supposed to signify. But from the looks of it, you're right that it should be 'apex.parallel.LARC' in sys.modules.

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.

AttributeError: module 'torch.distributed' has no attribute 'deprecated'
3 participants