default num_chunks == -1
This commit is contained in:
parent
af709e1dd6
commit
2ff2cdad63
2 changed files with 4 additions and 4 deletions
|
|
@ -127,12 +127,12 @@ class Unsloth{RLConfig_name}({RLConfig_name}):
|
|||
metadata = {{'help': 'vLLM SamplingParams'}},
|
||||
)
|
||||
unsloth_num_chunks : Optional[int] = field(
|
||||
default = 1,
|
||||
metadata = {{'help': 'Chunk size to reduce memory usage'}},
|
||||
default = -1,
|
||||
metadata = {{'help': 'Chunk size to reduce memory usage. -1 is most efficient.'}},
|
||||
)
|
||||
def __init__({RLConfig_arguments},
|
||||
vllm_sampling_params = None,
|
||||
unsloth_num_chunks = 1,
|
||||
unsloth_num_chunks = -1,
|
||||
**kwargs,
|
||||
):
|
||||
{RLConfig_extra_args}
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ def grpo_trainer__get_per_token_logps(function_name, function):
|
|||
if function_name != "_get_per_token_logps": return function
|
||||
|
||||
def _get_per_token_logps(self, model, input_ids, attention_mask, logits_to_keep):
|
||||
if self.args.unsloth_num_chunks != 1: return None
|
||||
return None # Unsloth efficient GRPO
|
||||
if not hasattr(self, '_autocast_dtype'):
|
||||
self._autocast_dtype = torch.float16 if os.environ.get('ACCELERATE_MIXED_PRECISION', 'fp16') == 'fp16' else torch.bfloat16
|
||||
with torch.amp.autocast(device_type = 'cuda', dtype = self._autocast_dtype):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue