mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[PR #557] [CLOSED] Fix linking error with nvidia-nvshmem-cu12 3.5.19 #636
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepEP#636
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/DeepEP/pull/557
Author: @windreamer
Created: 1/6/2026
Status: ❌ Closed
Base:
main← Head:fix_linking_nvshmem📝 Commits (1)
6e74c26fix: fix link error with nvidia-nvshmem-cu12 3.5.19📊 Changes
1 file changed (+2 additions, -0 deletions)
View changed files
📝
csrc/kernels/configs.cuh(+2 -0)📄 Description
Motivation
After upgrading to NVSHMEM 3.5.19, we encountered a multiple definition linking error:
This happens because NVSHMEM 3.5.19 expects users to compile with
-rdc=true(relocatable device code).github.com/NVIDIA/nvshmem@919760f413/src/include/device_host_transport/nvshmem_common_ibgda.h (L343-L349)However, in DeepEP's build structure:
deep_ep.cppis compiled by the host compiler (g++), not nvcc. While DeepEP enables-rdc=truefor.cufiles, this flag is only recognized by nvcc and has no effect on host compilation.The header
device_host_transport/nvshmem_common_ibgda.hcontains a conditional definition of the global variablenvshmemi_ibgda_device_state_d. When included indeep_ep.cpp, the host compiler sees it as a definition rather than anexterndeclaration (since__CUDACC_RDC__is not defined), causing the symbol to be incorrectly emitted indeep_ep.o. This conflicts with the canonical definition inlibnvshmem_device.a.Modification
The core issue is that
device_host_transport/nvshmem_common_ibgda.his a device-specific internal header that should never be included in host-compiled translation units. Instead of relying on-rdc=true(which doesn't affect host compilation), we restrict the inclusion of this header to only when nvcc is processing the file.By guarding the inclusion with
#ifdef __CUDACC__, we ensure that:.cufiles compiled by nvcc) can still access the necessary declarations.cppfiles compiled by g++) will never see this header or its problematic symbol definitionThis prevents the duplicate symbol error while maintaining compatibility with NVSHMEM's device API usage in the kernel code.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.