Update rl_replacements.py
This commit is contained in:
parent
442d3170e8
commit
fe73b86c61
1 changed files with 3 additions and 2 deletions
|
|
@ -176,8 +176,9 @@ def grpo_trainer__prepare_inputs(function_name, function):
|
|||
|
||||
"with torch.inference_mode(), "\
|
||||
"torch.amp.autocast(device_type = 'cuda', "\
|
||||
"dtype = torch.float16 if os.environ.get('ACCELERATE_MIXED_PRECISION', 'fp16') == 'fp16' else torch.bfloat16) "\
|
||||
"if not torch.is_autocast_enabled('cuda') else nullcontext():",
|
||||
"dtype = ((torch.float16 if os.environ.get('ACCELERATE_MIXED_PRECISION', 'fp16') == 'fp16' else torch.bfloat16) "\
|
||||
"if not torch.is_autocast_enabled('cuda') else nullcontext())"\
|
||||
"if os.environ.get('UNSLOTH_FORCE_FLOAT32', '0') == '0' else torch.float16):",
|
||||
)
|
||||
|
||||
# Disable attaching a float32 conversion hook which upcasts logits to FP32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue