-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RLlib] Issue 18812: Torch multi-GPU stats not protected against race conditions. #18937
[RLlib] Issue 18812: Torch multi-GPU stats not protected against race conditions. #18937
Conversation
@mvindiola1 ^^ |
…e_18812_torch_multi_gpu_stats_race_condition
…e_18812_torch_multi_gpu_stats_race_condition
…e_18812_torch_multi_gpu_stats_race_condition # Conflicts: # rllib/agents/dqn/r2d2_torch_policy.py # rllib/agents/sac/rnnsac_torch_policy.py
@@ -279,7 +291,7 @@ def extra_action_out_fn(policy: Policy, input_dict, state_batches, model, | |||
postprocess_fn=postprocess_nstep_and_prio, | |||
optimizer_fn=adam_optimizer, | |||
extra_grad_process_fn=grad_process_and_td_error_fn, | |||
extra_learn_fetches_fn=lambda policy: {"td_error": policy._td_error}, | |||
extra_learn_fetches_fn=concat_multi_gpu_td_errors, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better just to hardcode the lambda function directly as a function in the r2d2 policy class
@@ -16,7 +16,7 @@ | |||
from ray.rllib.policy.torch_policy import TorchPolicy | |||
from ray.rllib.utils.annotations import override | |||
from ray.rllib.utils.framework import try_import_torch | |||
from ray.rllib.utils.torch_ops import huber_loss | |||
from ray.rllib.utils.torch_ops import concat_multi_gpu_td_errors, huber_loss |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think its better not to abstract td_errors away
…e_18812_torch_multi_gpu_stats_race_condition # Conflicts: # rllib/agents/impala/vtrace_torch_policy.py # rllib/policy/tf_policy_template.py # rllib/policy/torch_policy.py
…e_18812_torch_multi_gpu_stats_race_condition
Issue 18812: Torch multi-GPU stats not protected against race conditions.
This PR:
Why are these changes needed?
#18812
Related issue number
Closes #18812
Checks
scripts/format.sh
to lint the changes in this PR.