-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Add ability to enable/disable MIOpen at runtime #33118
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 ability to enable/disable MIOpen at runtime #33118
Conversation
|
cc @iotamudelta |
|
A high level question... unlike most of the hipified source code, miopen has bindings directly written (not generated by hipification). So, by analogy, shouldn't it have its own backends file, |
|
@ezyang thanks for looking at this. Also, I think this is a legitimate and very good question. As you know, the frontend in PyTorch (i.e., the Python layer) assumes Now, you are absolutely right that MIOpen's interface and feature set is somewhat different from cuDNN, so there is no perfect 1:1 mapping. I think this is also somewhat reflected in this PR, some things we support on ROCm, some things we don't (yet?). Ultimately, I believe both choices (MIOpen == cuDNN or MIOpen != cuDNN) are valid from an engineering PoV and at least for me there is no clear winner. So, what do you think? :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of allowing user to enable/disable miopen at runtime. And the interface for it should be cudnn, since at python level, we want user code to be able to "magically" switch to use AMD gpus without any code changes.
|
@bddppq Please address my responses to let me know which changes I need to make. |
|
I'm gonna let bddppq shepherd this one through |
💊 CircleCI build failures summary and remediationsAs of commit f4894cd:
Detailed failure analysisOne may explore the probable reasons each build failed interactively on the Dr. CI website. 🕵️ 1 new failure recognized by patternsThe following build failures do not appear to be due to upstream breakage:
|
… cudnn APIs: they'll error out anyway when running on HIP/MIOpen build
…ng to stderr if user tries to set it to False and override value to True.
f7993d5 to
f305976
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good now. Thanks for your patience to address all the review comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bddppq has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bddppq has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: 1. Set `torch._C.has_cudnn` to `True` for ROCm 2. Make MIOpen invocations respect value of `cudnn_enabled` or `at::globalContext().userEnabledCuDNN()` 3. `torch/backends/cudnn/__init__.py`: Add hip-specific changes (use "hide whitespace changes" option to view simpler diff) Pull Request resolved: pytorch#33118 Differential Revision: D19977719 Pulled By: bddppq fbshipit-source-id: 64d4dd1d78afcf96201360d85b8be5950f96dfad
torch._C.has_cudnntoTruefor ROCmcudnn_enabledorat::globalContext().userEnabledCuDNN()torch/backends/cudnn/__init__.py: Add hip-specific changes (use "hide whitespace changes" option to view simpler diff)