Skip to content

Conversation

@Qin-sx
Copy link
Contributor

@Qin-sx Qin-sx commented Jul 3, 2025

PR Docs

PaddlePaddle/Paddle#73804

PR APIs

scaled_dot_product_attention

新增参数

函数 PaConvert Docs
KaimingNormal #594 PaddlePaddle/docs#7324
SmoothL1Loss #593 PaddlePaddle/docs#7323
Upsample #567 PaddlePaddle/docs#7205
Module.eval #597 PaddlePaddle/docs#7330

优化功能

函数 PaConvert Docs
scaled_dot_product_attention 3D输入 #601 PaddlePaddle/docs#7353
scaled_dot_product_attention bool mask #586 PaddlePaddle/docs#7318
signal.stft #598 PaddlePaddle/docs#7329
unique #569 PaddlePaddle/docs#7206
atleast - -
to_tensor - -

解决bug

LayerList.insert, bernoulli, Tensor.data, LSTMCell, fused_rms_norm, softmax

atleastto_tensor解决bug中的函数不需要修改PaConvert和Docs

	modified:   paconvert/api_matcher.py
	modified:   tests/test_scaled_dot_product_attention.py
@paddle-bot paddle-bot bot added the contributor External developers label Jul 3, 2025
Copy link
Collaborator

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM

@PaddlePaddle PaddlePaddle locked and limited conversation to collaborators Jul 23, 2025
@PaddlePaddle PaddlePaddle unlocked this conversation Jul 23, 2025
	modified:   tests/test_scaled_dot_product_attention.py
import torch
np.random.seed(100)
x = np.random.rand(8, 128, 64)
query = torch.tensor(x, dtype=torch.float16)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个在CPU下目前还不支持bfloat16。所以跑不了。

Copy link
Collaborator

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

这一块由于 scaled_dot_product_attention 目前后端选择比较混乱。

可能很容易存在选择了不合理的后端导致无法通过。想要通过可能需要仔细设计下case,更合理的方式是优化scaled_dot_product_attention后端选择逻辑,避免总是选择不合理的后端。

@Qin-sx
Copy link
Contributor Author

Qin-sx commented Jul 28, 2025

这一块由于 scaled_dot_product_attention 目前后端选择比较混乱。

可能很容易存在选择了不合理的后端导致无法通过。想要通过可能需要仔细设计下case,更合理的方式是优化scaled_dot_product_attention后端选择逻辑,避免总是选择不合理的后端。

嗯,收到

@zhwesky2010
Copy link
Collaborator

这一块由于 scaled_dot_product_attention 目前后端选择比较混乱。
可能很容易存在选择了不合理的后端导致无法通过。想要通过可能需要仔细设计下case,更合理的方式是优化scaled_dot_product_attention后端选择逻辑,避免总是选择不合理的后端。

嗯,收到

先修改下case吧,看看怎么能测到这个3D的功能,同时又能避开后端选择错误的问题。先把这个PR合入进去。

	modified:   tests/test_scaled_dot_product_attention.py
@Qin-sx
Copy link
Contributor Author

Qin-sx commented Jul 30, 2025

在case10中暂时考虑了mask
PaddlePaddle/Paddle#74319

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants