ray.rllib.algorithms.algorithm_config.AlgorithmConfig.framework
ray.rllib.algorithms.algorithm_config.AlgorithmConfig.framework#
- AlgorithmConfig.framework(framework: Optional[str] = <ray.rllib.utils.from_config._NotProvided object>, *, eager_tracing: Optional[bool] = <ray.rllib.utils.from_config._NotProvided object>, eager_max_retraces: Optional[int] = <ray.rllib.utils.from_config._NotProvided object>, tf_session_args: Optional[Dict[str, Any]] = <ray.rllib.utils.from_config._NotProvided object>, local_tf_session_args: Optional[Dict[str, Any]] = <ray.rllib.utils.from_config._NotProvided object>) ray.rllib.algorithms.algorithm_config.AlgorithmConfig [source]#
Sets the config’s DL framework settings.
- Parameters
framework – tf: TensorFlow (static-graph); tf2: TensorFlow 2.x (eager or traced, if eager_tracing=True); torch: PyTorch
eager_tracing – Enable tracing in eager mode. This greatly improves performance (speedup ~2x), but makes it slightly harder to debug since Python code won’t be evaluated after the initial eager pass. Only possible if framework=tf2.
eager_max_retraces – Maximum number of tf.function re-traces before a runtime error is raised. This is to prevent unnoticed retraces of methods inside the
_eager_traced
Policy, which could slow down execution by a factor of 4, without the user noticing what the root cause for this slowdown could be. Only necessary for framework=tf2. Set to None to ignore the re-trace count and never throw an error.tf_session_args – Configures TF for single-process operation by default.
local_tf_session_args – Override the following tf session args on the local worker
- Returns
This updated AlgorithmConfig object.