MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / get_moe_method

Function get_moe_method

fastdeploy/model_executor/layers/moe/moe.py:45–74  ·  view source on GitHub ↗

return moe method based on device platform

(layer=None)

Source from the content-addressed store, hash-verified

43
44
45def get_moe_method(layer=None):
46 """
47 return moe method based on device platform
48 """
49
50 if current_platform.is_cuda() or current_platform.is_iluvatar():
51 from .fused_moe_cutlass_backend import CutlassMoEMethod
52
53 return CutlassMoEMethod(None)
54 elif current_platform.is_xpu():
55 from fastdeploy.model_executor.layers.backends import XPUMoEMethod
56
57 return XPUMoEMethod(None, layer)
58 elif current_platform.is_gcu():
59 from fastdeploy.model_executor.layers.backends import GCUFusedMoeMethod
60
61 return GCUFusedMoeMethod(None)
62
63 elif current_platform.is_intel_hpu():
64 from fastdeploy.model_executor.layers.backends import HpuMoEMethod
65
66 return HpuMoEMethod(None)
67
68 elif current_platform.is_maca():
69 from fastdeploy.model_executor.layers.backends import (
70 MetaxCutlassUnquantizedFusedMoEMethod,
71 )
72
73 return MetaxCutlassUnquantizedFusedMoEMethod(None)
74 return None
75
76
77def get_moe_scores(

Callers 3

fnFunction · 0.90
__init__Method · 0.85

Calls 11

XPUMoEMethodClass · 0.90
GCUFusedMoeMethodClass · 0.90
HpuMoEMethodClass · 0.90
CutlassMoEMethodClass · 0.85
is_cudaMethod · 0.45
is_iluvatarMethod · 0.45
is_xpuMethod · 0.45
is_gcuMethod · 0.45
is_intel_hpuMethod · 0.45
is_macaMethod · 0.45

Tested by

no test coverage detected