Signed-off-by: roG0d <rodgarcas98@gmail.com> Signed-off-by: roG0d <baonudesifeizhai@gmail.com> Signed-off-by: baonudesifeizhai <85092850+baonudesifeizhai@users.noreply.github.com> Co-authored-by: roG0d <rodgarcas98@gmail.com>
This commit is contained in:
1 parent
40a07e0d80
commit
c4a0990044
26 files changed
+1214
-176
No files matched your search
@@ -132,7 +132,7 @@ class HunyuanModel(HunYuanModel):
|
||||
# Params for weights, fp8 weight scales, fp8 activation scales
|
||||
# (param_name, weight_name, expert_id, shard_id)
|
||||
fused_moe_expert_mapping = fused_moe_make_expert_params_mapping(
|
||||
self,
|
||||
model=self,
|
||||
ckpt_gate_proj_name="gate_proj",
|
||||
ckpt_down_proj_name="down_proj",
|
||||
ckpt_up_proj_name="up_proj",
|
||||
|
||||
@@ -416,10 +416,8 @@ class BailingMoeV2SparseMoeBlock(nn.Module):
|
||||
dim=-1,
|
||||
)
|
||||
|
||||
# FusedMoE expects 2D hidden_states.
|
||||
hidden_states_2d = hidden_states.view(-1, h)
|
||||
final_hidden_states = self.experts(hidden_states_2d, packed_routing)
|
||||
|
||||
final_hidden_states = final_hidden_states.view(bsz, seq_len, h)
|
||||
|
||||
return final_hidden_states.squeeze(0) if input_is_2d else final_hidden_states
|
||||
|
||||
Reference in new issue
Block a user