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 tolocal
but with one major difference. Withdist_sync
, batch-size now means the batch size used on each machine. So if there aren
machines and we use batch sizeb
, thendist_sync
behaves likelocal
with batch sizen * b
.dist_device_sync
: Identical todist_sync
with the difference similar todevice
vslocal
.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