Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
lugimzzz committed May 23, 2024
1 parent affd27d commit 2854cf1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion paddlenlp/transformers/llama/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,7 @@ def forward(self, hidden_states, tensor_parallel_output=None):
hidden_states = paddle.reshape_(hidden_states, [-1, seq_length, self.config.hidden_size])

if tensor_parallel_output is None:
tensor_parallel_output = self.config.tensor_parallel_output
tensor_parallel_output = self.config.tensor_parallel_output and self.config.tensor_parallel_degree > 1

if get_env_device() == "xpu" and self.xpu_parallel_matmul is not None:
logits = self.xpu_parallel_matmul(
Expand Down
2 changes: 1 addition & 1 deletion paddlenlp/transformers/qwen/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ def __init__(self, config: QWenConfig):

def forward(self, hidden_states, tensor_parallel_output=None):
if tensor_parallel_output is None:
tensor_parallel_output = self.config.tensor_parallel_output
tensor_parallel_output = self.config.tensor_parallel_output and self.config.tensor_parallel_degree > 1

logits = parallel_matmul(hidden_states, self.weight, tensor_parallel_output=tensor_parallel_output)
return logits
Expand Down

0 comments on commit 2854cf1

Please sign in to comment.