[Bugfix][IPEX] Add VLLM_CPU_MOE_PREPACK to allow disabling MoE prepack when CPU does not support it (#14681)

Signed-off-by: Thien Tran <gau.nernst@yahoo.com.sg>
This commit is contained in:
Thien Tran
2025-03-13 20:43:18 -07:00
committed by GitHub
parent fb4c7f8ef0
commit 95d680b862
3 changed files with 10 additions and 1 deletions
@@ -7,6 +7,7 @@ from typing import Callable, List, Optional, Tuple
import torch
from torch.nn.parameter import UninitializedParameter
from vllm import envs
from vllm.config import get_current_vllm_config
from vllm.distributed import (get_dp_group, get_tensor_model_parallel_rank,
get_tensor_model_parallel_world_size,
@@ -104,7 +105,7 @@ class UnquantizedFusedMoEMethod(FusedMoEMethodBase, CustomOp):
layer.ipex_fusion = ipex.llm.modules.GatedMLPMOE(
layer.w13_weight,
layer.w2_weight,
use_prepack=True,
use_prepack=envs.VLLM_CPU_MOE_PREPACK,
)
else:
raise NotImplementedError("CPU MOE only supports x86 arch.")