[Kernel] Remove unused fake implementation (#55535)

Signed-off-by: Jee Jee Li <jeejeelee@inferact.ai>
This commit is contained in:
Jee Jee Li
2026-09-06 17:54:32 -07:00
committed by GitHub
parent 4df80187b5
commit 199cb9b964
39 changed files with 7 additions and 956 deletions
@@ -546,20 +546,10 @@ def olmo_hybrid_gdn_full_forward(
)
def olmo_hybrid_gdn_full_forward_fake(
hidden_states: torch.Tensor,
output: torch.Tensor,
layer_name: str,
) -> None:
"""Fake implementation for torch.compile."""
return
direct_register_custom_op(
op_name="olmo_hybrid_gdn_full_forward",
op_func=olmo_hybrid_gdn_full_forward,
mutates_args=["output"],
fake_impl=olmo_hybrid_gdn_full_forward_fake,
)
@@ -1949,23 +1949,10 @@ def qwen_gdn_attention_core(
)
def gdn_attention_core_fake(
qkv_or_qkvz: torch.Tensor,
b_or_ba: torch.Tensor,
a_or_z_out: torch.Tensor,
core_attn_out: torch.Tensor,
layer_name: LayerNameType,
use_aiter: bool = False,
) -> None:
"""Fake implementation for torch.compile."""
return
direct_register_custom_op(
op_name="qwen_gdn_attention_core",
op_func=qwen_gdn_attention_core,
mutates_args=["a_or_z_out", "core_attn_out"],
fake_impl=gdn_attention_core_fake,
)
@@ -1985,20 +1972,10 @@ def qwen_gdn_attention_core_fused_norm_packed(
)
def gdn_attention_core_fused_norm_packed_fake(
mixed_qkvz: torch.Tensor,
ba: torch.Tensor,
core_attn_out: torch.Tensor,
layer_name: LayerNameType,
) -> None:
return
direct_register_custom_op(
op_name="qwen_gdn_attention_core_fused_norm_packed",
op_func=qwen_gdn_attention_core_fused_norm_packed,
mutates_args=["core_attn_out"],
fake_impl=gdn_attention_core_fused_norm_packed_fake,
)
@@ -336,18 +336,8 @@ def linear_attention(
self._forward(hidden_states=hidden_states, output=output, positions=positions)
def linear_attention_fake(
hidden_states: torch.Tensor,
output: torch.Tensor,
positions: torch.Tensor,
layer_name: str,
) -> None:
return
direct_register_custom_op(
op_name="linear_attention",
op_func=linear_attention,
mutates_args=["output"],
fake_impl=linear_attention_fake,
)
@@ -532,17 +532,8 @@ def mamba_mixer(
self.forward_impl(hidden_states=hidden_states, output=output)
def mamba_mixer_fake(
hidden_states: torch.Tensor,
output: torch.Tensor,
layer_name: LayerNameType,
) -> None:
return
direct_register_custom_op(
op_name="mamba_mixer",
op_func=mamba_mixer,
mutates_args=["output"],
fake_impl=mamba_mixer_fake,
)
@@ -1271,17 +1271,8 @@ def mamba_mixer2(
self.conv_ssm_forward(projected_states=projected_states, output=output)
def mamba_mixer2_fake(
projected_states: torch.Tensor,
output: torch.Tensor,
layer_name: LayerNameType,
) -> None:
return
direct_register_custom_op(
op_name="mamba_mixer2",
op_func=mamba_mixer2,
mutates_args=["output"],
fake_impl=mamba_mixer2_fake,
)
@@ -718,17 +718,6 @@ def _spec_aware_nonspec_subset(
return attn_out.squeeze(0)
def cpu_gdn_attention_core_fake(
mixed_qkv: torch.Tensor,
b: torch.Tensor,
a: torch.Tensor,
core_attn_out: torch.Tensor,
layer_name: LayerNameType,
) -> None:
"""Fake implementation for torch.compile."""
return
def register_cpu_gdn_attention_ops() -> None:
global _CPU_GDN_ATTENTION_OPS_REGISTERED
if _CPU_GDN_ATTENTION_OPS_REGISTERED:
@@ -738,6 +727,5 @@ def register_cpu_gdn_attention_ops() -> None:
op_name="cpu_gdn_attention_core",
op_func=cpu_gdn_attention_core,
mutates_args=["core_attn_out"],
fake_impl=cpu_gdn_attention_core_fake,
)
_CPU_GDN_ATTENTION_OPS_REGISTERED = True
@@ -373,17 +373,8 @@ def short_conv(
self.forward_native(hidden_states=hidden_states, output=output)
def short_conv_fake(
hidden_states: torch.Tensor,
output: torch.Tensor,
layer_name: str,
) -> None:
return
direct_register_custom_op(
op_name="short_conv",
op_func=short_conv,
mutates_args=["output"],
fake_impl=short_conv_fake,
)