diff --git a/vllm_ascend/eplb/adaptor/vllm_adaptor.py b/vllm_ascend/eplb/adaptor/vllm_adaptor.py index 47a99d1b..8aabcc3c 100644 --- a/vllm_ascend/eplb/adaptor/vllm_adaptor.py +++ b/vllm_ascend/eplb/adaptor/vllm_adaptor.py @@ -107,8 +107,8 @@ class VllmEplbAdaptor(EplbAdaptor): self.buffer_tensor_list[buffer_id].append(buffer_tensor) def init_expert_param_per_layer(self): - num_local_expert = self.param_dict["model.layers." + str(self.num_dense_layers) + \ - ".mlp.experts." + self.expert_weight_names[0]].data.shape[0] + key = f"model.layers.{self.num_dense_layers}.mlp.experts.{self.expert_weight_names[0]}" + num_local_expert = len(self.param_dict[key]) for moe_layer_id in range(self.num_moe_layers): layer_idx = self.num_dense_layers + moe_layer_id self.expert_param_per_layer[layer_idx] = list() diff --git a/vllm_ascend/ops/fused_moe/moe_mlp.py b/vllm_ascend/ops/fused_moe/moe_mlp.py index 13e1efc0..3b182b17 100644 --- a/vllm_ascend/ops/fused_moe/moe_mlp.py +++ b/vllm_ascend/ops/fused_moe/moe_mlp.py @@ -129,7 +129,7 @@ def quant_apply_mlp(hidden_states: torch.Tensor, # act_fn: swiglu hidden_states, swiglu_out_scale = torch_npu.npu_dequant_swiglu_quant( x=hidden_states, - weight_scale=w1_scale, + weight_scale=w1_scale[0], activation_scale=pertoken_scale, bias=None, quant_scale=None, diff --git a/vllm_ascend/quantization/w8a8_dynamic.py b/vllm_ascend/quantization/w8a8_dynamic.py index 00c42cd8..2e86dd6e 100644 --- a/vllm_ascend/quantization/w8a8_dynamic.py +++ b/vllm_ascend/quantization/w8a8_dynamic.py @@ -289,7 +289,7 @@ class AscendW8A8DynamicFusedMoEMethod: ] layer.w13_weight_scale_fp32_list = [ weight.clone() - for weight in layer.w13_weight_scale.data.unbind(dim=0) + for weight in layer.w13_weight_scale_fp32.data.unbind(dim=0) ] layer.w2_weight_scale_list = [ weight.clone()