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

Function AddBlobSync

caffe2/python/data_parallel_model.py:1127–1148  ·  view source on GitHub ↗

Sync a blob across devices and hosts

(model, blobs, net=None)

Source from the content-addressed store, hash-verified

1125
1126
1127def AddBlobSync(model, blobs, net=None):
1128 '''
1129 Sync a blob across devices and hosts
1130 '''
1131 if len(blobs) == 0:
1132 return
1133 net = model.net if net is None else net
1134 for b in blobs:
1135 assert not b.startswith(model._device_prefix), \
1136 "Provide unprefixed blob name: {}".format(b)
1137 model._device_grouped_blobs[b] = {
1138 d: core.BlobReference("{}_{}/{}".format(model._device_prefix, d, b))
1139 for d in model._devices
1140 }
1141
1142 _SyncAllParams(
1143 model._devices,
1144 model,
1145 model.param_init_net,
1146 net,
1147 model._rendezvous,
1148 set(blobs))
1149
1150
1151def AddDistributedBlobSync(model, blobs):

Callers 1

Parallelize_BMUFFunction · 0.85

Calls 2

_SyncAllParamsFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…