Skip to content

CORE: add global init status check - #1303

Open
wfaderhold21 wants to merge 3 commits into
openucx:masterfrom
wfaderhold21:topic/strict_coll_check
Open

CORE: add global init status check#1303
wfaderhold21 wants to merge 3 commits into
openucx:masterfrom
wfaderhold21:topic/strict_coll_check

Conversation

@wfaderhold21

Copy link
Copy Markdown
Collaborator

What

Extends an opt-in asymmetric-datatype check for rooted collectives to include a status check of ucc_coll_init ensuring all ranks either pass or fail.

Why ?

Previously a rank could fail ucc_coll_init and return an error while other ranks may succeed and hang waiting on the failed process.

@greptile-apps

greptile-apps Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extends the optional check_asymmetric_dt mechanism so that all ranks participating in gather/scatter collectives always call ucc_service_dt_check, regardless of whether their local ucc_coll_init succeeded. The local init status is encoded in two new int16_t slots (values[4,5]) in the allreduce buffer using the same min/max trick, allowing all ranks to agree on the global outcome rather than having failed ranks silently exit and leave others hanging.

  • ucc_coll.c: Removes the early-exit after ucc_coll_init for gather/scatter types when check_asymmetric_dt is enabled, passing local_status and a possibly-NULL task to the revised ucc_service_dt_check signature.
  • ucc_service_coll.c: Expands the allreduce payload from 4 to 6 int16_t values, adds a manual schedule-initialization path for the NULL-base_team case, and improves error-path task-completion handling.
  • ucc_coll_utils.c: Fixes ucc_copy_asymmetric_buffer to use task->bargs.team->size (ucc_team_t *, always valid) instead of task->team->params.size (ucc_base_team_t *, now potentially NULL).

Confidence Score: 4/5

Safe to merge; the core hang-prevention logic is correct and force-completion paths are carefully guarded against double-completion.

The scheduling changes correctly encode init status in two extra int16_t slots and always route gather/scatter through ucc_service_dt_check, eliminating the targeted hang. The force-completion pattern correctly prevents ucc_schedule_completed_handler from triggering a second completion. The ucc_coll_utils.c fix correctly switches to task->bargs.team. The change touches several interacting paths in the collective scheduling mechanism, warranting careful review.

src/core/ucc_service_coll.c — the force-completion logic in ucc_dt_check_allreduce_post and ucc_dt_check_actual_wrapper_post interacts non-obviously with the UCC_EVENT_COMPLETED_SCHEDULE firing path.

Important Files Changed

Filename Overview
src/core/ucc_coll.c Removes early-exit guards around ucc_coll_init for gather/scatter types when check_asymmetric_dt is enabled; all ranks now reach ucc_service_dt_check regardless of local status. Scratch-buffer cleanup before the call is correct.
src/core/ucc_service_coll.c Allreduce payload grows to 6 int16_t slots; manual schedule init for NULL-base_team case; force-completion paths set n_completed_tasks = n_tasks before calling ucc_task_complete on the schedule, correctly preventing double-complete from the subsequent UCC_EVENT_COMPLETED_SCHEDULE.
src/core/ucc_service_coll.h Updated docstring and signature for ucc_service_dt_check; clearly documents the must-be-called-on-every-rank contract.
src/schedule/ucc_schedule.h ucc_dt_check_state gains a 6th slot pair for init-status encoding and a new ar_status field for service-allreduce failures.
src/utils/ucc_coll_utils.c Fixes ucc_copy_asymmetric_buffer to use task->bargs.team->size (always valid) instead of task->team->params.size (now potentially NULL).

Reviews (4): Last reviewed commit: "REVIEW: extend dt check to include init ..." | Re-trigger Greptile

Comment thread src/core/ucc_coll.c
Comment thread src/core/ucc_service_coll.c Outdated
Comment thread src/core/ucc_service_coll.c
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.

1 participant