Commit 9ee5e70
Add Intel Gaudi device/HPU to auto load in instantiate_device_type_tests (pytorch#126970)
### Motivation
Intel Gaudi accelerator (device name hpu) is seen to have good pass rate with the pytorch framework UTs , however being an out-of-tree device, we face challenges in adapting the device to natively run the existing pytorch UTs under pytorch/test. The UTs however is a good indicator of the device stack health and as such we run them regularly with adaptations.
Although we can add Gaudi/HPU device to generate the device specific tests using the TORCH_TEST_DEVICES environment variable, we miss out on lot of features such as executing for specific dtypes, skipping and overriding opInfo. With significant changes introduced every Pytorch release maintaining these adaptations become difficult and time consuming.
Hence with this PR we introduce Gaudi device in common_device_type framework, so that the tests are instantiated for Gaudi when the library is loaded.
The eventual goal is to introduce Gaudi out-of-tree support as equivalent to in-tree devices
### Changes
Add HPUTestBase of type DeviceTypeTestBase specifying appropriate attributes for Gaudi/HPU.
Include code to check if intel Gaudi Software library is loaded and if so, add the device to the list of devices considered for instantiation of device type tests
### Additional Context
please refer the following RFC : pytorch/rfcs#63
Pull Request resolved: pytorch#126970
Approved by: https://github.com/albanD1 parent c9e093c commit 9ee5e70
File tree
2 files changed
+38
-1
lines changed- torch/testing/_internal
2 files changed
+38
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
593 | 605 | | |
594 | 606 | | |
595 | 607 | | |
| |||
701 | 713 | | |
702 | 714 | | |
703 | 715 | | |
| 716 | + | |
| 717 | + | |
704 | 718 | | |
705 | 719 | | |
706 | 720 | | |
| |||
1060 | 1074 | | |
1061 | 1075 | | |
1062 | 1076 | | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
1063 | 1081 | | |
1064 | 1082 | | |
1065 | 1083 | | |
| |||
1343 | 1361 | | |
1344 | 1362 | | |
1345 | 1363 | | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
1346 | 1367 | | |
1347 | 1368 | | |
1348 | 1369 | | |
| |||
1401 | 1422 | | |
1402 | 1423 | | |
1403 | 1424 | | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
1404 | 1428 | | |
1405 | 1429 | | |
1406 | 1430 | | |
| |||
1578 | 1602 | | |
1579 | 1603 | | |
1580 | 1604 | | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
1581 | 1608 | | |
1582 | 1609 | | |
1583 | 1610 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1236 | 1236 | | |
1237 | 1237 | | |
1238 | 1238 | | |
| 1239 | + | |
1239 | 1240 | | |
1240 | 1241 | | |
1241 | 1242 | | |
| |||
1622 | 1623 | | |
1623 | 1624 | | |
1624 | 1625 | | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
1625 | 1635 | | |
1626 | 1636 | | |
1627 | 1637 | | |
| |||
0 commit comments