create¶
-
mxnet.kvstore.create(name='local')[source]¶ Creates a new KVStore.
For single machine training, there are two commonly used types:
local: Copies all gradients to CPU memory and updates weights there.device: Aggregates gradients and updates weights on GPUs. With this setting, the KVStore also attempts to use GPU peer-to-peer communication, potentially accelerating the communication.For distributed training, KVStore also supports a number of types:
dist_sync: Behaves similarly tolocalbut with one major difference. Withdist_sync, batch-size now means the batch size used on each machine. So if there arenmachines and we use batch sizeb, thendist_syncbehaves likelocalwith batch sizen * b.dist_device_sync: Identical todist_syncwith the difference similar todevicevslocal.dist_async: Performs asynchronous updates. The weights are updated whenever gradients are received from any machine. No two updates happen on the same weight at the same time. However, the order is not guaranteed.- Parameters
name ({'local', 'device', 'nccl', 'dist_sync', 'dist_device_sync', 'dist_async'}) – The type of KVStore.
- Returns
kv – The created KVStore.
- Return type