Repository navigation
[Bugfix][Store] Open CUDA IPC via exporter PCI bus ID - #5006
huangxiaobai-ydmy wants to merge 3 commits into
Conversation
Dummy-client exports record the exporter's CUDA device ordinal, which is relative to that process's CUDA_VISIBLE_DEVICES. Opening with cudaSetDevice(handle.device_id) maps every worker's buffer onto the real client's GPU 0 when CVD layouts differ. Match TENT NVLinkTransport: open on the current device with lazy peer access and remember that local ordinal for close. Fixes kvcache-ai#4980 Signed-off-by: YDMY_Kirito <202200820046@mail.sdu.edu.cn> (Rebased onto main after kvcache-ai#5030; packaging commits dropped.)
|
Thanks for the quick fix. As the reporter of #4980, I don't think opening on the caller's current device fixes it on CUDA builds, and I think it breaks a layout that works today. Where the open runs
Against the table in #4980 (real client
Suggestion (as in #4980)
AI assistance: this analysis was prepared with Claude; I reviewed it against the code and the measurements in #4980. |
Exporter ordinals are relative to CUDA_VISIBLE_DEVICES and cannot be reused by the real client. Carry cudaDeviceGetPCIBusId in the handle and resolve with cudaDeviceGetByPCIBusId on open; keep device_id for logging and open on the caller device only for legacy empty pci_bus_id handles. (Rebased onto main after kvcache-ai#5030; packaging commits dropped.)
|
Addressed @0z5a's analysis of the previous approach:
|
(Rebased onto main after kvcache-ai#5030; packaging commits dropped.)
Same packaging gap as kvcache-ai#5006/kvcache-ai#5007/kvcache-ai#4865 after kvcache-ai#3954.
|
Thanks for switching to the PCI bus ID. I ran this PR at Setup:
The failing row from #4980 now passes, and the two control rows are unchanged. LGTM from the hardware side. AI assistance: the test harness and this summary were prepared with Claude; I reviewed them and ran the tests on the hardware above. |
8cd8c40 to
cd9a342
Compare
Summary
CUDA_VISIBLE_DEVICES#4980: dummy-client CUDA IPC export now carries the exporter GPU PCI bus ID (cudaDeviceGetPCIBusId), and the real client opens the handle after resolving that identity withcudaDeviceGetByPCIBusId.device_idordinal forcudaSetDevice(it is relative to the peer'sCUDA_VISIBLE_DEVICESand caused-600without P2P / wrong-GPU opens with remapped CVD).device_idfor logging/backward compatibility; legacy handles with an emptypci_bus_idstill open on the caller's current device (TENT-style).Test plan
CUDA_VISIBLE_DEVICES=0,1, dummyCVD=1, buffer on GPU 1, no P2P: put/get succeed (opens on physical GPU 1 via PCI bus ID)CVD=0/ buffer on GPU 0: still OKCVD=0,1(dev 1): still OK (no regression vs opening on exporter GPU)INVALID_PARAMS(clear path)