Commit 9653385f authored by gaoqiong's avatar gaoqiong
Browse files

去掉调试信息

parent 835bd9fc
...@@ -108,20 +108,15 @@ class UnquantizedLinearMethod(LinearMethodBase): ...@@ -108,20 +108,15 @@ class UnquantizedLinearMethod(LinearMethodBase):
x: torch.Tensor, x: torch.Tensor,
bias: Optional[torch.Tensor] = None) -> torch.Tensor: bias: Optional[torch.Tensor] = None) -> torch.Tensor:
weight = layer.weight weight = layer.weight
#print("**************matmul weight.shape:",weight.shape)
#print("self.use_llama_nn:",self.use_llama_nn)
if self.separate_bias_add: if self.separate_bias_add:
#print("********self.separate_bias_add")
if bias is not None: if bias is not None:
return F.linear(x, weight) + bias return F.linear(x, weight) + bias
return F.linear(x, weight) return F.linear(x, weight)
if self.use_llama_nn: if self.use_llama_nn:
# print("**************matmul input.shape:",x.shape)
# print("**************matmul weight.shape:",weight.shape)
if bias is not None: if bias is not None:
return torch.matmul(x, weight) +bias return torch.matmul(x, weight) +bias
else: else:
......
...@@ -459,14 +459,10 @@ class LlamaForCausalLM(nn.Module): ...@@ -459,14 +459,10 @@ class LlamaForCausalLM(nn.Module):
#print("key:\n",key) #print("key:\n",key)
matches = re.findall(combined_words, layername) matches = re.findall(combined_words, layername)
if matches: if matches:
#print(layername)
# print(weight.data)
#创建一个跟value一样大的tensor #创建一个跟value一样大的tensor
_weight = torch.zeros_like(weight.data) _weight = torch.zeros_like(weight.data)
ori_shape =_weight.shape ori_shape =_weight.shape
# if layername=="model.layers.0.self_attn.qkv_proj.weight":
# print("weight.data[0:5][0:5]:",weight.data[0:5][0:5])
ops.trans_w16_gemm(_weight,weight.data,_weight.shape[0],_weight.shape[1]) ops.trans_w16_gemm(_weight,weight.data,_weight.shape[0],_weight.shape[1])
weight.data.copy_(_weight) weight.data.copy_(_weight)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment