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

Method profile_run

fastdeploy/worker/xpu_model_runner.py:1705–1716  ·  view source on GitHub ↗

Execute a forward pass with dummy inputs to profile the memory usage of the model

(self)

Source from the content-addressed store, hash-verified

1703
1704 @profile_run_guard(True)
1705 def profile_run(self) -> None:
1706 """Execute a forward pass with dummy inputs to profile the memory usage of the model"""
1707
1708 self.num_gpu_blocks = self.cache_config.total_block_num
1709 if self.speculative_method in ["mtp"]:
1710 self.proposer.initialize_kv_cache(main_model_num_blocks=self.num_gpu_blocks, profile=True)
1711 self.initialize_kv_cache(profile=True)
1712
1713 self._dummy_run(
1714 num_tokens=int(self.scheduler_config.max_num_batched_tokens),
1715 batch_size=min(self.scheduler_config.max_num_seqs, 1),
1716 )
1717
1718 def update_share_input_block_num(self, num_gpu_blocks: int) -> None:
1719 """

Callers

nothing calls this directly

Calls 2

initialize_kv_cacheMethod · 0.95
_dummy_runMethod · 0.95

Tested by

no test coverage detected