Proxy Variable

Parameter Server Proxy Variable.

This Proxy variable is a cached replica of the PS-stored variable on each worker, allowing for faster reads (no need to make a network call).

class ProxyVariable(resource_var, graph_item, proxy_device)[source]

Bases: object

Proxy variable implementation.

get_all_update_ops(grad_apply_finished, worker_device=None)[source]

Create and return new update ops for proxy vars.

Parameters
  • grad_apply_finished (List[Operation]) – ops with which to colocate the new ops.

  • worker_device (DeviceSpecV2) – the device on which to create the ops.

Returns

the list of update ops for each proxy variable.

Return type

List[Operation]

update_colocation_group(get_colocation_op)[source]

Update operations colocated with master variables to be colocated with proxy variables.

Parameters

get_colocation_op (Callable) – fn that gets the current colocation ops