vllm_gaudi.ops.hpu_fused_moe
¶
HPUGroupedTopk
¶
Bases: GroupedTopk
GroupedTopk used by the Deepseek-V2 and Deepseek-V3 model.
Source code in vllm_gaudi/ops/hpu_fused_moe.py
forward_oot
¶
forward_oot(
hidden_states: Tensor,
gating_output: Tensor,
e_score_correction_bias: Tensor | None = None,
) -> tuple[Tensor, Tensor]
Source code in vllm_gaudi/ops/hpu_fused_moe.py
HPUUnquantizedFusedMoEMethod
¶
Bases: UnquantizedFusedMoEMethod
MoE method without quantization.
Source code in vllm_gaudi/ops/hpu_fused_moe.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
__init__
¶
forward_oot
¶
Source code in vllm_gaudi/ops/hpu_fused_moe.py
process_weights_after_loading
¶
process_weights_after_loading(layer: Module) -> None
Source code in vllm_gaudi/ops/hpu_fused_moe.py
get_compressed_expert_map
¶
Compresses the expert map by removing any -1 entries.
This implementation uses a standard Python loop, which is compatible with
graph compilation modes that do not support dynamic shapes resulting from
operations like torch.where.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expert_map
|
Tensor
|
A tensor of shape (global_num_experts,) mapping a global expert index to its local index. Contains -1 for experts that are not assigned to the current rank. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A string mapping from local to global index, |
str
|
ordered by global index. (e.g., "0->5, 1->12, 2->23") |
Source code in vllm_gaudi/ops/hpu_fused_moe.py
patched_fused_moe_forward
¶
patched_fused_moe_forward(
self, hidden_states: Tensor, router_logits: Tensor
) -> Union[Tensor, tuple[Tensor, Tensor]]
Patched forward method that bypasses the custom op to avoid recompilation issues.