MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / only_decode

Method only_decode

fastdeploy/worker/xpu_model_runner.py:312–334  ·  view source on GitHub ↗

Update Batch type for if_only_decode.

(self)

Source from the content-addressed store, hash-verified

310 return if_only_prefill
311
312 def only_decode(self):
313 """
314 Update Batch type for if_only_decode.
315 """
316 if_only_decode = True
317 prefill_exists = None
318 if self.fd_config.parallel_config.use_ep and self.fd_config.scheduler_config.splitwise_role == "mixed":
319 no_need_stop_list = []
320 no_need_stop = self.not_need_stop()
321 paddle.distributed.all_gather_object(no_need_stop_list, not no_need_stop)
322 if_all_device_empty = all(no_need_stop_list)
323 if if_all_device_empty:
324 if_only_decode = False
325 else:
326 only_decode_batch_list = []
327 prefill_exists = self.exist_prefill()
328 paddle.distributed.all_gather_object(only_decode_batch_list, not prefill_exists)
329 if_only_decode = all(only_decode_batch_list)
330
331 if_only_decode = if_only_decode and not (
332 prefill_exists if prefill_exists is not None else self.exist_prefill()
333 )
334 return if_only_decode
335
336 def _process_mm_features(self, request_list: List[Request]):
337 """

Callers 1

_prepare_inputsMethod · 0.95

Calls 2

not_need_stopMethod · 0.95
exist_prefillMethod · 0.95

Tested by

no test coverage detected