-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Adapt Dynamo Tests to HPUs #145476
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
Adapt Dynamo Tests to HPUs #145476
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/145476
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 8e48628 with merge base 53fc921 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@ankurneog , @EikanWang : please review |
|
@cpuhrsch , @EikanWang : Could you review this ? |
|
@cpuhrsch , @EikanWang : Please review |
EikanWang
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.
LGTM
|
@yanboliang , may I know if you have any comments on this PR? cc @albanD |
|
Looks good to me, please fix the test failures. |
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Rebase failed due to Command |
Revert test/dynamo/test_functions.py to original due to CI issues. Will be fixing them in another PR.
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Rebase failed due to Command |
|
@EikanWang , @yanboliang : Since test_functions.py was causing CI issues, I have reverted that file to its current merged version. Will be raising a separate PR for test_functions.py later. Would be helpful if you could reinitiate the CI tests and merge |
|
@yanboliang , @guangyey : Could you help in the review and merge of this PR? |
| return operator.truth(x) and bool(y) | ||
|
|
||
| opt_fn = torch.compile(fullgraph=True, dynamic=False)(fn) | ||
| opt_fn = torch.compile(dynamic=False)(fn) |
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.
Why fullgraph is removed?
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.
@guangyey : Initially, we had two files in this PR . test_functions.py and test_misc.py. test_functions.py was causing CI issues - We have identified why and trying to fix that . In the meanwhile, decided to go ahead with just test_misc.py in this PR . Had reverted test_functions.py to the current merged version . So, this change ( removing fullgraph) might have come from some other PR.
If this is causing confusion, I can delete this PR and create a new one with just test_misc.py. Let me know , if you think that is a better approach.
| opt_fn = torch.compile(fn, backend="eager", fullgraph=True) | ||
| self.assertEqual(fn(torch.ones(3, 3)), opt_fn(torch.ones(3, 3))) | ||
|
|
||
| @unittest.skip("https://github.com/pytorch/pytorch/pull/146527 exposed a bug") |
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.
If this PR does not introduce this bug, we should not skip the UT in this PR.
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.
@guangyey : Replied above in the previous comment .
|
Does this PR need rebasing? There are many changes which are not related to this PR. |
|
|
||
| self.assertEqual(fn(inputs, x), opt_fn(inputs, x)) | ||
|
|
||
| def test_udf_tuple(self): |
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.
Does this require a rebase?
|
Closing this PR. Will be creating a new one with test_misc.py. |
This PR is related to #145476 . That PR had two files (test_functions.py and test_misc.py) . test_functions was causing CI/rebase/merge issues and hence removed for now. This PR contains only test_misc.py. This is a continuation of #144387 . ## MOTIVATION We recently integrated support for Intel Gaudi devices (identified as 'hpu') into the common_device_type framework via the pull request at #126970. This integration allows tests to be automatically instantiated for Gaudi devices upon loading the relevant library. Building on this development, the current pull request extends the utility of these hooks by adapting selected CUDA tests to operate on Gaudi devices. Additionally, we have confirmed that these modifications do not interfere with the existing tests on CUDA devices. Other accelerators can also extend the functionality by adding the device in the devices list. ( For eg: xpu ) ## CHANGES Create a separate class for test functions running on CUDA devices Extend the functionality of these tests to include HPUs Use instantiate_device_type_tests with targeted attributes to generate device-specific test instances within the new classes Apply skipIfHPU decorator to bypass tests that are not yet compatible with HPU devices PS: Most of these changes were initially part of #147609 , but closed that PR due to merge conflicts. The review comments were handled in this PR. Pull Request resolved: #149499 Approved by: https://github.com/EikanWang, https://github.com/desertfire, https://github.com/cyyever
This PR is related to pytorch#145476 . That PR had two files (test_functions.py and test_misc.py) . test_functions was causing CI/rebase/merge issues and hence removed for now. This PR contains only test_misc.py. This is a continuation of pytorch#144387 . ## MOTIVATION We recently integrated support for Intel Gaudi devices (identified as 'hpu') into the common_device_type framework via the pull request at pytorch#126970. This integration allows tests to be automatically instantiated for Gaudi devices upon loading the relevant library. Building on this development, the current pull request extends the utility of these hooks by adapting selected CUDA tests to operate on Gaudi devices. Additionally, we have confirmed that these modifications do not interfere with the existing tests on CUDA devices. Other accelerators can also extend the functionality by adding the device in the devices list. ( For eg: xpu ) ## CHANGES Create a separate class for test functions running on CUDA devices Extend the functionality of these tests to include HPUs Use instantiate_device_type_tests with targeted attributes to generate device-specific test instances within the new classes Apply skipIfHPU decorator to bypass tests that are not yet compatible with HPU devices PS: Most of these changes were initially part of pytorch#147609 , but closed that PR due to merge conflicts. The review comments were handled in this PR. Pull Request resolved: pytorch#149499 Approved by: https://github.com/EikanWang, https://github.com/desertfire, https://github.com/cyyever
This PR is related to pytorch#145476 . That PR had two files (test_functions.py and test_misc.py) . test_functions was causing CI/rebase/merge issues and hence removed for now. This PR contains only test_misc.py. This is a continuation of pytorch#144387 . ## MOTIVATION We recently integrated support for Intel Gaudi devices (identified as 'hpu') into the common_device_type framework via the pull request at pytorch#126970. This integration allows tests to be automatically instantiated for Gaudi devices upon loading the relevant library. Building on this development, the current pull request extends the utility of these hooks by adapting selected CUDA tests to operate on Gaudi devices. Additionally, we have confirmed that these modifications do not interfere with the existing tests on CUDA devices. Other accelerators can also extend the functionality by adding the device in the devices list. ( For eg: xpu ) ## CHANGES Create a separate class for test functions running on CUDA devices Extend the functionality of these tests to include HPUs Use instantiate_device_type_tests with targeted attributes to generate device-specific test instances within the new classes Apply skipIfHPU decorator to bypass tests that are not yet compatible with HPU devices PS: Most of these changes were initially part of pytorch#147609 , but closed that PR due to merge conflicts. The review comments were handled in this PR. Pull Request resolved: pytorch#149499 Approved by: https://github.com/EikanWang, https://github.com/desertfire, https://github.com/cyyever
This PR is a continuation of #144387 . Adapted two more files with the approach described below.
#MOTIVATION
We recently integrated support for Intel Gaudi devices (identified as 'hpu') into the common_device_type framework via the pull request at #126970. This integration allows tests to be automatically instantiated for Gaudi devices upon loading the relevant library. Building on this development, the current pull request extends the utility of these hooks by adapting selected CUDA tests to operate on Gaudi devices. Additionally, we have confirmed that these modifications do not interfere with the existing tests on CUDA devices.
Other accelerators can also extend the functionality by adding the device in the devices list. ( For eg: xpu )
#CHANGES
Create a separate class for test functions running on CUDA devices
Extend the functionality of these tests to include HPUs
Use instantiate_device_type_tests with targeted attributes to generate device-specific test instances within the new classes
Apply skipIfHPU decorator to bypass tests that are not yet compatible with HPU devices
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames