Liking cljdoc? Tell your friends :D

org.apache.clojure-mxnet.kvstore


barrierclj

(barrier kvstore)

Global barrier among all worker nodes For example, assume there are n machines, we want to let machine 0 first init the values, and then pull the inited value to all machines. Before pulling, we can place a barrier to guarantee that the initialization is finished.

Global barrier among all worker nodes
For example, assume there are n machines, we want to let machine 0 first
init the values, and then pull the inited value to all machines. Before
pulling, we can place a barrier to guarantee that the initialization is
finished.
raw docstring

createclj

(create)
(create name)

Create a new KVStore WARNING: it is your responsibility to clear this object through dispose.

  • name : #{local, dist} (default is local) The type of KVStore
    • local works for multiple devices on a single machine (single process)
    • dist works for multi-machines (multiple processes)
 Create a new KVStore
WARNING: it is your responsibility to clear this object through dispose.
- name : #{local, dist} (default is local)
     The type of KVStore
     - local works for multiple devices on a single machine (single process)
     - dist works for multi-machines (multiple processes)
raw docstring

disposeclj

(dispose kvstore)

Release the native memory. The object shall never be used after it is disposed.

Release the native memory.
The object shall never be used after it is disposed.
raw docstring

initclj

(init kvstore ks vs)

Initialize a single or a sequence of key-value pairs into the store. For each key, one must init it before push and pull. Only worker 0's (rank == 0) data are used. This function returns after data have been initialized successfully kvstore - KVstore ks - keys (vec or strings or single string) vs - values (vec or NDArrays or single ndarry)

Initialize a single or a sequence of key-value pairs into the store.
For each key, one must init it before push and pull.
Only worker 0's (rank == 0) data are used.
This function returns after data have been initialized successfully
kvstore - KVstore
ks - keys (vec or strings or single string)
vs - values (vec or NDArrays or single ndarry)
raw docstring

load-optimizer-statesclj

(load-optimizer-states kvstore fname)

Load optimizer (updater) state from file

  • kvstore -fname Path to input states file.
Load optimizer (updater) state from file
- kvstore
-fname Path to input states file.
raw docstring

num-dead-nodeclj

(num-dead-node kvstore node-id)

num-workersclj

(num-workers kvstore)

Get the number of worker nodes

Get the number of worker nodes
raw docstring

pullclj

(pull kvstore ks outs)
(pull kvstore ks outs priority)

Pull a single value or a sequence of values from the store. Data consistency:

  1. this function returns after adding an operator to the engine. But any further read on out will be blocked until it is finished.
  2. pull is always called after all previous push and pull on the same key are finished
  3. It pulls the newest value from the store.
  • kvstore
  • ks single or vector of (strings)
  • outs single or vector of outs (NDArrays)
  • priority The priority of the push operation. The higher the priority, the faster this action is likely to be executed before other push actions.
 Pull a single value or a sequence of values from the store.
 Data consistency:
 1. this function returns after adding an operator to the engine. But any
    further read on out will be blocked until it is finished.
 2. pull is always called after all previous push and pull on the same key are finished
 3. It pulls the newest value from the store.
- kvstore
- ks single or vector of (strings)
- outs single or vector of outs (NDArrays)
- priority
    The priority of the push operation.
    The higher the priority, the faster this action is likely
    to be executed before other push actions.
raw docstring

pushclj

(push kvstore ks vs)
(push kvstore ks vs priority)

Push a single or a sequence of key-value pairs into the store. Data consistency:

  1. this function returns after adding an operator to the engine.
  2. push is always called after all previous push and pull on the same key are finished
  3. there is no synchronization between workers. One can use _barrier() to sync all workers

-ks Keys -vs values According values

  • priority The priority of the push operation. The higher the priority, the faster this action is likely to be executed before other push actions.
 Push a single or a sequence of key-value pairs into the store.
 Data consistency:
 1. this function returns after adding an operator to the engine.
 2. push is always called after all previous push and pull on the same key are finished
 3. there is no synchronization between workers. One can use _barrier() to sync all workers

-ks Keys
-vs values  According values
- priority
        The priority of the push operation.
        The higher the priority, the faster this action is likely
        to be executed before other push actions.
raw docstring

rankclj

(rank kvstore)

Get the rank of this worker node returns The rank of this node, which is in [0, get_num_workers())

Get the rank of this worker node
returns The rank of this node, which is in [0, get_num_workers()) 
raw docstring

save-optimizer-statesclj

(save-optimizer-states kvstore fname)

Save optimizer (updater) state to file

  • kvstore
  • fname Path to output states file.
Save optimizer (updater) state to file
- kvstore
- fname Path to output states file.
raw docstring

send-command-to-serversclj

(send-command-to-servers kvstore head body)

Send a command to all server nodes Send a command to all server nodes, which will make each server node run KVStoreServer.controller This function returns after the command has been executed in all server nodes -kvstore -head the head of the command

  • body the body of the command
Send a command to all server nodes
 Send a command to all server nodes, which will make each server node run
 KVStoreServer.controller
 This function returns after the command has been executed in all server nodes
-kvstore
-head the head of the command
- body the body of the command
raw docstring

set-barrier-before-exitclj

(set-barrier-before-exit kvstore barrier-before-exit)

Whether to do barrier when the kvstore finalizes

  • kvstore
  • barrier-before-exit boolean
 Whether to do barrier when the kvstore finalizes
- kvstore
- barrier-before-exit boolean
raw docstring

set-optimizerclj

(set-optimizer kvstore optimizer)

Register an optimizer to the store If there are multiple machines, this process (should be a worker node) will pack this optimizer and send it to all servers. It returns after this action is done

Register an optimizer to the store
If there are multiple machines, this process (should be a worker node)
will pack this optimizer and send it to all servers. It returns after
this action is done
raw docstring

typeclj

(type kvstore)

Get the type of the kvstore

Get the type of the kvstore
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close