ray.rllib.algorithms.algorithm_config.AlgorithmConfig.get_rollout_fragment_length#
- AlgorithmConfig.get_rollout_fragment_length(worker_index: int = 0) int[source]#
Automatically infers a proper rollout_fragment_length setting if “auto”.
Uses the simple formula:
rollout_fragment_length=total_train_batch_size/ (num_envs_per_env_runner*num_env_runners)If result is a fraction AND
worker_indexis provided, makes those workers add additional timesteps, such that the overall batch size (across the workers) adds up to exactly thetotal_train_batch_size.- Returns:
The user-provided
rollout_fragment_lengthor a computed one (if user provided value is “auto”), making suretotal_train_batch_sizeis reached exactly in each iteration.