mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[PR #581] [CLOSED] Fix NVSHMEM IBGDA duplicate-definition in host builds #643
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#643
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/581
Author: @Gregory-Pereira
Created: 2/8/2026
Status: ❌ Closed
Base:
main← Head:fix/nvshmem-ibgda-multiple-definition📝 Commits (1)
9900622Guard NVSHMEM IBGDA header from host compilation to avoid duplicate symbol📊 Changes
1 file changed (+6 additions, -0 deletions)
View changed files
📝
csrc/kernels/configs.cuh(+6 -0)📄 Description
Fix NVSHMEM IBGDA duplicate-definition in host builds
Summary
This PR fixes a linker error that occurs when building the DeepEP Python extension with NVSHMEM enabled.
Problem
csrc/kernels/configs.cuh includes NVSHMEM’s internal header:
That header conditionally defines the global symbol:
When the header is included from a host-compiled translation unit (e.g. deep_ep.cpp built with g++), the symbol is emitted as a definition. Since DeepEP also links against libnvshmem_device.a, which defines the same symbol, the build fails at link time with:
This can be reproduced when building DeepEP against newer NVSHMEM releases (e.g. v3.5.19) in environments where configs.cuh is included by both CUDA (.cu) and host (.cpp) sources.
Solution
Restrict inclusion of nvshmem_common_ibgda.h to NVCC compilation contexts only:
This ensures:
a duplicate definition of nvshmemi_ibgda_device_state_d
Why this approach
When included from host-compiled code, nvshmem_common_ibgda.h can emit a
definition of nvshmemi_ibgda_device_state_d, which collides with the definition
provided by libnvshmem_device.a at link time.
Restricting the include to NVCC compilation avoids this duplicate-definition
path and makes the build more robust across NVSHMEM versions and build
environments.
The change is minimal and does not alter existing CUDA behavior.
My build log hitting this
cc @tlrmchlsmth @smarterclayton
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.