Skip to content

Commit 7f64d40

Browse files
authored
[MTP] support expert-parellel in mtp (#2835)
1 parent ece8859 commit 7f64d40

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

fastdeploy/model_executor/load_weight_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ def load_composite_checkpoint(
250250
# 2. Tensor Parallel (TP)
251251
# 3. Pre-sharded (pre-split)
252252
"""
253-
if fd_config.parallel_config.use_ep:
253+
if fd_config.parallel_config.use_ep and \
254+
fd_config.speculative_config.model_type != "mtp":
254255
state_dict = load_ep_checkpoint(model_path,
255256
fd_config.model_config,
256257
return_numpy=True)

fastdeploy/model_executor/pre_and_post_process.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def post_process_normal(sampler_output: SamplerOutput,
182182
)
183183

184184

185-
def post_process_specualate(model_output, skip_save_output: bool = False):
185+
def post_process_specualate(model_output, save_each_rank: bool = False, skip_save_output: bool = False):
186186
""""""
187187
speculate_update_v3(
188188
model_output.seq_lens_encoder,
@@ -204,7 +204,7 @@ def post_process_specualate(model_output, skip_save_output: bool = False):
204204
model_output.accept_num,
205205
model_output.not_need_stop,
206206
model_output.mp_rank,
207-
False,
207+
save_each_rank,
208208
)
209209

210210
speculate_clear_accept_nums(model_output.accept_num,
@@ -231,7 +231,7 @@ def post_process(sampler_output: SamplerOutput,
231231
skip_save_output: bool = False) -> None:
232232
""" Post-processing steps after completing a single token generation. """
233233
if speculative_decoding:
234-
post_process_specualate(model_output, skip_save_output)
234+
post_process_specualate(model_output, save_each_rank, skip_save_output)
235235
else:
236236
post_process_normal(sampler_output, model_output, save_each_rank,
237237
skip_save_output)

0 commit comments

Comments
 (0)