Commit 6a28cc8
Add TEST_HPU flag to set device type (#153461)
MOTIVATION
This PR includes a minor change to check for TEST_HPU flag as well before falling back to CPU. Without this flag, some tests were falling back to CPU causing them to fail.
Please refer to this RFC as well: pytorch/rfcs#66
CHANGES
add TEST_HPU flag to some of the conditions checking the environment
use DEVICE_COUNT variable instead of torch.accelerator.device_count() API since the later is not supported on out-of-tree devices like Intel Gaudi.
@ankurneog , @EikanWang , @cyyever , @guangyey
Pull Request resolved: #153461
Approved by: https://github.com/EikanWang, https://github.com/cyyever, https://github.com/albanD1 parent a54bf43 commit 6a28cc8
File tree
1 file changed
+3
-6
lines changed- torch/testing/_internal/distributed/_tensor
1 file changed
+3
-6
lines changedLines changed: 3 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
| 342 | + | |
| 343 | + | |
347 | 344 | | |
348 | 345 | | |
349 | 346 | | |
| |||
0 commit comments