Repository navigation
UCP/RNDV: Add opt-in intra-node CUDA staging policy - #11641
Conversation
Allow users to prefer the copy-to-attached host-staged path for intra-node CUDA-to-CUDA tag rendezvous while leaving explicit schemes and unrelated traffic unchanged. Force only the staged receiver envelope and the sender-side rndv/rkey_ptr/mtype child when that child initializes, with normal UCX fallback otherwise. Mark internal RMA and AM rendezvous selections with local-only provenance and preserve it across pipeline fragment selection, so RMA PUT/GET reuse of RNDV_RECV and Active Message rendezvous remain outside the tag-only policy without changing the wire format. Scope synthetic receiver-estimation rkey identity to matching forced intra-node CUDA modeling, so disabled and unrelated flows reuse the legacy rkey configuration.
|
🤖 Starting review — findings will be posted here when done. |
|
Behavioral note: Coverage note: the force path ( |
|
@evgeny-leksikov please review |
|
|
||
| ## Current | ||
| ### Features: | ||
| #### UCP |
|
Minor: |
| "Use two stage pipeline rendezvous protocol for intra-node GPU to GPU transfers", | ||
| ucs_offsetof(ucp_context_config_t, rndv_shm_ppln_enable), UCS_CONFIG_TYPE_BOOL}, | ||
|
|
||
| {"RNDV_PIPELINE_SHM_CUDA_STAGING_FORCE", "n", |
There was a problem hiding this comment.
This is called FORCE, but if staging is unavailable proto-select silently falls back to RC. Maybe rename / change type from BOOL to ternary
| } | ||
|
|
||
| /* Check that AM and RMA rendezvous flows are excluded. */ | ||
| if (op_id_flags & (UCP_PROTO_SELECT_OP_FLAG_AM_RNDV | |
There was a problem hiding this comment.
Can we mark tag RNDV explicitly?
| const ucp_proto_init_params_t *init_params = ¶ms->super.super; | ||
| uint8_t op_id_flags = init_params->select_param->op_id_flags; | ||
|
|
||
| if (force_shm_pipeline) { |
There was a problem hiding this comment.
Matching RECV + PPLN_FRAG + host + threshold here couples generic rndv control code to the current child layout. Better mark the intended pipeline child explicitly.
| } | ||
|
|
||
| /* When forced staging is enabled, preserve AM RNDV provenance for the nested remote receive model. */ | ||
| if (init_params->worker->context->config.ext.rndv_shm_cuda_staging_force) { |
There was a problem hiding this comment.
Minor: With an explicit RNDV_SCHEME, forcing is inactive but we still add the AM provenance flag and create another selection key.
| if (remote_proto->cfg_thresh != UCS_MEMUNITS_AUTO) { | ||
| force_shm_pipeline = | ||
| ucp_proto_rndv_shm_pipeline_force(¶ms->super.super); | ||
| if ((context->config.ext.rndv_mode != UCP_RNDV_MODE_AUTO) && |
There was a problem hiding this comment.
Pls keep the old invariant check in auto mode and exempt only the known forced child. Otherwise an unexpected finite remote threshold is silently accepted.
| UCS_TEST_SKIP_R("CUDA memory is not supported"); | ||
| } | ||
|
|
||
| threshold = select_rndv_ppln_frag_protocol( |
There was a problem hiding this comment.
Can we add coverage for this runtime mapping? Current tests only exercise model-side flags or inject them directly.
| static UCS_F_ALWAYS_INLINE int | ||
| ucp_proto_rndv_shm_pipeline_force_scope( | ||
| const ucp_proto_init_params_t *init_params, ucp_operation_id_t op_id, | ||
| ucs_memory_type_t remote_mem_type, int allow_proto_estimation) |
There was a problem hiding this comment.
Minor: allow_proto_estimation is always passed as 1
Replace the earlier AM/RMA rendezvous flags with one TAG_RNDV signal that is propagated only for tag rendezvous flows.
What?
This PR adds an opt-in UCP rendezvous policy knob for intra-node CUDA tag transfers. When enabled, the policy prefers the shared-memory staged CUDA-copy pipeline path for CUDA-to-CUDA rendezvous on the same node, while keeping the default behavior unchanged.
Why?
internal issue
Workaround for a performance issue caused by a bad wireup bandwidth estimation model. Wireup model makes the RC/IB path look better than the staged CUDA-copy path, so UCX selects RC for intra-node GPU-to-GPU transfers even though the staged shared-memory path performs significantly better.
Existing UCX rendezvous knobs are not sufficient for this case. Broad knobs such as
UCX_RNDV_SCHEMEselect a rendezvous scheme globally, but they do not express the policy needed here:The new knob keeps this behavior opt-in and scoped, so it can be used as a tactical workaround without changing default protocol selection for other environments.
How?
UCX_RNDV_PIPELINE_SHM_CUDA_STAGING_FORCEas an opt-in policy knob.RNDV_SCHEME=auto.