device
This commit is contained in:
parent
cf77d8b610
commit
54121bb4b3
2 changed files with 3 additions and 5 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue