Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions vllm/model_executor/model_loader/base_loader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import time
from abc import ABC, abstractmethod

import torch
Expand Down Expand Up @@ -70,11 +71,17 @@ def load_model(
target_device = torch.device(load_device)
with set_default_torch_dtype(model_config.dtype):
with target_device:
time_before_load = time.perf_counter()
model = self.create_model(
vllm_config=vllm_config,
model_config=model_config,
prefix=prefix,
)
time_after_load = time.perf_counter()
logger.info_once(
"Initializing model took %.6f seconds",
time_after_load - time_before_load,
)

logger.debug("Loading weights on %s ...", load_device)
self.load_weights(model, model_config)
Expand Down
Loading