Skip to content

Support gpu->host transfer in device API - #11059

Merged
yosefe merged 14 commits into
openucx:masterfrom
ofirfarjun7:topic/device-api-support-host-gpu-transfer
Dec 15, 2025
Merged

yosefe merged 14 commits into
openucx:masterfrom
ofirfarjun7:topic/device-api-support-host-gpu-transfer

Conversation

@ofirfarjun7

@ofirfarjun7 ofirfarjun7 commented Dec 13, 2025 •

Copy link
Copy Markdown
Contributor

What?

Support transfer to host memory using device api.

Why?

Because we can.

@ofirfarjun7 ofirfarjun7 added the WIP-DNM Work in progress / Do not review label Dec 14, 2025
@ofirfarjun7 ofirfarjun7 removed the WIP-DNM Work in progress / Do not review label Dec 14, 2025
@ofirfarjun7 ofirfarjun7 changed the title Topic/device api support host gpu transfer Support host gpu transfer in device API Dec 14, 2025
@ofirfarjun7 ofirfarjun7 changed the title Support host gpu transfer in device API Support host/gpu transfer in device API Dec 14, 2025
Comment thread src/tools/perf/cuda/cuda_kernel.cuh Outdated
UCS_F_DEVICE void ucx_perf_cuda_wait_sn(const uint64_t *sn, uint64_t value)
{
if (threadIdx.x == 0) {
//TODO - Support host memory

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls remove or change to /* TODO support host memory */

Comment thread src/ucp/core/ucp_device.c
Comment on lines -268 to -278
if (*local_sys_dev == UCS_SYS_DEVICE_ID_UNKNOWN) {
*mem_type = UCS_MEMORY_TYPE_CUDA;
status = ucp_device_detect_local_sys_dev(context, *mem_type,
local_sys_dev);
if (status != UCS_OK) {
return status;
}

*local_md_map = ucp_device_detect_local_md_map(context,
*local_sys_dev);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we cannot just remove this because mem_list itself may be allocated in wrong place

Comment thread src/ucp/core/ucp_device.c Outdated

src_md_index = ucp_ep_md_index(ep, lane);
if (!(local_md_map & UCS_BIT(src_md_index))) {
if ((local_sys_dev != UCS_SYS_DEVICE_ID_UNKNOWN) && (local_md_map) &&

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need (local_md_map) condition ?

Comment thread src/ucp/core/ucp_device.c Outdated
if (i == 0) {
ucs_error("failed to select lane for local device %s",
ucs_topo_sys_device_get_name(local_sys_dev));
ucs_error("failed to select lane");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why need to changed?

Comment thread src/ucp/core/ucp_device.c Outdated
params);
ucp_mem_type_pack(worker, &counter_value, counter_ptr,
sizeof(counter_value), mem_type);
if (UCP_MEM_IS_HOST(mem_type)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use ucp_dt_contig_pack?

Comment thread src/ucp/core/ucp_device.c Outdated
if (UCP_MEM_IS_HOST(mem_type)) {
memcpy(counter_ptr, &counter_value, sizeof(counter_value));
} else {
ucp_mem_type_unpack(worker, counter_ptr, &counter_value,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use ucp_dt_contig_unpack?

@ofirfarjun7 ofirfarjun7 changed the title Support host/gpu transfer in device API Support gpu->host transfer in device API Dec 14, 2025
@ofirfarjun7
ofirfarjun7 requested a review from yosefe December 14, 2025 12:51
Comment thread src/ucp/core/ucp_device.c Resolved
Comment thread src/ucp/core/ucp_device.c Resolved
Comment thread src/ucp/core/ucp_device.c Resolved
Comment thread src/ucp/core/ucp_device.c Resolved
Comment thread src/ucp/core/ucp_device.c Resolved
yosefe
yosefe previously approved these changes Dec 14, 2025
@yosefe
yosefe enabled auto-merge (squash) December 15, 2025 08:09
@yosefe
yosefe merged commit dce3d39 into openucx:master Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants