Support true on-policy (#12058)
This commit is contained in:
@@ -593,6 +593,11 @@ class LogitsProcessor(nn.Module):
|
||||
None, # bias
|
||||
True, # is_vnni
|
||||
)
|
||||
elif get_global_server_args().rl_on_policy_target == "fsdp":
|
||||
# Due to tie-weight, we may not be able to change lm_head's weight dtype
|
||||
logits = torch.matmul(
|
||||
hidden_states.bfloat16(), lm_head.weight.T.bfloat16()
|
||||
)
|
||||
else:
|
||||
logits = torch.matmul(
|
||||
hidden_states.to(lm_head.weight.dtype), lm_head.weight.T
|
||||
|
||||
Reference in New Issue
Block a user