Skip to content

Add support for ucc_mem_map and ucc_mem_unmap #1070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

wfaderhold21
Copy link
Collaborator

What

Implementation of PR #1037

NOTE: branch is branched from #1037 and will need to be rebased before merging

@swx-jenkins3
Copy link

Can one of the admins verify this patch?

@wfaderhold21 wfaderhold21 force-pushed the topic/explicit-mem-map-impl branch from 61ab0da to 4a2f9c6 Compare January 16, 2025 00:31
@manjugv
Copy link
Contributor

manjugv commented Jan 18, 2025

@janjust @nsarka Can you test on your setup? Ask @wfaderhold21 for details.

@wfaderhold21
Copy link
Collaborator Author

Example user usage of API changes: https://github.com/wfaderhold21/simple-ucc-ex

if (flags == UCC_MEM_MAP_IMPORT || flags == UCC_MEM_MAP_IMPORT_OFFLOAD) {
return ucc_mem_map_import(context, flags, params, memh_size, memh);
} else {
if (params->n_segments > 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we really need to support multiple mapping at a time in future? what is a use case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A use case would include onesided alltoall where both the destination and global work buffer are associated with the destination memory handles. This would allow use of the current algorithm implementation in UCC already. However, implementing this may not be clean...

@wfaderhold21 wfaderhold21 force-pushed the topic/explicit-mem-map-impl branch from 23d5050 to 9691c1f Compare March 4, 2025 21:52
@wfaderhold21
Copy link
Collaborator Author

@Sergei-Lebedev Thank you for the feedback. I believe I have addressed all your concerns. Please let me know if I haven't.

@wfaderhold21
Copy link
Collaborator Author

@janjust do we need more code review concerning this PR or can we apply the completed label?

@Sergei-Lebedev
Copy link
Contributor

@Sergei-Lebedev Thank you for the feedback. I believe I have addressed all your concerns. Please let me know if I haven't.

thanks, I reviewed only part of this PR since it's big. I will continue reviewing this week.

@@ -10,6 +10,13 @@ ucc_status_t ucc_cl_basic_get_lib_attr(const ucc_base_lib_t *lib,
ucc_base_lib_attr_t *base_attr);
ucc_status_t ucc_cl_basic_get_context_attr(const ucc_base_context_t *context,
ucc_base_ctx_attr_t *base_attr);
ucc_status_t ucc_cl_basic_mem_map(const ucc_base_context_t *context, int type,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I leave it up to you but these declarations could even go into the macro UCC_BASE_IFACE_DECLARE, it would save a lot of duplication

ferrol aderholdt added 20 commits May 9, 2025 06:54
CL/BASIC: add support for ucc_mem_map/unmap

CL/HIER: add support for ucc_mem_map/unmap

CL/DOCA_UROM: add support for ucc_mem_map/unmap

TL/CUDA: add support for ucc_mem_map/unmap

TL/MLX5: add support for ucc_mem_map/unmap

TL/NCCL: add support for ucc_mem_map/unmap

TL/RCCL: add support for ucc_mem_map/unmap

TL/SELF: add support for ucc_mem_map/unmap

TL/SHARP: add support for ucc_mem_map/unmap
TL/UCP: add support for communication with memmap

REVIEW: various fixes

TL/UCP: Enable multiple packed buffers
@wfaderhold21 wfaderhold21 force-pushed the topic/explicit-mem-map-impl branch from 2f469f5 to bb5ee28 Compare May 9, 2025 13:55
TL/UCP: additional support for memh in onesided alltoall
@wfaderhold21 wfaderhold21 force-pushed the topic/explicit-mem-map-impl branch from bb5ee28 to f88c054 Compare May 9, 2025 14:13
@wfaderhold21
Copy link
Collaborator Author

@Sergei-Lebedev Thanks again for the time and comments related to this PR. I've updated the PR based on what you've suggested and answered your comments. Please let me know if there is anymore feedback.

tl_error(ctx->super.super.lib, "unable to pack memory handle without TL handles");
return UCC_ERR_INVALID_PARAM;
}
if (ctx->cfg.exported_memory_handle && mode == UCC_MEM_MAP_MODE_EXPORT) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should it be UCC_MEM_MAP_MODE_EXPORT_OFFLOAD?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

UCC_MEM_MAP_MODE_EXPORT_OFFLOAD is used to perform an export of a memory handle on an offload device (e.g., DPU). In that case, there's no need to pack the UCP memory handle on the DPU. It can just pack rkeys.

@Sergei-Lebedev
Copy link
Contributor

@wfaderhold21 thank you for all the hard work you've put into this pull request — it's greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants