Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rllib/algorithms/impala/impala.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,7 @@ def _sample_and_get_connector_states(self):
if num_healthy_remote_workers > 0:
async_results = self.env_runner_group.foreach_env_runner_async_fetch_ready(
func="sample_get_state_and_metrics",
tag="sample_get_state_and_metrics",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the reason for this PR, just an addition I picked up on the way.

timeout_seconds=self.config.timeout_s_sampler_manager,
return_obj_refs=False,
return_actor_ids=True,
Expand Down
12 changes: 6 additions & 6 deletions rllib/env/env_runner_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,12 +557,12 @@ def sync_env_runner_states(
env_runner_states.update(rl_module_state)

# Broadcast updated states back to all workers.
self.foreach_env_runner(
"set_state", # Call the `set_state()` remote method.
self.foreach_env_runner_async_fetch_ready(
func="set_state",
tag="set_state",
kwargs=dict(state=env_runner_states),
remote_worker_ids=env_runner_indices_to_update,
local_env_runner=False,
timeout_seconds=0.0, # This is a state update -> Fire-and-forget.
timeout_seconds=0.0,
)

def foreach_env_runner_async_fetch_ready(
Expand Down Expand Up @@ -708,10 +708,10 @@ def sync_weights(
rl_module_state_ref = ray.put(rl_module_state)

# Sync to specified remote workers in this EnvRunnerGroup.
self.foreach_env_runner(
self.foreach_env_runner_async_fetch_ready(
func="set_state",
tag="set_state",
kwargs=dict(state=rl_module_state_ref),
local_env_runner=False, # Do not sync back to local worker.
remote_worker_ids=to_worker_indices,
timeout_seconds=timeout_seconds,
)
Expand Down