Skip to content
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

Use collective active_set to send data to self #674

Open
marsaev opened this issue Nov 2, 2022 · 1 comment
Open

Use collective active_set to send data to self #674

marsaev opened this issue Nov 2, 2022 · 1 comment

Comments

@marsaev
Copy link

marsaev commented Nov 2, 2022

Currently we use active_set field to "emulate" p2p communication:

    ucc_coll_args_t coll = {0};
    coll.mask = UCC_COLL_ARGS_FIELD_FLAGS | UCC_COLL_ARGS_FIELD_ACTIVE_SET | UCC_COLL_ARGS_FIELD_FLAGS;
    coll.flags = UCC_COLL_ARGS_FLAG_COUNT_64BIT;
    coll.coll_type = UCC_COLL_TYPE_BCAST;
    coll.root = root_rank;
    coll.tag = tag;
    coll.src.info.buffer = ptr;
    coll.src.info.count = size;
    coll.src.info.datatype = UCC_DT_UINT8;
    coll.src.info.mem_type = UCC_MEMORY_TYPE_CUDA;

    coll.active_set.size = 2;
    coll.active_set.start = my_rank;
    coll.active_set.stride = my_rank - peer_rank;

however I don't see a way to set up coll properly to "send" to myself for this code to work:
https://github.com/openucx/ucc/blob/master/src/utils/ucc_coll_utils.h#L270-L271

Currently i have workaround that uses cudaMemcpyAsync instead of UCC when i try to do something like this, but for composability it would be nice for UCC to handle this case:

for (msg: messages)
    if (myrank == msg.src)
        ucc.send(msg.dst, ...)
    if (myrank == msg.dst)
        ucc.recv(msg.src, ...)
wait_all_ucc_requests()
@vspetrov
Copy link
Collaborator

From the API perspecitve: active_set.size = 1; start = my_rank; stride = 1; should probably work. But it might not be implemented currectly in TL/UCP currently.

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

No branches or pull requests

2 participants