ray.rllib.algorithms.algorithm_config.AlgorithmConfig.validate_train_batch_size_vs_rollout_fragment_length#

AlgorithmConfig.validate_train_batch_size_vs_rollout_fragment_length() None[source]#

Detects mismatches for train_batch_size vs rollout_fragment_length.

Only applicable for algorithms, whose train_batch_size should be directly dependent on rollout_fragment_length (synchronous sampling, on-policy PG algos).

If rollout_fragment_length != “auto”, makes sure that the product of rollout_fragment_length x num_env_runners x num_envs_per_env_runner roughly (10%) matches the provided train_batch_size. Otherwise, errors with asking the user to set rollout_fragment_length to auto or to a matching value.

Also, only checks this if train_batch_size > 0 (DDPPO sets this to -1 to auto-calculate the actual batch size later).

Raises:

ValueError – If there is a mismatch between user provided rollout_fragment_length and total_train_batch_size.