Skip to content

Conversation

@K11OntheBoat
Copy link
Collaborator

Attention 模块单测

@paddle-bot
Copy link

paddle-bot bot commented Oct 20, 2025

Thanks for your contribution!

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


K11OntheBoat seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

# ===================================================================
# 修改后的 Ernie4_5_Attention 类
# ===================================================================
class Ernie4_5_Attention(nn.Layer):
Copy link
Collaborator

Choose a reason for hiding this comment

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

建议直接引用组网里面的 import fastdeploy/model_executor/models/ernie4_5_moe.py 里面的 Ernie4_5_Attention ,减少代码量

from fastdeploy.model_executor.layers.rotary_embedding import get_rope


def get_padding_offset(bsz, max_seq_len, seq_lens_this_time):
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个函数可以完全复用
from fastdeploy.model_executor.pre_and_post_process import pre_process

@K11OntheBoat K11OntheBoat force-pushed the attn_layer branch 2 times, most recently from 57f780a to 4be330f Compare October 23, 2025 08:14
@K11OntheBoat K11OntheBoat changed the title [Draft]Add unitest of Attention Layer [Unitest]Add unitest of Attention Layer Oct 23, 2025
@K11OntheBoat K11OntheBoat force-pushed the attn_layer branch 3 times, most recently from efd7944 to 9e464bb Compare October 24, 2025 09:00
@zhoutianzi666 zhoutianzi666 merged commit 64d1aa9 into PaddlePaddle:develop Oct 27, 2025
25 of 27 checks passed
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.

3 participants