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] Minor cleanups in Trainer; better tf/tf2 info messages about possible tracing speedups. #20109

Merged
merged 6 commits into from
Nov 8, 2021

Conversation

sven1977
Copy link
Contributor

@sven1977 sven1977 commented Nov 5, 2021

Minor cleanups in Trainer; metter tf/tf2 info messages about possible tracing speedups.

Why are these changes needed?

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@sven1977 sven1977 changed the title [RLlib] Minor cleanups in Trainer; metter tf/tf2 info messages about possible tracing speedups. [RLlib] Minor cleanups in Trainer; better tf/tf2 info messages about possible tracing speedups. Nov 5, 2021
Copy link
Member

@gjoliver gjoliver left a comment

Choose a reason for hiding this comment

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

A couple of nit picking comments. Looks nice overall.

self.env_creator = _global_registry.get(ENV_CREATOR, env)
# A class specifier.
elif "." in env:
if _global_registry.contains(ENV_CREATOR, self._env_id):
Copy link
Member

Choose a reason for hiding this comment

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

maybe worth breaking everything in this if statement into a little util function, so things don't look so nested here.

"(framework='tf')")
# Tf-static-graph (framework=tf): Recommend upgrading to tf2 and
# enabling eager tracing for similar speed.
elif tf1 and self.config["framework"] == "tf":
Copy link
Member

Choose a reason for hiding this comment

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

haha, maybe we can say this in a more "recommendation" manner, since this user is specifically asking for tf1 here? something like:

You are using tensorflow static-graph mode. Consider setting framework='tf2' to upgrade to tf2.x eager execution, and eager_tracing=True to reach similar execution speed as static-graph mode.

Just a suggestion.

@sven1977 sven1977 merged commit eea6b40 into ray-project:master Nov 8, 2021
@sven1977 sven1977 deleted the tf_tf2_messages branch June 2, 2023 20:16
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

Successfully merging this pull request may close these issues.

2 participants