Skip to content

Commit 765be19

Browse files
committed
fix dist config keys
1 parent f63730d commit 765be19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lmdeploy/pytorch/engine/model_agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ def __update_inputs(next_token_ids, model_metas, extra_inputs):
729729
inputs,
730730
return_logits=return_logits,
731731
sync_long_context=sync_long_context,
732-
return_routed_experts=return_routed_experts and need_output,
732+
return_routed_experts=return_routed_experts and self.need_output,
733733
)
734734
logits = output['logits'][0] # [bs, seq, prob] -> [seq, prob]
735735
seq_length = output.get('seq_length', inputs.seq_length)
@@ -959,7 +959,7 @@ def _build_model(self):
959959
update_custom_module_map(custom_module_map)
960960
logger.debug(msg_with_rank(rank, 'build model.'))
961961
# for router replay
962-
need_output = self.dist_ctx.dp > 1 or self.dist_ctx.rank % self.dist_ctx.tp == 0
962+
need_output = self.dist_config.dp > 1 or self.need_output
963963
enable_return_routed_experts = self.misc_config.enable_return_routed_experts and need_output
964964

965965
build_model_ctx = BuildModelContext(

0 commit comments

Comments
 (0)