Add `Communicator::abort()` to notify all ranks of an unrecoverable error #1348
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.50) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 587 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.382
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #1348"
general
weight: 0.35
wence-
When an operation fails on one rank, e.g., a collective that raised an exception (see https://github.com/rapidsai/rapidsmpf/issues/1259 and https://github.com/rapidsai/rapidsmpf/pull/1347), the other ranks may wait forever for messages that will never arrive.
Communicator::abort(reason, terminate=false)(Python:Communicator.abort()) marks the communicator as aborted on this rank and notifies the other ranks, best effort, which mark it as aborted too. From then on, communication through the communicator throwscommunicator_aborted(Python:rapidsmpf.error.CommunicatorAborted, see https://github.com/rapidsai/rapidsmpf/pull/1327), including from the operations waiting on it: the shuffler and the collectives check the abort on every iteration of their progress function, so every rank gets an exception it can handle.abort()then still notifies the other ranks, unless they were notified already or another rank aborted the communicator, which notified them. Withoutabort(), such an abort is notified the first timethrow_if_aborted()observes it, since a destructor cannot notify.abort()is best effort. It is always printed tostderr.terminate=true, the processes of all ranks are terminated instead, without unwinding:MPI_Abort()with MPI, and every rank terminating upon receiving the abort message with UCXX. The other ranks are not notified cooperatively first, so that they don't start unwinding.MPI::poll_abort()probes for them every 16 calls ofthrow_if_aborted(). With UCXX, the worker's progress thread receives them, and in polling modeUCXX::poll_abort()progresses the worker every 16 calls.MPI::wait()andwait_all()test instead of blocking, so that they fail once aborted.throw_if_aborted()is now public, since the operations call it. The new protectedpoll_abort(),notify_abort()andmark_aborted()have default implementations, so there is no breaking change: backends that don't override them only abort locally.RapidsMPF never calls
abort()itself: errors are reported as exceptions, and it is up to the application to decide whether an error is recoverable or whether the communicator must be aborted.MPI abort notifications use the largest MPI tag. The other ranks are notified with a message on
MPI_TAG_UBof the user's communicator. If it lies above the range of rapidsmpf'sTag(2^23 - 1, a 20-bitOpIDand a 3-bit stage), as with Open MPI's defaultob1PML (2^31 - 1),this is invisible to rapidsmpf users. If it doesn't, e.g., with OpenMPI's UCX PML, where
MPI_TAG_UBis exactly 2^23 - 1, the largestTag(the last stage of the largestOpID) is reserved for the notifications, and MPI sends and receives on it throwstd::invalid_argument. Notifications that are never received stay unmatched on the communicator, where an application usingMPI_TAG_UBorMPI_ANY_TAGon the same communicator could receive them.This is open for discussion. Alternatives considered:
Tagis reserved. However,MPI_Comm_dupis collective, which would make constructingrapidsmpf::MPIcollective, and the duplicate must be freed while MPI is still usable.Tagby one bit whenMPI_TAG_UBhas no headroom. That changes the limits ofOpID/StageIDdepending on the MPI configuration, which is surprising, and affects all backends.Tests check that operations throw once aborted, also unfinished ones without pending communication, and that aborts reach all ranks with MPI and UCXX: an explicit abort, an abort caused by destroying in-flight communication, and
abort()after such an abort, with no other check that would notify the peers. In Python, child processes check cooperative aborts and termination with UCXX and Single, and an MPI test checks propagation.Closes #1259 .
Note for reviewers: depends on https://github.com/rapidsai/rapidsmpf/pull/1347 and the only novel change is https://github.com/rapidsai/rapidsmpf/commit/385909107c48270ed9745fe97c6c06a96dd8a113 .