r""" Configuration class for the [`GRPOTrainer`]. Only the parameters specific to GRPO training are listed here. For details on other parameters, refer to the [`~transformers.TrainingArguments`] documentation. Using [`~transformers.HfArgumentParser`] we can turn this class into
| 44 | |
| 45 | @dataclass |
| 46 | class GRPOTrainingConfig(TrainingArguments): |
| 47 | r""" |
| 48 | Configuration class for the [`GRPOTrainer`]. |
| 49 | |
| 50 | Only the parameters specific to GRPO training are listed here. For details on other parameters, refer to the |
| 51 | [`~transformers.TrainingArguments`] documentation. |
| 52 | |
| 53 | Using [`~transformers.HfArgumentParser`] we can turn this class into |
| 54 | [argparse](https://docs.python.org/3/library/argparse#module-argparse) arguments that can be specified on the |
| 55 | command line. |
| 56 | |
| 57 | Parameters: |
| 58 | > Parameters that control the model and reference model |
| 59 | |
| 60 | model_init_kwargs (`dict[str, Any]` or `None`, *optional*, defaults to `None`): |
| 61 | Keyword arguments for [`~transformers.AutoModelForCausalLM.from_pretrained`], used when the `model` |
| 62 | argument of the [`GRPOTrainer`] is provided as a string. |
| 63 | |
| 64 | > Parameters that control the data preprocessing |
| 65 | |
| 66 | remove_unused_columns (`bool`, *optional*, defaults to `False`): |
| 67 | Whether to only keep the column `"prompt"` in the dataset. If you use a custom reward function that |
| 68 | requires any column other than `"prompts"` and `"completions"`, you should keep this to `False`. |
| 69 | max_prompt_length (`int` or `None`, *optional*, defaults to `512`): |
| 70 | Maximum length of the prompt. If the prompt is longer than this value, it will be truncated left. |
| 71 | num_generations (`int` or `None`, *optional*, defaults to `8`): |
| 72 | Number of generations per prompt to sample. The global batch size (num_processes * per_device_batch_size) |
| 73 | must be divisible by this value. |
| 74 | temperature (`float`, *optional*, defaults to `0.9`): |
| 75 | Temperature for sampling. The higher the temperature, the more random the completions. |
| 76 | max_completion_length (`int` or `None`, *optional*, defaults to `256`): |
| 77 | Maximum length of the generated completion. |
| 78 | ds3_gather_for_generation (`bool`, *optional*, defaults to `True`): |
| 79 | This setting applies to DeepSpeed ZeRO-3. If enabled, the policy model weights are gathered for generation, |
| 80 | improving generation speed. However, disabling this option allows training models that exceed the VRAM |
| 81 | capacity of a single GPU, albeit at the cost of slower generation. Disabling this option is not compatible |
| 82 | with vLLM generation. |
| 83 | |
| 84 | > Parameters that control generation acceleration powered by vLLM |
| 85 | |
| 86 | use_vllm (`bool`, *optional*, defaults to `False`): |
| 87 | Whether to use vLLM for generating completions. If set to `True`, ensure that a GPU is kept unused for |
| 88 | training, as vLLM will require one for generation. vLLM must be installed (`pip install vllm`). |
| 89 | vllm_device (`str`, *optional*, defaults to `"auto"`): |
| 90 | Device where vLLM generation will run, e.g. `"cuda:1"`. If set to `"auto"` (default), the system will |
| 91 | automatically select the next available GPU after the last one used for training. This assumes that |
| 92 | training has not already occupied all available GPUs. If only one device is available, the device will be |
| 93 | shared between both training and vLLM. |
| 94 | vllm_gpu_memory_utilization (`float`, *optional*, defaults to `0.9`): |
| 95 | Ratio (between 0 and 1) of GPU memory to reserve for the model weights, activations, and KV cache on the |
| 96 | device dedicated to generation powered by vLLM. Higher values will increase the KV cache size and thus |
| 97 | improve the model's throughput. However, if the value is too high, it may cause out-of-memory (OOM) errors |
| 98 | during initialization. |
| 99 | vllm_dtype (`str`, *optional*, defaults to `"auto"`): |
| 100 | Data type to use for vLLM generation. If set to `"auto"`, the data type will be automatically determined |
| 101 | based on the model configuration. Find the supported values in the vLLM documentation. |
| 102 | vllm_max_model_len (`int` or `None`, *optional*, defaults to `None`): |
| 103 | If set, the `max_model_len` to use for vLLM. This could be useful when running with reduced |
nothing calls this directly
no outgoing calls
no test coverage detected