Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DCU] Llama a8w8 inference performance optimization #8800

Merged
merged 3 commits into from
Jul 24, 2024

Conversation

Deleter-D
Copy link
Contributor

@Deleter-D Deleter-D commented Jul 24, 2024

PR types

Performance optimization

PR changes

Models

Description

Optimize the inference performance in Llama a8w8 case.

On the DCU platform, performance of rocblas gemm under different transpositions is NT > NN > TN. Due to the matmul of paddle, NT cannot be triggered in this scenario, so a suboptimal solution is chosen, which is NN.

Copy link

paddle-bot bot commented Jul 24, 2024

Thanks for your contribution!

Copy link

codecov bot commented Jul 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 31 lines in your changes missing coverage. Please review.

Project coverage is 55.58%. Comparing base (da1eb9c) to head (7d4fdc6).
Report is 219 commits behind head on develop.

Files with missing lines Patch % Lines
...erimental/transformers/fused_transformer_layers.py 0.00% 17 Missing ⚠️
...dlenlp/experimental/transformers/llama/modeling.py 0.00% 14 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8800      +/-   ##
===========================================
+ Coverage    55.37%   55.58%   +0.21%     
===========================================
  Files          631      630       -1     
  Lines        99707    98382    -1325     
===========================================
- Hits         55211    54687     -524     
+ Misses       44496    43695     -801     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -1384,7 +1392,10 @@ def compute_mmha(self, qkv_out, caches, attn_mask, seq_lens, rotary_embs, rotary
)[0]

def compute_out_linear(self, fmha_out, i):
out_linear_out = paddle.matmul(fmha_out, self.linear_weights[i], False, True)
if paddle.is_compiled_with_rocm():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

把rocm需要不转置的理由在PR描述里说下吧

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已添加说明

@DesmonDay DesmonDay self-requested a review July 24, 2024 08:13
Copy link
Contributor

@DesmonDay DesmonDay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wawltor wawltor merged commit 105e0da into PaddlePaddle:develop Jul 24, 2024
9 of 12 checks passed
@Deleter-D Deleter-D deleted the llama_dcu branch July 25, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants