[XPU] Add forward_xpu to Mixer2RMSNormGated and FusedRMSNormGated (#54968)
Signed-off-by: Marceli Fylcek <marceli.fylcek@intel.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
a89de950a4
commit
5b6cf93e8e
@@ -180,6 +180,13 @@ class Mixer2RMSNormGated(CustomOp):
|
||||
norm_before_gate=False,
|
||||
)
|
||||
|
||||
def forward_xpu(
|
||||
self,
|
||||
x: torch.Tensor,
|
||||
gate: torch.Tensor,
|
||||
) -> torch.Tensor | tuple[torch.Tensor, torch.Tensor]:
|
||||
return self.forward_cuda(x, gate)
|
||||
|
||||
|
||||
def mamba_v2_sharded_weight_loader(
|
||||
shard_spec: list[tuple[int, int, float]],
|
||||
|
||||
@@ -529,6 +529,22 @@ class FusedRMSNormGated(CustomOp):
|
||||
residual_in_fp32=residual_in_fp32,
|
||||
)
|
||||
|
||||
def forward_xpu(
|
||||
self,
|
||||
x: torch.Tensor,
|
||||
g: torch.Tensor,
|
||||
residual: torch.Tensor | None = None,
|
||||
prenorm: bool = False,
|
||||
residual_in_fp32: bool = False,
|
||||
) -> torch.Tensor:
|
||||
return self.forward_cuda(
|
||||
x,
|
||||
g,
|
||||
residual=residual,
|
||||
prenorm=prenorm,
|
||||
residual_in_fp32=residual_in_fp32,
|
||||
)
|
||||
|
||||
|
||||
@triton.heuristics({"IS_VARLEN": lambda args: args["cu_seqlens"] is not None})
|
||||
@triton.autotune(
|
||||
|
||||
Reference in New Issue
Block a user