昇腾AI创新大赛集训营·杭州站

https://www.hiascend.com/zh/developer/activities/details/118b868aa5fe4b759d9e407e914db905

Ascend C算子开发

Ascend C暑期优才班获奖规则&笔记提交专用贴_Ascend C_昇腾论坛 (hiascend.com)

香橙派实验手册_Ascend C_昇腾论坛 (hiascend.com)

任务要求

修改add算子功能为sinh函数功能

操作步骤

1. Orange Pi AI PRO的连接

参考文档:以太网口远程登录(SSH方式)

  • 网线连接电脑和香橙派,香橙派ip一般为192.168.137.100,将电脑设为同一网段ip,如:192.167.137.101
  • 使用MobaXterm连接香橙派,用户root,密码Mind@123
2. Orange Pi AI PRO中Add算子的检验(Kernel直调工程体验)

代码:samples: CANN Samples (gitee.com)

cd ~/samples/operator/AddCustomSample/KernelLaunch/
cp -r AddKernelInvocationNeo/ test
cd test/
bash run.sh -r cpu -v Ascend310P1
# 上述命令中cpu参数指定了执行命令的设备,-v Ascend310P1则是香橙派的npu版本型号
# 在不涉及npu的情况下,版本型号不会对结果造成影响。
3. 将Add算子修改为Sinh并检验
  • 修改/root/samples/operator/AddCustomSample/KernelLaunch/test/scripts/gen_data.py
input_x = np.random.uniform(1,10,[8,2048]).astype(np.float16)
golden = np.sinh(input_x).astype(np.float16)

Exp(xLocal, xLocal, TILE_LENGTH);
Reciprocal(zLocal, xLocal, TILE_LENGTH); // 倒数
Sub(zLocal, xLocal, zLocal, TILE_LENGTH);
Muls(zLocal, zLocal, scalar, TILE_LENGTH);

  • 测试,同第2步
cd /root/samples/operator/AddCustomSample/KernelLaunch/test
bash run.sh -r cpu -v Ascend310P1

Ascend C算子开发认证考试

[Ascend C算子开发能力认证考试(中级)](https://www.hiascend.com/zh/exams/1697055344003670018?isCertification=false&breadcrumbSecond=Ascend C算子开发能力认证(中级)&source=/edu/certification&sourceDetail=/edu/certification/detail/34bf904cb410497cb9c582be6c047ff7)

参考笔记:https://bbs.huaweicloud.com/blogs/418400

初始化环境:

bash exam_system_init.sh

比赛补充

Ascend C算子开发(进阶)-昇腾社区 (hiascend.com)

往年比赛优秀代码(算子调优):operator_contrib · Ascend/samples - 码云 - 开源中国 (gitee.com)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Baiye959

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值