mirror of
https://github.com/deepseek-ai/DeepEP
synced 2025-06-26 18:28:11 +00:00
Code cleanup and bug fixed
This commit is contained in:
@@ -432,4 +432,18 @@ __device__ __forceinline__ void nvshmemi_ibgda_amo_nonfetch_add(void *rptr, cons
|
||||
}
|
||||
}
|
||||
|
||||
__device__ __forceinline__ uint64_t nvshmemi_get_p2p_ptr(const uint64_t& ptr, const int& rank, const int& dst_rank) {
|
||||
// Local rank, no need for mapping
|
||||
if (rank == dst_rank)
|
||||
return ptr;
|
||||
auto peer_base = __ldg(reinterpret_cast<uint64_t*>(nvshmemi_device_state_d.peer_heap_base_p2p) + dst_rank);
|
||||
|
||||
// RDMA connected
|
||||
if (peer_base == 0)
|
||||
return 0;
|
||||
|
||||
// NVLink P2P is enabled
|
||||
return peer_base + (ptr - reinterpret_cast<uint64_t>(nvshmemi_device_state_d.heap_base));
|
||||
}
|
||||
|
||||
} // namespace deep_ep
|
||||
|
||||
Reference in New Issue
Block a user