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

Method _stop_profile

fastdeploy/engine/engine.py:716–732  ·  view source on GitHub ↗

Stop profiling of the model server and reset variables.

(self)

Source from the content-addressed store, hash-verified

714 self.engine.check_and_free_block_tables()
715
716 def _stop_profile(self):
717 """
718 Stop profiling of the model server and reset variables.
719 """
720 self.do_profile = 0
721 while self.get_profile_block_num_signal.value[0] == 0:
722 if hasattr(self, "worker_proc") and self.worker_proc is not None:
723 if self.worker_proc.poll() is not None:
724 raise RuntimeError("Worker process failed to start." "Please check log/workerlog.* for details.")
725 time.sleep(1)
726 num_gpu_blocks = self.get_profile_block_num_signal.value[0]
727 self.cfg.cache_config.reset(num_gpu_blocks)
728 self.engine.resource_manager.reset_cache_config(self.cfg.cache_config)
729 if self.cfg.cache_config.enable_prefix_caching or self.cfg.scheduler_config.splitwise_role != "mixed":
730 if not current_platform.is_intel_hpu():
731 device_ids = self.cfg.parallel_config.device_ids.split(",")
732 self.cache_manager_processes = self.engine.start_cache_service(device_ids, self.ipc_signal_suffix)
733
734 def check_health(self, time_interval_threashold=30):
735 """

Callers 1

startMethod · 0.95

Calls 7

reset_cache_configMethod · 0.80
splitMethod · 0.80
start_cache_serviceMethod · 0.80
pollMethod · 0.45
sleepMethod · 0.45
resetMethod · 0.45
is_intel_hpuMethod · 0.45

Tested by

no test coverage detected