Add debug logging for weight loading failures
This commit is contained in:
@@ -1565,13 +1565,28 @@ class DeepseekV4Model(nn.Module):
|
||||
else:
|
||||
if is_pp_missing_parameter(name, self):
|
||||
continue
|
||||
if name not in params_dict:
|
||||
logger.warning(
|
||||
"Skipping weight %s (not in model params)", name
|
||||
)
|
||||
continue
|
||||
param = params_dict[name]
|
||||
weight_loader = getattr(
|
||||
param, "weight_loader", default_weight_loader
|
||||
)
|
||||
weight_loader(param, loaded_weight)
|
||||
loaded_params.add(name)
|
||||
continue
|
||||
try:
|
||||
weight_loader(param, loaded_weight)
|
||||
except (AssertionError, RuntimeError) as e:
|
||||
logger.error(
|
||||
"Failed to load weight %s: param shape=%s, "
|
||||
"loaded shape=%s, dtype=%s, error=%s",
|
||||
name,
|
||||
param.data.shape if hasattr(param, 'data') else '?',
|
||||
loaded_weight.shape,
|
||||
loaded_weight.dtype,
|
||||
e,
|
||||
)
|
||||
raise
|
||||
|
||||
# Load buffered compressor/indexer scale params.
|
||||
# These are NVFP4 quantization scales that need concatenation
|
||||
|
||||
Reference in New Issue
Block a user