Skip to content

Commit fc00d22

Browse files
committed
refine code
1 parent 3fe7f76 commit fc00d22

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

csrc/deep_ep.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,11 @@ Buffer::Buffer(int rank,
139139
num_ranks(num_ranks),
140140
num_nvl_bytes(num_nvl_bytes),
141141
num_rdma_bytes(num_rdma_bytes),
142-
device_id([&]() {
143-
int id = -1;
144-
CUDA_CHECK(cudaGetDevice(&id));
145-
return id;
146-
}()),
147142
enable_shrink(enable_shrink),
148143
low_latency_mode(low_latency_mode),
149144
explicitly_destroy(explicitly_destroy),
150145
comm_stream([&]() {
146+
CUDA_CHECK(cudaGetDevice(&device_id));
151147
auto map = paddle::distributed::ProcessGroupMapFromGid::getInstance();
152148
paddle::distributed::ProcessGroup* pg = map->get(context_ring_id);
153149
const auto& place = phi::GPUPlace(device_id);

0 commit comments

Comments
 (0)