diff --git a/unsloth/kernels/utils.py b/unsloth/kernels/utils.py index 2c4edf334b..6bb44fbd1f 100644 --- a/unsloth/kernels/utils.py +++ b/unsloth/kernels/utils.py @@ -452,7 +452,9 @@ pass def matmul_lora(X, W, W_quant, A, B, s, out = None): dtype = X.dtype W = fast_dequantize(W.t(), W_quant, use_global_buffer = False) - + if X.device != W.device: + print(X.device, W.device, torch.cuda.current_device()) + if X.dim() == 3: batch, seq_len, d = X.shape X = X.view(-1, X.shape[-1]) @@ -460,9 +462,6 @@ def matmul_lora(X, W, W_quant, A, B, s, out = None): else: reshape = False pass - - if X.device != W.device: - print(X.device, W.device, torch.cuda.current_device()) out = torch_matmul(X, W, out = out) if W_quant is not None: del W diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 7f475869c8..fe0627f8d7 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -385,7 +385,6 @@ def LlamaAttention_fast_forward( head_dim = self.head_dim assert(n_kv_heads * n_groups == n_heads) - print(hidden_states.device, torch.cuda.current_device()) Q, K, V = self.apply_qkv(self, hidden_states) Q = Q.view(bsz, q_len, n_heads, head_dim).transpose(1, 2) K = K.view(bsz, q_len, n_kv_heads, head_dim).transpose(1, 2)