[Misc] Capture and log the time of loading weights (#13666)

This commit is contained in:
Jun Duan
2025-02-21 22:06:34 -08:00
committed by GitHub
parent c6ed93860f
commit 68d535ef44
2 changed files with 10 additions and 5 deletions
+5 -2
View File
@@ -1109,11 +1109,14 @@ class GPUModelRunnerBase(ModelRunnerBase[TModelInputForGPU]):
def load_model(self) -> None:
logger.info("Starting to load model %s...", self.model_config.model)
with DeviceMemoryProfiler(self.device) as m:
time_before_load = time.perf_counter()
self.model = get_model(vllm_config=self.vllm_config)
time_after_load = time.perf_counter()
self.model_memory_usage = m.consumed_memory
logger.info("Loading model weights took %.4f GB",
self.model_memory_usage / float(2**30))
logger.info("Loading model weights took %.4f GB and %.6f seconds",
self.model_memory_usage / float(2**30),
time_after_load - time_before_load)
if self.lora_config:
assert supports_lora(