已合并
Add test_native_mha.py. #21352
liu-jiaweikf创建于 2025年5月29日
Add test_native_mha.py. #21352
已合并
从refs/pull/21352/head合入到v2.7.1
Pull Request已成功合入, 合并人@
(感谢 liu-jiaweikf 的贡献)liu-jiaweikf
2025年5月29日 评论:
2025年5月29日 评论:
compile


atlasaccount1
2025年5月29日 评论:
2025年5月29日 评论:
✅ 流水线任务触发成功,正在执行,请稍候。 任务链接[7cddb9c7e52043af9141f2cd20b41d7d]


2025年5月29日 添加了
ci-pipeline-failed
标签
2025年5月29日 强制推送 了代码
liu-jiaweikf
2025年5月29日 评论:
2025年5月29日 评论:
compile


此处折叠了73条消息 查看更多
liu-jiaweikf
2025年5月29日 评论:
2025年5月29日 评论:
compile


atlasaccount1
2025年5月29日 评论:
2025年5月29日 评论:
✅ 流水线任务触发成功,正在执行,请稍候。 任务链接[b5aa53e0b1ea40e6b3e3122dfdbd01ff]


atlasaccount1
2025年5月29日 评论:
2025年5月29日 评论:
| 任务名称 | 状态 | 详情 | 日志 | 出包 | |
|---|---|---|---|---|---|
| codecheck | ✅ | SUCCESS | >>> | N/A | |
| codecheck_scan | ✅ | SUCCESS | >>> | N/A | |
| checkerro | ✅ | SUCCESS | >>> | N/A | |
| codecheck_ftd | ✅ | SUCCESS | >>> | N/A | |
| jump_url | ✅ | SUCCESS | >>> | N/A | |
| Build_ARM_USE_CXX_ABI | ✅ | SUCCESS | >>> | >>> | |
| Build_LibTorch_USE_CXX_ABI | ✅ | SUCCESS | >>> | >>> | |
| Build_X86_USE_CXX_ABI | ✅ | SUCCESS | >>> | >>> | |
| UT_X86_Part_01 | ✅ | SUCCESS | >>> | N/A | |
| UT_X86_Part_02 | ✅ | SUCCESS | >>> | N/A | |
| 跳过测试用例 | 否 | ||||
| UT失败过 | 否 | ||||
| 流水线链接 | 点此跳转 | ||||


wang-guangbin
2025年5月30日 评论:
2025年5月30日 评论:
/lgtm


dilililiwhy1
2025年5月30日 评论:
2025年5月30日 评论:
/approve


What type of PR is this?
What does this PR do / why do we need it:
迁移适配原生用例 test_native_mha.py,看护 _native_multihead_attention 及内部子接口 _transform_bias_rescale_qkv
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewers:

原生用例中使用相同device上MultiHeadAttention的计算结果和_native_multi_head_attention进行对比。在老版本中_native_multi_head_attention是通过fallback cpu实现,当UT类型指定为torch.float16时cpu不支持该数据类型导致报错。暂时跳过UT,后续适配合入后可以打开UT。
UT本地验证通过: