Repository navigation
UCT/CUDA_IPC: Implement uct_ep_put_sgl_zcopy - #11359
Conversation
81ed122 to
2101677
Compare
e66fb59 to
f56085d
Compare
325279b to
50b7f6f
Compare
be7b14d to
e4b5a14
Compare
e4b5a14 to
24af44d
Compare
| if (ucs_unlikely(count == 0)) { | ||
| ucs_trace_data("Zero count put_sgl_zcopy: skip it"); | ||
| return UCS_OK; | ||
| } |
There was a problem hiding this comment.
maybe we do not need this check separately - it is covered by the check on line 320 below. you can move trace there
| mapping->count = count; | ||
| mapping->entries = (uct_cuda_ipc_sgl_entry_t *)(mapping + 1); | ||
|
|
||
| cuda_dsts = ucs_malloc(count * sizeof(CUdeviceptr), "cuda_ipc_sgl_dsts"); |
There was a problem hiding this comment.
can we combine with mapping allocation? i.e. have one malloc covering both?
| uct_cuda_ipc_sgl_unmap(mapping, mapping->count, | ||
| cuda_ipc_event->cuda_device, | ||
| iface->config.enable_cache); | ||
| ucs_free(mapping); |
There was a problem hiding this comment.
maybe we can free in uct_cuda_ipc_sgl_unmap? they are always used together
| return status; | ||
| } | ||
|
|
||
| mapping = ucs_malloc(sizeof(*mapping) + |
There was a problem hiding this comment.
for the next PR, we can alloca if batch is not big
| #if CUDA_VERSION >= 13000 | ||
| if (cuda_ipc_event->sgl_mapping != NULL) { | ||
| uct_cuda_ipc_sgl_mapping_destroy(cuda_ipc_event->sgl_mapping, | ||
| cuda_ipc_event->cuda_device, | ||
| iface->config.enable_cache); | ||
| return; | ||
| } | ||
| #endif |
There was a problem hiding this comment.
for the next PR, we can keep CUDA > 13 macro guard only inside uct_cuda_ipc_sgl_mapping_destroy and cuda_ipc_event->sgl_mapping will always be NULL for older cuda
This would reduce number of ifdefs thru the code a bit
|
|
||
| _UCT_INSTANTIATE_TEST_CASE(test_cuda_ipc_rma_device, cuda_ipc) | ||
|
|
||
| class test_cuda_ipc_put_sgl : public test_cuda_ipc_rma { |
There was a problem hiding this comment.
next PRs, we can make it generic UCT test for all tls supporting put_SGL
What?
Implement
uct_ep_put_sgl_zcopyfor thecuda_ipctransport.Why?
Allow UCP SGL put offload to run over
cuda_ipc, replacing N separate per-buffer copies with a single batched submission and reducing per-element overhead on multi-buffer transfers.How?
On CUDA 13+, issue one
cuMemcpyBatchAsyncfor the whole SGL, with all mappings tracked in a per-eventuct_cuda_ipc_sgl_mapping_tand unmapped on completion. On older CUDA, fall back to per-elementuct_cuda_ipc_ep_put_zcopy, arming the user completion only on the last element.