[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
@@ -869,156 +869,23 @@ def _fused_moe_lora_fp8(
)
def _fused_moe_lora_fp8_fake(
output: torch.Tensor,
qcurr_hidden_states: torch.Tensor,
lora_a_stacked: list[torch.Tensor],
lora_b_stacked: list[torch.Tensor],
topk_weights: torch.Tensor,
sorted_token_ids: torch.Tensor | None,
expert_ids: torch.Tensor,
num_tokens_post_padded: torch.Tensor | None,
token_lora_mapping: torch.Tensor,
max_lora_rank: int,
top_k_num: int,
lora_ids: torch.Tensor,
num_active_loras: int,
adapter_enabled: torch.Tensor,
shrink_block_size_m: int,
shrink_block_size_n: int,
shrink_block_size_k: int,
shrink_group_size_m: int,
shrink_num_warps: int,
shrink_num_stages: int,
shrink_split_k: int,
expand_block_size_m: int,
expand_block_size_n: int,
expand_block_size_k: int,
expand_group_size_m: int,
expand_num_warps: int,
expand_num_stages: int,
expand_split_k: int,
lora_a_scale_stacked: list[torch.Tensor],
lora_b_scale_stacked: list[torch.Tensor],
mul_routed_weight: bool = False,
fully_sharded: bool = False,
offset: int = 0,
shrink_act_scale: torch.Tensor | None = None,
expand_act_scale: torch.Tensor | None = None,
use_fp8_w8a8: bool = False,
use_int8_w8a8: bool = False,
use_int8_w8a16: bool = False,
per_channel_quant: bool = False,
block_shape: List[int] | None = None, # noqa: UP006, UP007
) -> None:
return
def _fused_moe_lora_shrink_fp8_fake(
a_intermediate_cache1: torch.Tensor,
qcurr_hidden_states: torch.Tensor,
lora_a_stacked: list[torch.Tensor],
topk_weights: torch.Tensor,
sorted_token_ids: torch.Tensor | None,
expert_ids: torch.Tensor,
num_tokens_post_padded: torch.Tensor | None,
token_lora_mapping: torch.Tensor,
top_k_num: int,
lora_ids: torch.Tensor,
adapter_enabled: torch.Tensor,
device: torch.device,
N: int,
M: int,
EM: int,
K: int,
num_tokens: int,
num_experts: int,
num_slices: int,
block_size_m: int,
block_size_n: int,
block_size_k: int,
group_size_m: int,
num_warps: int,
num_stages: int,
split_k: int,
num_active_loras: int,
lora_a_scale_stacked: list[torch.Tensor],
mul_routed_weight: bool = False,
use_gdc: bool = False,
act_scale: torch.Tensor | None = None,
use_fp8_w8a8: bool = False,
use_int8_w8a8: bool = False,
use_int8_w8a16: bool = False,
per_channel_quant: bool = False,
block_shape: List[int] | None = None, # noqa: UP006, UP007
) -> None:
return
def _fused_moe_lora_expand_fp8_fake(
output: torch.Tensor,
a_intermediate_cache1: torch.Tensor,
lora_b_stacked: list[torch.Tensor],
topk_weights: torch.Tensor,
sorted_token_ids: torch.Tensor | None,
expert_ids: torch.Tensor,
num_tokens_post_padded: torch.Tensor | None,
token_lora_mapping: torch.Tensor,
top_k_num: int,
lora_ids: torch.Tensor,
adapter_enabled: torch.Tensor,
device: torch.device,
N: int,
M: int,
EM: int,
K: int,
num_tokens: int,
num_experts: int,
num_slices: int,
max_lora_rank: int,
w1_output_dim_size: int,
block_size_m: int,
block_size_n: int,
block_size_k: int,
group_size_m: int,
num_warps: int,
num_stages: int,
split_k: int,
num_active_loras: int,
act_scale: torch.Tensor,
lora_b_scale_stacked: list[torch.Tensor],
mul_routed_weight: bool = False,
offset: int = 0,
use_fp8_w8a8: bool = False,
use_int8_w8a8: bool = False,
use_int8_w8a16: bool = False,
per_channel_quant: bool = False,
block_shape: List[int] | None = None, # noqa: UP006, UP007
use_gdc: bool = False,
) -> None:
return
try:
direct_register_custom_op(
op_name="fused_moe_lora_fp8",
op_func=_fused_moe_lora_fp8,
mutates_args=["output"],
fake_impl=_fused_moe_lora_fp8_fake,
)
direct_register_custom_op(
op_name="fused_moe_lora_shrink_fp8",
op_func=_fused_moe_lora_shrink_fp8,
mutates_args=["a_intermediate_cache1"],
fake_impl=_fused_moe_lora_shrink_fp8_fake,
)
direct_register_custom_op(
op_name="fused_moe_lora_expand_fp8",
op_func=_fused_moe_lora_expand_fp8,
mutates_args=["output"],
fake_impl=_fused_moe_lora_expand_fp8_fake,
)
fused_moe_lora_fp8 = torch.ops.vllm.fused_moe_lora_fp8
@@ -1662,136 +1662,23 @@ def _fused_moe_lora(
)
def _fused_moe_lora_fake(
output: torch.Tensor,
qcurr_hidden_states: torch.Tensor,
lora_a_stacked: list[torch.Tensor],
lora_b_stacked: list[torch.Tensor],
topk_weights: torch.Tensor,
sorted_token_ids: torch.Tensor | None,
expert_ids: torch.Tensor,
num_tokens_post_padded: torch.Tensor | None,
token_lora_mapping: torch.Tensor,
max_lora_rank: int,
top_k_num: int,
lora_ids: torch.Tensor,
num_active_loras: torch.Tensor, # CPU tensor [1], number of active LoRAs
adapter_enabled: torch.Tensor,
shrink_block_size_m: int,
shrink_block_size_n: int,
shrink_block_size_k: int,
shrink_group_size_m: int,
shrink_num_warps: int,
shrink_num_stages: int,
shrink_split_k: int,
expand_block_size_m: int,
expand_block_size_n: int,
expand_block_size_k: int,
expand_group_size_m: int,
expand_num_warps: int,
expand_num_stages: int,
expand_split_k: int,
mul_routed_weight: bool = False,
fully_sharded: bool = False,
offset: int = 0,
add_inputs: bool = True,
) -> None:
return
def _fused_moe_lora_shrink_fake(
a_intermediate_cache1: torch.Tensor,
qcurr_hidden_states: torch.Tensor,
lora_a_stacked: list[torch.Tensor],
topk_weights: torch.Tensor,
sorted_token_ids: torch.Tensor | None,
expert_ids: torch.Tensor,
num_tokens_post_padded: torch.Tensor | None,
token_lora_mapping: torch.Tensor,
top_k_num: int,
lora_ids: torch.Tensor,
adapter_enabled: torch.Tensor,
device: torch.device,
N: int,
M: int,
EM: int,
K: int,
num_tokens: int,
num_experts: int,
num_slices: int,
block_size_m: int,
block_size_n: int,
block_size_k: int,
group_size_m: int,
num_warps: int,
num_stages: int,
split_k: int,
num_active_loras: torch.Tensor, # CPU tensor [1], number of active LoRAs
mul_routed_weight: bool = False,
use_gdc: bool = False,
use_tma: bool = False,
) -> None:
return
def _fused_moe_lora_expand_fake(
output: torch.Tensor,
a_intermediate_cache1: torch.Tensor,
lora_b_stacked: list[torch.Tensor],
topk_weights: torch.Tensor,
sorted_token_ids: torch.Tensor | None,
expert_ids: torch.Tensor,
num_tokens_post_padded: torch.Tensor | None,
token_lora_mapping: torch.Tensor,
top_k_num: int,
lora_ids: torch.Tensor,
adapter_enabled: torch.Tensor,
device: torch.device,
N: int,
M: int,
EM: int,
K: int,
num_tokens: int,
num_experts: int,
num_slices: int,
max_lora_rank: int,
w1_output_dim_size: int,
block_size_m: int,
block_size_n: int,
block_size_k: int,
group_size_m: int,
num_warps: int,
num_stages: int,
split_k: int,
num_active_loras: torch.Tensor, # CPU tensor [1], number of active LoRAs
mul_routed_weight: bool = False,
offset: int = 0,
use_gdc: bool = False,
use_tma: bool = False,
) -> None:
return
try:
direct_register_custom_op(
op_name="fused_moe_lora",
op_func=_fused_moe_lora,
mutates_args=["output"],
fake_impl=_fused_moe_lora_fake,
)
direct_register_custom_op(
op_name="fused_moe_lora_shrink",
op_func=_fused_moe_lora_shrink,
mutates_args=["a_intermediate_cache1"],
fake_impl=_fused_moe_lora_shrink_fake,
)
direct_register_custom_op(
op_name="fused_moe_lora_expand",
op_func=_fused_moe_lora_expand,
mutates_args=["output"],
fake_impl=_fused_moe_lora_expand_fake,
)
fused_moe_lora = torch.ops.vllm.fused_moe_lora
@@ -367,35 +367,11 @@ def _lora_expand_fp8(
return
def _lora_expand_fp8_fake(
inputs: torch.Tensor,
lora_b_weights: list[torch.Tensor],
output_tensor: torch.Tensor,
token_lora_mapping: torch.Tensor,
token_indices_sorted_by_lora_ids: torch.Tensor,
num_tokens_per_lora: torch.Tensor,
lora_token_start_loc: torch.Tensor,
lora_ids: torch.Tensor,
no_lora_flag_cpu: torch.Tensor,
num_active_loras: int,
b_scale: list[torch.Tensor],
a_scale: torch.Tensor | None = None,
offset_start: int = 0,
add_inputs: bool = False,
group_k: int = 0,
group_n: int = 0,
use_fp8_w8a8: bool = False,
per_channel_quant: bool = False,
) -> None:
return
try:
direct_register_custom_op(
op_name="lora_expand_fp8",
op_func=_lora_expand_fp8,
mutates_args=["output_tensor"],
fake_impl=_lora_expand_fp8_fake,
)
lora_expand_fp8 = torch.ops.vllm.lora_expand_fp8
@@ -284,29 +284,11 @@ def _lora_expand(
return
def _lora_expand_fake(
inputs: torch.Tensor,
lora_b_weights: list[torch.Tensor],
output_tensor: torch.Tensor,
token_lora_mapping: torch.Tensor,
token_indices_sorted_by_lora_ids: torch.Tensor,
num_tokens_per_lora: torch.Tensor,
lora_token_start_loc: torch.Tensor,
lora_ids: torch.Tensor,
no_lora_flag_cpu: torch.Tensor,
num_active_loras: torch.Tensor, # CPU tensor [1], number of active LoRAs
offset_start: int = 0,
add_inputs: bool = False,
) -> None:
return
try:
direct_register_custom_op(
op_name="lora_expand",
op_func=_lora_expand,
mutates_args=["output_tensor"],
fake_impl=_lora_expand_fake,
)
lora_expand = torch.ops.vllm.lora_expand
@@ -394,34 +394,11 @@ def _lora_shrink_fp8(
return
def _lora_shrink_fp8_fake(
inputs: torch.Tensor,
lora_a_weights: list[torch.Tensor],
output_tensor: torch.Tensor,
token_lora_mapping: torch.Tensor,
token_indices_sorted_by_lora_ids: torch.Tensor,
num_tokens_per_lora: torch.Tensor,
lora_token_start_loc: torch.Tensor,
lora_ids: torch.Tensor,
no_lora_flag_cpu: torch.Tensor,
num_active_loras: int,
scaling: float,
b_scale: list[torch.Tensor], # LoRA weight scale per slice
a_scale: torch.Tensor | None = None, # Activation scale - per-token or block-wise
group_k: int = 0, # Block size for K in block-wise quantization (0 = tensor-wise)
group_n: int = 0, # Block size for N in block-wise quantization
use_fp8_w8a8: bool = False,
per_channel_quant: bool = False,
) -> None:
return
try:
direct_register_custom_op(
op_name="lora_shrink_fp8",
op_func=_lora_shrink_fp8,
mutates_args=["output_tensor"],
fake_impl=_lora_shrink_fp8_fake,
)
lora_shrink_fp8 = torch.ops.vllm.lora_shrink_fp8
@@ -265,28 +265,11 @@ def _lora_shrink(
return
def _lora_shrink_fake(
inputs: torch.Tensor,
lora_a_weights: list[torch.Tensor],
output_tensor: torch.Tensor,
token_lora_mapping: torch.Tensor,
token_indices_sorted_by_lora_ids: torch.Tensor,
num_tokens_per_lora: torch.Tensor,
lora_token_start_loc: torch.Tensor,
lora_ids: torch.Tensor,
no_lora_flag_cpu: torch.Tensor,
num_active_loras: torch.Tensor, # CPU tensor [1], number of active LoRAs
scaling: float,
) -> None:
return
try:
direct_register_custom_op(
op_name="lora_shrink",
op_func=_lora_shrink,
mutates_args=["output_tensor"],
fake_impl=_lora_shrink_fake,
)
lora_shrink = torch.ops.vllm.lora_shrink
-35
View File
@@ -85,57 +85,22 @@ def _bgmv_expand_slice_impl(
)
def _bgmv_shrink_fake(
inputs: torch.Tensor,
lora_a_weights: torch.Tensor,
output_tensor: torch.Tensor,
lora_indices_tensor: torch.Tensor,
scaling: float,
) -> None:
return None
def _bgmv_expand_fake(
inputs: torch.Tensor,
lora_b_weights: torch.Tensor,
output_tensor: torch.Tensor,
lora_indices_tensor: torch.Tensor,
add_inputs: bool,
) -> None:
return None
def _bgmv_expand_slice_fake(
inputs: torch.Tensor,
lora_b_weights: torch.Tensor,
output_tensor: torch.Tensor,
lora_indices_tensor: torch.Tensor,
slice_offset: int,
slice_size: int,
add_inputs: bool,
) -> None:
return None
direct_register_custom_op(
op_name="xpu_bgmv_shrink",
op_func=_bgmv_shrink_impl,
mutates_args=["output_tensor"],
fake_impl=_bgmv_shrink_fake,
)
direct_register_custom_op(
op_name="xpu_bgmv_expand",
op_func=_bgmv_expand_impl,
mutates_args=["output_tensor"],
fake_impl=_bgmv_expand_fake,
)
direct_register_custom_op(
op_name="xpu_bgmv_expand_slice",
op_func=_bgmv_expand_slice_impl,
mutates_args=["output_tensor"],
fake_impl=_bgmv_expand_slice_fake,
)