RLPack
 
Loading...
Searching...
No Matches
rlpack.simulator_distributed.SimulatorDistributed Class Reference

Similar to rlpack.simulator.Simulator, SimulatorDistributed class sets up agents and runs simulation by interacting with the given environment. More...

Public Member Functions

def __init__ (self, int n_procs, Dict[str, Any] config, str backend="gloo")
 Initialization of class SimulatorDistributed. More...
 
def run (self, **kwargs)
 Runs the simulation in distributed setting. More...
 

Static Public Member Functions

None init_process (int process_rank, int world_size, Callable[[int, int, Dict[str, Any],...], None] func, Dict[str, Any] config, str backend="gloo", **kwargs)
 Initialized the distributed environment to run the given func. More...
 
None run_ (int process_rank, int world_size, Dict[str, Any] config, **kwargs)
 Launches the rlpack.simulator.Simulator in distributed setting. More...
 

Data Fields

 backend
 
 config
 
 n_procs
 

Detailed Description

Similar to rlpack.simulator.Simulator, SimulatorDistributed class sets up agents and runs simulation by interacting with the given environment.

This class simulates the agent-environment interaction parallel, i.e. there will be multiple agents interacting with their local copy of environment. Agents are responsible for maintaining any synchronization.

Constructor & Destructor Documentation

◆ __init__()

def rlpack.simulator_distributed.SimulatorDistributed.__init__ (   self,
int  n_procs,
Dict[str, Any]  config,
str   backend = "gloo" 
)

Initialization of class SimulatorDistributed.

Parameters
n_procsint: The total number of processes to be launched.
configDict[str, Any]: The configuration to be used.
backendstr: The PyTorch multiprocessing backend to be used. Default: "gloo"; the Gloo backend. More information can be found here

Member Function Documentation

◆ init_process()

None rlpack.simulator_distributed.SimulatorDistributed.init_process ( int  process_rank,
int  world_size,
Callable[[int, int, Dict[str, Any], ...], None]  func,
Dict[str, Any]  config,
str   backend = "gloo",
**  kwargs 
)
static

Initialized the distributed environment to run the given func.

Parameters
process_rankint: The process rank of the initialized process.
world_sizeint: Total number of processes launched or to be launched.
funcCallable[[int, int, Dict[str, Any], ...], None]: A function with given signature to be launched in distributed setting on processes.
configDict[str, Any]: The configuration to be used.
backendstr: The PyTorch multiprocessing backend to be used.
kwargsOther keyword arguments for func.

◆ run()

def rlpack.simulator_distributed.SimulatorDistributed.run (   self,
**  kwargs 
)

Runs the simulation in distributed setting.

Parameters
kwargsOther keyword arguments corresponding to rlpack.environments.environments.Environments.train method.

◆ run_()

None rlpack.simulator_distributed.SimulatorDistributed.run_ ( int  process_rank,
int  world_size,
Dict[str, Any]  config,
**  kwargs 
)
static

Launches the rlpack.simulator.Simulator in distributed setting.

Parameters
process_rankint: The process rank of the initialized process.
world_sizeint: Total number of processes launched or to be launched.
configDict[str, Any]: The configuration to be used.
kwargsOther keyword arguments corresponding to rlpack.environments.environments.Environments.train method.

Field Documentation

◆ backend

rlpack.simulator_distributed.SimulatorDistributed.backend

◆ config

rlpack.simulator_distributed.SimulatorDistributed.config

◆ n_procs

rlpack.simulator_distributed.SimulatorDistributed.n_procs