-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Fix hipify script for pytorch extensions #43528
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 hipify script for pytorch extensions #43528
Conversation
💊 CI failures summary and remediationsAs of commit 1f05579 (more details on the Dr. CI page):
ci.pytorch.org: 1 failedThis comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group. This comment has been revised 3 times. |
|
@jeffdaily please let me know if it looks good to you and I'll land |
|
@ashishfarmer Can you please review the changes in this PR? |
|
cc @lcskrishna |
|
The changes look good. I am going to run a test with torchvision to see how this change impacts hipification there, and will comment back here |
|
Torchvision builds well with the changes here. |
|
Is it ready for merge? |
|
Yes, thank you. |
facebook-github-bot
left a comment
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.
@ngimel has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
PyTorch extensions can have .cpp or .h files which contain CUDA code that needs to be hipified. The current hipify script logic has overly strict conditions to determine which files get considered for hipification: https://github.com/pytorch/pytorch/blob/master/torch/utils/hipify/hipify_python.py#L146
These conditions might apply well to pytorch/caffe2 source code, but are overconstrained for third-party extensions.
is_pytorch_fileconditions: https://github.com/pytorch/pytorch/blob/master/torch/utils/hipify/hipify_python.py#L549is_caffe2_gpu_fileconditions: https://github.com/pytorch/pytorch/blob/master/torch/utils/hipify/hipify_python.py#L561This PR relaxes these conditions if we're hipifying a pytorch extension (specified by
is_pytorch_extension=True) and considers all the file extensions specified using theextensionsparameter: https://github.com/pytorch/pytorch/blob/master/torch/utils/hipify/hipify_python.py#L820