Removing CUDA Runtime Dependency from plugin - #1359
Conversation
|
For bisectability, doesn't your first commit (removing the CUDA linking) need to come last, after you have changed everything to the driver API? |
Ahh yes. I think you are right. I kept the order of development but I will change that. |
amitrad-aws
left a comment
There was a problem hiding this comment.
Agree with the order change, please do that
2206a83 to
1b9cef6
Compare
bwbarrett
left a comment
There was a problem hiding this comment.
A couple of your commit messages could use some changes. We use subsection prefixes but not the fix/whatever/ type prefixes. It's also not clear why we're making the change in some, and leaving future us some notes would be helpful.
| cudaFree(d_cq); | ||
| int ret; | ||
|
|
||
| if (!d_cq) return; |
There was a problem hiding this comment.
this isn't a 1:1 rewrite; why the changes?
f1e607c to
ada90e5
Compare
ada90e5 to
03de6be
Compare
|
Who maintains |
7242739 to
9f416f2
Compare
bwbarrett
left a comment
There was a problem hiding this comment.
nit: your commit message subjects should be declartive, so something like:
efa-gda: Translate cuda runtime function calls to cuda driver function calls
not the current
efa-gda: Translating cuda runtime function calls to cuda driver function calls
…n calls The efa-gda host code (libefa_cuda_dp) used the CUDA Runtime API, which forces the plugin to link the runtime and breaks --enable-cudart-dynamic. Translate those calls to the CUDA driver API, provided through wrappers in nccl_ofi_cuda.cpp, so a later commit can drop the runtime link. cuGetErrorName / cuGetErrorString are wrapped to provide a driver equivalent of cudaGetErrorString, which efa-gda uses and the driver API does not offer directly. Signed-off-by: Hershel Shah <hershys@amazon.com>
The gdrcopy path used the CUDA Runtime (cudaGetDevice/cudaSetDevice) to bind a device for its lazy signal-segment discovery, which keeps the runtime linked and breaks --enable-cudart-dynamic. The driver API has no cudaSetDevice equivalent, so rather than bind a device we now capture the application's current CUDA context at comm init (cuCtxGetCurrent) and make it current (cuCtxSetCurrent) on NCCL's context-less GIN progress thread before cuMemGetAddressRange. Also replaces the remaining runtime call, cudaMemset, with cuMemsetD8. Signed-off-by: Hershel Shah <hershys@amazon.com>
$(CUDA_RUNTIME_LIBS) was added to libinternal_plugin only because the efa-gda GDAKI host code (libefa_cuda_dp.la) used CUDA Runtime APIs. That code is now on the CUDA driver API, so the extra linkage is unnecessary; dropping it also avoids a hard libcudart dependency in the plugin under --enable-cudart-dynamic. Signed-off-by: Hershel Shah <hershys@amazon.com>
The gdrcopy unit test calls cudaSetDevice and cudaGetErrorString from the CUDA runtime directly. It previously resolved these transitively through libinternal_plugin, but the plugin no longer links the CUDA runtime so that --enable-cudart-dynamic keeps working. Link CUDA_RUNTIME_LIBS into the gdrcopy target so the test builds without pulling the runtime back into the plugin. CUDA_RUNTIME_LIBS is -lcudart for dynamic builds and empty for static builds, where cudart_static is already provided by CUDA_LIBS. Signed-off-by: Hershel Shah <hershys@amazon.com>
0120b2e to
9b9b9f3
Compare
Description of changes:
Removing CUDA runtime functions introduced by multi-segment host memory functionality as well as EFA DP Direct.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.