[Auto Sync] Update activation.py, logits_processor.py, rota... (20251107) (#12853)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Stefan He <hebiaobuaa@gmail.com>
This commit is contained in:
Lianmin Zheng
2025-11-07 22:07:51 -08:00
committed by GitHub
co-authored by github-actions[bot] <github-actions[bot]@users.noreply.github.com> Stefan He
parent e039ff382c
commit 0296f1cdad
7 changed files with 21 additions and 15 deletions
+3 -3
View File
@@ -127,7 +127,7 @@ class RotaryEmbedding(CustomOp):
self._apply_rotary_emb_wrapped = _apply_rotary_emb
if get_global_server_args().rl_on_policy_target == "fsdp":
if get_global_server_args().rl_on_policy_target is not None:
self._forward_method = self.forward_native
self._apply_rotary_emb_wrapped = torch.compile(dynamic=True)(
self._apply_rotary_emb_wrapped
@@ -140,7 +140,7 @@ class RotaryEmbedding(CustomOp):
# create the cache on GPU for faster initialization. This may cause
# a slight numerical difference between the HF implementation and ours.
init_device = (
"cpu" if get_global_server_args().rl_on_policy_target == "fsdp" else None
"cpu" if get_global_server_args().rl_on_policy_target is not None else None
)
inv_freq = 1.0 / (
base
@@ -151,7 +151,7 @@ class RotaryEmbedding(CustomOp):
/ self.rotary_dim
)
)
if get_global_server_args().rl_on_policy_target == "fsdp":
if get_global_server_args().rl_on_policy_target is not None:
inv_freq = inv_freq.cuda()
return inv_freq