Execute a forward pass with dummy inputs to profile the memory usage of the model
(self)
| 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 | """ |
nothing calls this directly
no test coverage detected