﻿# NCCL communicator shrink has two outstanding-work contracts

Distinguish ordinary shrink from aborting parent operations when excluding ranks, then rebuild application ownership for the new rank numbering.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/nccl-communicator-shrink-outstanding-work/
Language: en

## Excluding a rank is not a normal collective retry

A distributed job loses a participant and wants the remaining ranks to continue. Creating a smaller NCCL communicator is a communication operation with its own caller set and outstanding-work contract. It is not a replay of the failed collective under a shorter rank count. Before invoking it, the application must decide which participants survive and what happens to work and data associated with the old communicator generation.

## Only the surviving set participates

The [communicator API reference](https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/api/comms.html) states that shrink is called by the ranks participating in the new communicator; excluded ranks should not call it. The new communicator receives contiguous rank numbering. Preserve stable worker and data identities alongside old and new rank mappings. An array indexed by old rank cannot be assumed to retain the same ownership meaning after renumbering, even if the surviving processes themselves did not restart.

## Ordinary shrink requires quiescent work

The default shrink contract requires no outstanding NCCL operations on the parent, otherwise deadlock can result. This differs from a recovery plan in which failed participants have left communication incomplete. The [lifecycle guide](https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/usage/communicators.html) distinguishes the available shrink modes and recovery context. A host-side return from an earlier collective is not sufficient proof that its execution completed. Establish actual quiescence before claiming that the ordinary path's precondition is satisfied.

## Abort mode changes cleanup and sharing

With NCCL_SHRINK_ABORT, the API documents aborting outstanding parent operations and creating the new communicator without sharing parent resources. The [configuration reference](https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/api/types.html) clarifies that the ordinary shrink-sharing option does not override that separation. This does not turn incomplete outputs into valid application data. Prevent consumers from using uncertain parent results and define which logical model step or accepted checkpoint supplies the restart boundary. Resource cleanup and state recovery remain separate responsibilities.

## Qualify participation and state together

In an authorized isolated failure fixture, verify the surviving caller set, exclusion agreement, mode, old/new rank map and handling of pending work. Validate a correct collective on the new communicator and a correct application continuation using the intended reshaped data ownership. Include an ordinary quiescent shrink as a different control rather than treating it as proof of failure-mode behavior. Acceptance must demonstrate that excluded ranks are not required to rejoin the shrinking call and that survivors do not silently reuse stale rank-indexed state.

## Keep elasticity claims conditional

Shrinking communication alone does not redistribute optimizer shards, repair a partially committed update or guarantee the model supports the smaller topology. Those are application contracts. The [RAS progress guide](/journal/guide-perf-nccl-ras-count-skew/) helps preserve old-generation evidence, while [completion interpretation](/journal/guide-net-rdma-completion/) explains ambiguous transport outcomes. Report successful communicator reconstruction separately from accepted training-state continuation. That distinction prevents a useful fault-tolerance API from being advertised as automatic transparent recovery of arbitrary distributed model work.
