Repository navigation
UCP/CORE: Don't force blocking registration of managed RNDV frag pool. #12263
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1530,10 +1530,20 @@ ucp_rndv_frag_malloc_mpools(ucs_mpool_t *mp, size_t *size_p, void **chunk_p) | |
| ucs_memory_type_t mem_type = mpriv->mem_type; | ||
| ucs_sys_device_t sys_dev = mpriv->sys_dev; | ||
| size_t frag_size = context->config.ext.rndv_frag_size[mem_type]; | ||
| unsigned uct_flags = UCT_MD_MEM_ACCESS_RMA; | ||
| ucp_rndv_frag_mp_chunk_hdr_t *chunk_hdr; | ||
| ucs_status_t status; | ||
| unsigned num_elems; | ||
|
|
||
| /* CUDA managed memory cannot be pinned, it can only be registered on demand | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The fix seems odd: the frag mpool hardcodes a memory type to bypass Suggestions WDYT:
/* CUDA managed memory cannot be pinned, it can be registered only by ODP */
if ((mem_type == UCS_MEMORY_TYPE_CUDA_MANAGED) &&
(md->reg_nonblock_mem_types & UCS_BIT(mem_type))) {
flags |= UCT_MD_MEM_FLAG_NONBLOCK;
} |
||
| * (e.g. by ODP), regardless of UCX_REG_NONBLOCK_MEM_TYPES. Request | ||
| * blocking registration for any other memory type. */ | ||
| if (UCP_MEM_IS_CUDA_MANAGED(mem_type)) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not handle this in |
||
| uct_flags |= UCT_MD_MEM_FLAG_NONBLOCK; | ||
| } else { | ||
| uct_flags |= UCT_MD_MEM_FLAG_LOCK; | ||
| } | ||
|
|
||
| /* metadata */ | ||
| chunk_hdr = ucs_malloc(sizeof(*chunk_hdr) + *size_p, "chunk_hdr"); | ||
| if (chunk_hdr == NULL) { | ||
|
|
@@ -1545,8 +1555,7 @@ ucp_rndv_frag_malloc_mpools(ucs_mpool_t *mp, size_t *size_p, void **chunk_p) | |
|
|
||
| /* payload; need to get default flags from ucp_mem_map_params2uct_flags() */ | ||
| status = ucp_memh_alloc(context, NULL, frag_size * num_elems, mem_type, | ||
| sys_dev, UCP_MEMH_FLAG_NO_RCACHE, | ||
| UCT_MD_MEM_ACCESS_RMA | UCT_MD_MEM_FLAG_LOCK, 0, | ||
| sys_dev, UCP_MEMH_FLAG_NO_RCACHE, uct_flags, 0, | ||
| ucs_mpool_name(mp), &chunk_hdr->memh); | ||
| if (status != UCS_OK) { | ||
| return status; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we cover the other managed types here? if
IB_ODP_MEM_TYPESis set to rocm-managed or ze-managed, those frag pools fail the same way, sincereg_mem_typesgets the ODP types inuct_ib_md_check_odp().