已合并
CompressorGrad资料整改 #9947
莫允扬创建于 13 天前
CompressorGrad资料整改 #9947
已合并
莫允扬创建于 13 天前
莫允扬
莫允扬成员
13 天前

描述

CompressorGrad资料、pytest整改,torch接口修复bug

关联的Issue

测试

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 莫允扬 的贡献)
莫允扬莫允扬成员
13 天前 创建了 pull request,commit 49b97cd2
atomgit-bot
atomgit-bot
13 天前 评论:

变更摘要

本 PR 为 CompressorGrad 算子补充 aclnn 调用示例及相关资料整改。核心变更是新增了一个完整的 aclnnCompressorGrad 算子调用示例文件,覆盖 C4A 场景(D=512, coff=2, cmp_ratio=4, BSH layout, BF16)下的端到端使用流程,包括设备初始化、张量创建、workspace 申请、算子执行、结果回读与资源释放等完整步骤。

主要改动

  • 新增 test_aclnn_compressor_grad.cpp 示例文件:在 attention/compressor_grad/examples/ 目录下新增 aclnn 调用示例,演示了 aclnnCompressorGradGetWorkspaceSizeaclnnCompressorGrad 接口的完整调用方式,涵盖 7 个输入张量(xwkvwgatedCmpKvsoftmaxScorekvstartPos)与 4 个输出张量(dXdWkvdWgatedApe)的创建与结果校验。
  • 多数据类型混合使用示例:示例中展示了 BF16(bfloat16)、FLOAT(float_t)和 INT32 三种数据类型在同一算子调用中的混合使用方式,输入 x/wkv/wgate/dCmpKv 及输出 dX/dWkv/dWgate 使用 BF16,softmaxScore/kv/dApe 使用 FLOAT,startPos 使用 INT32。
  • 完整的资源生命周期管理示例:示例中规范展示了 aclCreateTensor → 算子执行 → aclDestroyTensoraclrtFree → 流/上下文销毁 → aclFinalize 的完整资源释放流程,为开发者提供了标准化的参考模板。
likedislike
CANN-robotCANN-robot成员
13 天前 添加了label:stat/needs-squash
CANN-robotCANN-robot成员
13 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
13 天前 评论:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here
You can get sig-info at here


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
*/*/README.md 马兵, 蒋礼锐, 陈娇 (3/2) 陈娇 (1/1)
*/*/docs/acl*.md 陈娇, 马兵, 蒋礼锐 (3/2) 陈娇 (1/1)
attention 蒋礼锐, shasha_an, 马兵 (3/2) shasha_an, 马兵, 蒋礼锐 (3/1)
docs 马兵, 蒋礼锐 (2/2) 马兵, 蒋礼锐 (2/1)
sig-ops-transformer 马兵, 蒋礼锐 (2/2) 蒋礼锐, 马兵 (2/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

myy268, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
此处折叠了177条消息 查看更多
mabing成员
11 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
11 天前 添加了label:approved
jiang-lirui成员
11 天前 评论:

/approve
/lgtm

likedislike
CANN-robotCANN-robot成员
11 天前 添加了label:lgtm
CANN-robotCANN-robot成员
11 天前 合入了pull request