All-Gather is a collective communication primitive where every worker broadcasts its local shard and receives all other workers' shards, so that each worker ends up with the complete tensor.
It is used in:
Signature: def all_gather(shards)
shards: 2-D array of shape (num_workers, shard_size) — row i is worker i's local shard(num_workers * shard_size,) — shards concatenated in rank orderMath
Asked at
import numpy as np
def all_gather(...):
pass
Premium problem
Free accounts include problems #1–20. Upgrade to unlock the editor, hidden test cases, and reference solutions for every problem.
Already premium?