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

torch.autograd.profiler.profile() keyword argument #364

Merged
merged 1 commit into from
Feb 3, 2021
Merged

torch.autograd.profiler.profile() keyword argument #364

merged 1 commit into from
Feb 3, 2021

Conversation

dbonner
Copy link
Contributor

@dbonner dbonner commented Feb 1, 2021

torch.autograd.profiler.profile() will not take 3 positional argumens (self, False, True) when enabled=False with the latest change to PyTorch source code.
This means that:
bpslaunch python benchmark_byteps.py --fp16-pushpull
fails with:
with torch.autograd.profiler.profile(False, True) as prof:
TypeError: init() takes from 1 to 2 positional arguments but 3 were given
To fix this:
Use keyword arguments (enabled=enable_profiling, use_cuda=True)

torch.autograd.profiler.profile() will not take 3 positional argumens (self, False, True) when enabled=False with the latest change to PyTorch source code.
This means that:
bpslaunch python benchmark_byteps.py --fp16-pushpull
fails with:
with torch.autograd.profiler.profile(False, True) as prof:                                                                               
TypeError: __init__() takes from 1 to 2 positional arguments but 3 were given
To fix this:
Use keyword arguments (enabled=enable_profiling, use_cuda=True)
@pleasantrabbit pleasantrabbit merged commit d30bb1c into bytedance:master Feb 3, 2021
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