MCPcopy
hub / github.com/Robbyant/lingbot-world / gather_forward

Function gather_forward

wan/distributed/util.py:42–50  ·  view source on GitHub ↗
(input, dim)

Source from the content-addressed store, hash-verified

40
41
42def gather_forward(input, dim):
43 # skip if world_size == 1
44 world_size = dist.get_world_size()
45 if world_size == 1:
46 return input
47
48 # gather sequence
49 output = all_gather(input)
50 return torch.cat(output, dim=dim).contiguous()

Callers 6

forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
sp_dit_forwardFunction · 0.85
sp_dit_forward_causalFunction · 0.85

Calls 1

all_gatherFunction · 0.85

Tested by

no test coverage detected