From eef737706127fe4a2c28172ab706e92318e0dc60 Mon Sep 17 00:00:00 2001 From: silveroxides Date: Thu, 1 Jan 2026 21:18:08 +0100 Subject: [PATCH] Added .contiguous() to saves --- nodes/lora_extract_svd.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nodes/lora_extract_svd.py b/nodes/lora_extract_svd.py index c414546..d831a8d 100644 --- a/nodes/lora_extract_svd.py +++ b/nodes/lora_extract_svd.py @@ -540,8 +540,8 @@ def extract_lora_from_files( weight_diff, num_chunks, mode, linear_param, device, linear_max_rank ) if lora_up is not None: - output_sd[f"{lora_name}.lora_up.weight"] = lora_up.to(save_torch_dtype).cpu() - output_sd[f"{lora_name}.lora_down.weight"] = lora_down.to(save_torch_dtype).cpu() + output_sd[f"{lora_name}.lora_up.weight"] = lora_up.to(save_torch_dtype).cpu().contiguous() + output_sd[f"{lora_name}.lora_down.weight"] = lora_down.to(save_torch_dtype).cpu().contiguous() output_sd[f"{lora_name}.alpha"] = torch.tensor([rank]).to(save_torch_dtype) stats["chunked"] += 1 del weight_diff @@ -556,12 +556,12 @@ def extract_lora_from_files( # Store result if mode_str == "full": - output_sd[f"{lora_name}.diff"] = weight_diff.to(save_torch_dtype).cpu() + output_sd[f"{lora_name}.diff"] = weight_diff.to(save_torch_dtype).cpu().contiguous() stats["full"] += 1 else: lora_down, lora_up, _ = result - output_sd[f"{lora_name}.lora_down.weight"] = lora_down.to(save_torch_dtype).cpu() - output_sd[f"{lora_name}.lora_up.weight"] = lora_up.to(save_torch_dtype).cpu() + output_sd[f"{lora_name}.lora_down.weight"] = lora_down.to(save_torch_dtype).cpu().contiguous() + output_sd[f"{lora_name}.lora_up.weight"] = lora_up.to(save_torch_dtype).cpu().contiguous() output_sd[f"{lora_name}.alpha"] = torch.tensor([lora_down.shape[0]]).to(save_torch_dtype) stats["extracted"] += 1