Commit 1214198
authored
[c10d] Fix extra CUDA context created by barrier (pytorch#152834)
Fixes pytorch#149119.
In ProcessGroup.hpp, we create a dummy tensor for dispatching. This
requires a correct device index. This PR uses `device_id` given by user
when calling `init_process_group`.
This PR also uses `torch._C._get_accelerator()` to determine the device
type.
ghstack-source-id: 96c32b9
Pull Request resolved: pytorch#1491441 parent 790cc2f commit 1214198
File tree
2 files changed
+23
-21
lines changed- test/distributed
- torch/distributed
2 files changed
+23
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3555 | 3555 | | |
3556 | 3556 | | |
3557 | 3557 | | |
3558 | | - | |
3559 | | - | |
3560 | | - | |
3561 | | - | |
3562 | | - | |
3563 | | - | |
3564 | | - | |
3565 | | - | |
3566 | | - | |
3567 | | - | |
3568 | | - | |
3569 | 3558 | | |
3570 | 3559 | | |
3571 | 3560 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4596 | 4596 | | |
4597 | 4597 | | |
4598 | 4598 | | |
4599 | | - | |
| 4599 | + | |
4600 | 4600 | | |
4601 | 4601 | | |
4602 | 4602 | | |
4603 | 4603 | | |
4604 | 4604 | | |
4605 | 4605 | | |
4606 | 4606 | | |
| 4607 | + | |
| 4608 | + | |
4607 | 4609 | | |
4608 | 4610 | | |
4609 | 4611 | | |
4610 | 4612 | | |
4611 | 4613 | | |
4612 | | - | |
4613 | | - | |
4614 | | - | |
4615 | | - | |
4616 | | - | |
4617 | | - | |
4618 | | - | |
4619 | | - | |
| 4614 | + | |
| 4615 | + | |
| 4616 | + | |
| 4617 | + | |
| 4618 | + | |
| 4619 | + | |
| 4620 | + | |
| 4621 | + | |
| 4622 | + | |
| 4623 | + | |
| 4624 | + | |
| 4625 | + | |
| 4626 | + | |
| 4627 | + | |
| 4628 | + | |
| 4629 | + | |
| 4630 | + | |
| 4631 | + | |
| 4632 | + | |
| 4633 | + | |
4620 | 4634 | | |
4621 | | - | |
4622 | 4635 | | |
4623 | 4636 | | |
4624 | 4637 | | |
| |||
0 commit comments