Skip to content
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] Support eager execution in TF2 #4921

Closed
ericl opened this issue Jun 3, 2019 · 2 comments
Closed

[rllib] Support eager execution in TF2 #4921

ericl opened this issue Jun 3, 2019 · 2 comments

Comments

@ericl
Copy link
Contributor

ericl commented Jun 3, 2019

Describe the problem

Currently RLlib disables V2 behavior entirely. We should allow eager execution (at least for a subset of algorithms). This will be easier once #4788 is done.

One possibility is to still use graph mode, but allow eager in the loss function and model with:
https://www.tensorflow.org/api_docs/python/tf/py_function

@ericl
Copy link
Contributor Author

ericl commented Jun 8, 2019

It seems that with ModelV2 we can allow most policy methods, including the model, action distribution, and loss, to be executed eagerly. Currently trying to prototype this in the ModelV2 PR.

@ericl
Copy link
Contributor Author

ericl commented Jun 14, 2019

The long-term solution here is probably to have a separate EagerTFPolicy implementation of TFPolicy that implements the eager strategy. Policies can switch between that and the current TFPolicy. With the new build_tf_policy API, policy definitions should be compatible with either eager or graph execution.

I tried some variations of tf.py_function to allow eager within the existing TFPolicy, but there are some serious limitations there. In particular, variables referenced within tf.py_function aren't picked up when computing gradients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant