-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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] Refactor: All tf static graph code should reside inside Policy class. #17169
Merged
sven1977
merged 29 commits into
ray-project:master
from
sven1977:refactor_tf_dynamic_policy_multi_gpu_optim
Jul 20, 2021
Merged
[RLlib] Refactor: All tf static graph code should reside inside Policy class. #17169
sven1977
merged 29 commits into
ray-project:master
from
sven1977:refactor_tf_dynamic_policy_multi_gpu_optim
Jul 20, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ctor_tf_dynamic_policy_multi_gpu_optim
…ctor_tf_dynamic_policy_multi_gpu_optim
…ctor_tf_dynamic_policy_multi_gpu_optim
…ctor_tf_dynamic_policy_multi_gpu_optim
…ctor_tf_dynamic_policy_multi_gpu_optim
…ctor_tf_dynamic_policy_multi_gpu_optim
sven1977
added
tests-ok
The tagger certifies test failures are unrelated and assumes personal liability.
and removed
tests-ok
The tagger certifies test failures are unrelated and assumes personal liability.
labels
Jul 19, 2021
michaelzhiluo
approved these changes
Jul 19, 2021
…ctor_tf_dynamic_policy_multi_gpu_optim
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains a major refactor of the TFPolicy/DynamicTFPolicy and multi-GPU execution code:
In order to be able to efficiently add and remove TFPolicies on-the-fly in the future, we need to make sure that the only objects that hold references into the tf static-graph are our TFPolicies. Currently - when doing multi-GPU - the Trainer objects also contain parts of the graph via the different multi-GPU exec components (TFMultiGPUTrainer and TFMultiGPULearner).
This PR:
LocalSyncParallelOptimizer
into DynamicTFPolicy and renames the class intoTFMultiGPUTowerStack
.TFMultiGPUTowerStack
are held directly by the DynamicTFPolicy now. This will make it possible to cleanly remove graphs from memory (and close the per-policy sessions holding these graphs) in the future.MultiGPUTowerStack
) should be created to unify tf, tf-eager and torch.num_data_loader_buffers
intonum_multi_gpu_tower_stacks
TrainTFMultiGPU
intoMultiGPUTrainOneStep
(vsTrainOneStep
).MultGPULearner
intoMultiGPULearnerThread
(vsLearnerThread
).load_batch_into_buffer
andlearn_on_loaded_batch
to be used by the now framework-agnostic multi-GPU execution classes.TFMultiGPUTowerStack
.Why are these changes needed?
Related issue number
Checks
scripts/format.sh
to lint the changes in this PR.