class ray.rllib.core.learner.learner.FrameworkHyperparameters(eager_tracing: bool = True, torch_compile: bool = False, what_to_compile: str = TorchCompileWhatToCompile.FORWARD_TRAIN, torch_compile_cfg: TorchCompileConfig | None = None)[source]#

The framework specific hyper-parameters.

  • eager_tracing – Whether to trace the model in eager mode. This enables tf tracing mode by wrapping the loss function computation in a tf.function. This is useful for speeding up the training loop. However, it is not compatible with all tf operations. For example, tf.print is not supported in tf.function.

  • torch_compile – Whether to use torch.compile() within the context of a given learner.

  • what_to_compile – What to compile when using torch.compile(). Can be one of [TorchCompileWhatToCompile.complete_update, TorchCompileWhatToCompile.forward_train]. If complete_update, the update step of the learner will be compiled. This includes the forward pass of the RLModule, the loss computation, and the optimizer step. If forward_train, only the forward methods (and therein the forward_train method) of the RLModule will be compiled. Either of the two may lead to different performance gains in different settings. complete_update promises the highest performance gains, but may not work in some settings. By compiling only forward_train, you may already get some speedups and avoid issues that arise from compiling the entire update.

  • troch_compile_config – The TorchCompileConfig to use for compiling the RL Module in Torch.