[NPU] Support fsdp for rl_on_policy_target (#29128)

This commit is contained in:
silencejade
2026-06-24 14:57:19 +08:00
committed by GitHub
parent 26e1d4d847
commit 6c6fa19a90
@@ -128,9 +128,10 @@ class RotaryEmbedding(MultiPlatformOp):
# XXX (MUSA): Implement sgl_kernel.rotary_embedding support for MUSA backend
if get_global_server_args().rl_on_policy_target is not None or _is_musa:
self._forward_method = self.forward_native
self._apply_rotary_emb_wrapped = torch.compile(dynamic=True)(
apply_rotary_emb
)
self._apply_rotary_emb_wrapped = torch.compile(
dynamic=True,
disable=_is_npu,
)(apply_rotary_emb)
self.position_cos, self.position_sin = None, None
def _match_cos_sin_cache_dtype(self, query: torch.Tensor) -> None: