Skip to content

Commit cd9f5c0

Browse files
[bugfix] dep ineffective (#4416)
### What this PR does / why we need it? The expert mapping table and weights of the dynamic EPLB were not updated, causing the accuracy to be correct but not effective. This bug has now been fixed. If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future. Signed-off-by: shenchuxiaofugui <1311027364@qq.com>
1 parent 71acc8d commit cd9f5c0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

vllm_ascend/eplb/adaptor/vllm_adaptor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,15 @@ def _export_tensor_to_file(self, expert_maps, expert_map_record_path: str):
194194
json.dump(record, f, indent=4)
195195

196196
def do_update_expert_map(self, layer_id, updated_expert_map):
197-
self.expert_map_per_layer[layer_id] = updated_expert_map.clone()
198-
self.expert_map_per_layer_cpu[layer_id] = updated_expert_map.clone()
197+
self.expert_map_per_layer[layer_id].copy_(updated_expert_map)
198+
self.expert_map_per_layer_cpu[layer_id].copy_(updated_expert_map)
199199

200200
def do_update_expert_weight(self, layer_id, local_expert_to_replace,
201201
buffer_tensor_id):
202202
for expert_tensor, buffer_tensor in zip(
203203
self.expert_param_per_layer[layer_id][local_expert_to_replace],
204204
self.buffer_tensor_list[buffer_tensor_id]):
205-
expert_tensor = buffer_tensor.clone()
205+
expert_tensor.copy_(buffer_tensor)
206206
logger.debug(f"Expert tensor shape is :{expert_tensor.shape}")
207207

208208
def do_update_log2phy_map(self, layer_id, updated_log2phy_map):

vllm_ascend/ops/common_fused_moe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def get_map(self):
271271
return self.expert_map
272272

273273
def get_log2phy_map(self):
274-
return self.logical_to_physical_map
274+
return self.log2phy
275275

276276
def clear_moe_load(self):
277277
if self.moe_load is not None:

vllm_ascend/torchair/ops/torchair_fused_moe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ def get_map(self):
13921392
return self.expert_map
13931393

13941394
def get_log2phy_map(self):
1395-
return self.logical_to_physical_map
1395+
return self.log2phy
13961396

13971397
def clear_moe_load(self):
13981398
if self.moe_load is not None:

0 commit comments

Comments
 (0)