Similar to rlpack.simulator.Simulator, SimulatorDistributed class sets up agents and runs simulation by interacting with the given environment.
More...
|
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...
|
|
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.
◆ __init__()
def rlpack.simulator_distributed.SimulatorDistributed.__init__ |
( |
|
self, |
|
|
int |
n_procs, |
|
|
Dict[str, Any] |
config, |
|
|
str |
backend = "gloo" |
|
) |
| |
Initialization of class SimulatorDistributed.
- Parameters
-
n_procs | int: The total number of processes to be launched. |
config | Dict[str, Any]: The configuration to be used. |
backend | str: The PyTorch multiprocessing backend to be used. Default: "gloo"; the Gloo backend. More information can be found here |
◆ 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_rank | int: The process rank of the initialized process. |
world_size | int: Total number of processes launched or to be launched. |
func | Callable[[int, int, Dict[str, Any], ...], None]: A function with given signature to be launched in distributed setting on processes. |
config | Dict[str, Any]: The configuration to be used. |
backend | str: The PyTorch multiprocessing backend to be used. |
kwargs | Other keyword arguments for func . |
◆ run()
def rlpack.simulator_distributed.SimulatorDistributed.run |
( |
|
self, |
|
|
** |
kwargs |
|
) |
| |
Runs the simulation in distributed setting.
- Parameters
-
kwargs | Other 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_rank | int: The process rank of the initialized process. |
world_size | int: Total number of processes launched or to be launched. |
config | Dict[str, Any]: The configuration to be used. |
kwargs | Other keyword arguments corresponding to rlpack.environments.environments.Environments.train method. |
◆ backend
rlpack.simulator_distributed.SimulatorDistributed.backend |
◆ config
rlpack.simulator_distributed.SimulatorDistributed.config |
◆ n_procs
rlpack.simulator_distributed.SimulatorDistributed.n_procs |