[Misc] Clean up fast loader daemon quant method verification (#55656)
Signed-off-by: Isotr0py <Isotr0py@outlook.com>
This commit is contained in:
@@ -39,6 +39,19 @@ class BaseModelLoader(ABC):
|
||||
inplace weights loading for an already-initialized model"""
|
||||
raise NotImplementedError
|
||||
|
||||
def create_model(
|
||||
self, vllm_config: VllmConfig, model_config: ModelConfig, prefix: str = ""
|
||||
) -> nn.Module:
|
||||
"""Create a model with the given configurations."""
|
||||
model = initialize_model(
|
||||
vllm_config=vllm_config,
|
||||
model_config=model_config,
|
||||
prefix=prefix,
|
||||
)
|
||||
log_online_quantization(vllm_config)
|
||||
log_model_inspection(model)
|
||||
return model
|
||||
|
||||
@instrument(span_name="Load model")
|
||||
def load_model(
|
||||
self, vllm_config: VllmConfig, model_config: ModelConfig, prefix: str = ""
|
||||
@@ -52,15 +65,12 @@ class BaseModelLoader(ABC):
|
||||
target_device = torch.device(load_device)
|
||||
with set_default_torch_dtype(model_config.dtype):
|
||||
with target_device:
|
||||
model = initialize_model(
|
||||
model = self.create_model(
|
||||
vllm_config=vllm_config,
|
||||
model_config=model_config,
|
||||
prefix=prefix,
|
||||
)
|
||||
|
||||
log_online_quantization(vllm_config)
|
||||
log_model_inspection(model)
|
||||
|
||||
logger.debug("Loading weights on %s ...", load_device)
|
||||
self.load_weights(model, model_config)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user