UCP/DEVICE: check connect only if there are p2p lanes - #11966
Artemy-Mellanox wants to merge 3 commits into
Conversation
|
🤖 Starting review — findings will be posted here when done. |
|
|
||
| if (!(ep->flags & UCP_EP_FLAG_REMOTE_CONNECTED)) { | ||
| if (!(ep->flags & UCP_EP_FLAG_REMOTE_CONNECTED) && | ||
| (ucp_ep_config(ep)->p2p_lanes != 0)) { |
There was a problem hiding this comment.
p2p_lanes == 0 does not imply the EP is wired. For a client-server (sockaddr/CM) EP the initial config installed by ucp_ep_init_create_wireup() has only a CM lane (rsc_index == UCP_NULL_RESOURCE), and ucp_ep_config_init() skips NULL-resource lanes when computing p2p_lanes, so p2p_lanes == 0 for the whole CM handshake window. In that window this condition skips the early return and ucp_device_remote_mem_list_create_handle() finds no matching lane, returning UCS_ERR_INVALID_PARAM with an ucs_error("lane not found for element ...") log instead of the retryable UCS_ERR_NOT_CONNECTED; later windows where lanes are still ucp_wireup_ep proxies return UCS_ERR_NO_RESOURCE. This breaks the documented retry-on-UCS_ERR_NOT_CONNECTED contract used by the gtest and ucp_cuda_kernel.cu, causing hard failures plus error-log spam. Suggestion:
| (ucp_ep_config(ep)->p2p_lanes != 0)) { | |
| if (!(ep->flags & UCP_EP_FLAG_REMOTE_CONNECTED) && | |
| ((ucp_ep_config(ep)->p2p_lanes != 0) || ucp_ep_has_cm_lane(ep))) { |
| } | ||
|
|
||
| if (!(ep->flags & UCP_EP_FLAG_REMOTE_CONNECTED)) { | ||
| if (!(ep->flags & UCP_EP_FLAG_REMOTE_CONNECTED) && |
There was a problem hiding this comment.
minor: pls add a short comment why p2p_lanes == 0 skips the wait - such EPs are marked LOCAL_CONNECTED in ucp_wireup_init_lanes() and never do the WIREUP handshake, so REMOTE_CONNECTED is never set.
|
Test coverage: |
|
🤖 Starting review — findings will be posted here when done. |
|
|
||
| if (!(ep->flags & UCP_EP_FLAG_REMOTE_CONNECTED)) { | ||
| if (!(ep->flags & UCP_EP_FLAG_REMOTE_CONNECTED) && | ||
| (ucp_ep_config(ep)->p2p_lanes != 0)) { |
There was a problem hiding this comment.
The relaxed check also covers the CM flow, where lanes are not ready yet. p2p_lanes == 0 alone does not mean "endpoint is in its final state". With a CM lane (client-server), ucp_wireup_connect_p2p() returns ucp_worker_is_tl_p2p(), so connectionless device TLs (cuda_ipc/rocm_ipc) are never in p2p_lanes, and the intermediate config created by ucp_ep_init_create_wireup() has only the CM lane. In that window ucp_device_remote_mem_list_create() now proceeds past the connectivity check and fails later in ucp_device_remote_mem_list_create_handle() with ucs_error("lane not found for element ...") / UCS_ERR_INVALID_PARAM, instead of the retryable UCS_ERR_NOT_CONNECTED that the comment right below promises. Please also exclude the CM case here, using the same condition as ucp_proto_reconfig_progress():
| (ucp_ep_config(ep)->p2p_lanes != 0)) { | |
| if (!(ep->flags & UCP_EP_FLAG_REMOTE_CONNECTED) && | |
| ((ucp_ep_config(ep)->p2p_lanes != 0) || ucp_ep_has_cm_lane(ep))) { |
| add_variant_memtypes(variants, get_base_variants, | ||
| UCS_BIT(UCS_MEMORY_TYPE_CUDA) | | ||
| UCS_BIT(UCS_MEMORY_TYPE_HOST)); | ||
| UCS_BIT(UCS_MEMORY_TYPE_CUDA)); |
There was a problem hiding this comment.
Host memtype coverage removed from the existing rc_gda instantiation: rx_mem_type() drives the destination buffer type, so rc,rc_gda loses its host-destination variants. Only the new sm,cuda_ipc instantiation needs cuda-only (cuda_ipc reg_mem_types is CUDA only), so this is a coverage loss on the pre-existing suite. Can we keep host and skip it only for the cuda_ipc variant?
| ipc_addr = uct_cuda_ipc_iface_address_unpack(params->iface_addr, | ||
| iface_addr_len); | ||
| if (same_uuid && | ||
| if (same_uuid && !iface->config.enable_same_process && |
There was a problem hiding this comment.
Same-process reachability is not restricted to the same device. The data-path shortcut in uct_cuda_ipc_map_memhandle() applies only when the local device UUID equals key->uuid. With ENABLE_SAME_PROCESS=y and peers on two GPUs of the same process, the legacy path calls cuIpcOpenMemHandle() on a handle exported by the same process; CUDA_ERROR_ALREADY_MAPPED maps to UCS_ERR_ALREADY_EXISTS and, after invalidate+purge retries, uct_cuda_ipc_cache_put_region() ends in ucs_fatal(). The config text says "same device", but nothing enforces it. Is that case handled, or should the knob be limited to the same device as the description states?
|
Residual coverage gap: the new |
| ipc_addr = uct_cuda_ipc_iface_address_unpack(params->iface_addr, | ||
| iface_addr_len); | ||
| if (same_uuid && | ||
| if (same_uuid && !iface->config.enable_same_process && |
tvegas1
left a comment
There was a problem hiding this comment.
need to add cm lane as bot suggested
…dev_check_connect
|
🤖 Starting review — findings will be posted here when done. |
|
|
||
| if (!(ep->flags & UCP_EP_FLAG_REMOTE_CONNECTED)) { | ||
| if (!(ep->flags & UCP_EP_FLAG_REMOTE_CONNECTED) && | ||
| (ucp_ep_config(ep)->p2p_lanes != 0)) { |
There was a problem hiding this comment.
minor: pls add a short comment explaining when the connected check can be skipped, e.g. which lane state makes it unnecessary - it is not obvious from the device code why p2p_lanes decides this.
|
CM / client-server flow with connectionless device lanes (previously raised): with a CM lane and Missing coverage of Residual gap: no CI job exercises the new branch unless the runner has CUDA IPC; on non-GPU/non-IPC machines the new instantiation skips via Residual gap: pre-fix behavior of the new test is a hang (the |
No description provided.