MCPcopy Index your code
hub / github.com/pytorch/pytorch / _BroadcastComputedParamsSingleHost

Function _BroadcastComputedParamsSingleHost

caffe2/python/data_parallel_model.py:1532–1542  ·  view source on GitHub ↗

Average computed params over all devices

(devices, model, use_nccl=False)

Source from the content-addressed store, hash-verified

1530
1531
1532def _BroadcastComputedParamsSingleHost(devices, model, use_nccl=False):
1533 '''
1534 Average computed params over all devices
1535 '''
1536 if len(devices) == 1:
1537 return
1538
1539 for param_name in model._computed_param_names:
1540 # Copy from master to others -- averaging would be perhaps better,
1541 # but currently NCCLAllReduce is too prone to deadlock
1542 _Broadcast(devices, model, model.net, param_name, use_nccl)
1543
1544
1545def _GetReverseOrderedGrads(model):

Callers 2

_BroadcastComputedParamsFunction · 0.85

Calls 1

_BroadcastFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…