diff --git a/dipu/tests/python/individual_scripts/test_rt_ddp.py b/dipu/tests/python/individual_scripts/test_rt_ddp.py index 1fed653da..257804982 100644 --- a/dipu/tests/python/individual_scripts/test_rt_ddp.py +++ b/dipu/tests/python/individual_scripts/test_rt_ddp.py @@ -65,8 +65,9 @@ def forward(self, x): def demo_basic_ddp(rank, world_size, port): import torch_dipu - print(f"Running basic DDP example on rank {rank} {torch.cuda.current_device()}") + # print(f"Running basic DDP example on rank {rank} {torch.cuda.current_device()}") torch.cuda.set_device(rank) + print(f"Running basic DDP example on rank {rank} {torch.cuda.current_device()}") backend = "nccl" dev1 = rank @@ -100,8 +101,9 @@ def demo_basic_ddp(rank, world_size, port): def demo_allreduce(rank, world_size, port): import torch_dipu - print(f"Running basic DDP example on rank {rank} {torch.cuda.current_device()}") + # print(f"Running basic DDP example on rank {rank} {torch.cuda.current_device()}") torch.cuda.set_device(rank) + print(f"Running basic DDP example on rank {rank} {torch.cuda.current_device()}") dev1 = rank setup(rank, world_size, port) @@ -151,7 +153,7 @@ def demo_allgather(rank, world_size, port): import torch_dipu setup(rank, world_size, port) - + print(f"rank={rank}") src1 = torch.ones((2, 4)).to(rank) dests = torch.zeros((world_size * 2, 4)).to(rank) dests = [ diff --git a/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp b/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp index e48e69ef0..0e6c1dc27 100644 --- a/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp +++ b/dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp @@ -29,7 +29,7 @@ void finalizeVendor() { DIPU_CALLACLRT(aclFinalize()); } deviceId_t current_device() { if (currentDeviceIndex < 0) { setDevice(-1); - DIPU_CALLACLRT(::aclrtGetDevice(¤tDeviceIndex)) + // DIPU_CALLACLRT(::aclrtGetDevice(¤tDeviceIndex)) } return static_cast(currentDeviceIndex); }