MPISymetricRoleMaker

class paddle.fluid.incubate.fleet.base.role_maker. MPISymetricRoleMaker [source]

MPISymetricRoleMaker is designed for worker and server assignment under MPI. Typically, a worker and a server node will be appointed on each physical node. This role maker can be only used under MPI.

all_gather ( input )

all gather between trainers and pservers

Parameters

input (int|float) – input value

Returns

return a list of values

all_reduce_worker ( input, output, mode='sum' )

all reduce between trainers if current role is TRAINER, only support array of one dim.

Parameters
  • input (list/numpy.array) – array of one dim

  • output (list/numpy.array) – array of one dim

  • mode (str) – “sum” or “min” or “max”

barrier_worker ( )

barrier between trainers if current role is TRAINER

barrier_all ( )

barrier between trainers if current role is PSERVER

is_first_worker ( )

return whether current process is the first worker assigned by role maker

get_pserver_endpoints ( )

get pserver endpoints :returns: pserver endpoints :rtype: endpoints(list)

worker_num ( )

Get current total worker number.

Returns

worker number

Return type

int

is_worker ( )

return whether current process is worker assigned by role maker

is_server ( )

return whether current process is server assigned by role maker

worker_index ( )

return the index of worker

server_index ( )

return the index of server

generate_role ( )

generate currently process’s role

get_local_ip ( )

Return get local ip.

get_trainer_endpoints ( )

return trainer endpoints