news 2026/5/9 17:03:01

CANN/cannbot-skills Flash Attention内核实现

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
CANN/cannbot-skills Flash Attention内核实现

Deep Note:agent/example/kernels/a2/flash_attn_full_pj_hif8.py

【免费下载链接】cannbot-skillsCANNBot 是面向 CANN 开发的用于提升开发效率的系列智能体,本仓库为其提供可复用的 Skills 模块。项目地址: https://gitcode.com/cann/cannbot-skills

Open this file only after the short catalog entry confirmed the kernel is relevant.

What this kernel is really for

  • the scaled-hif8 probability variant of normalized a2 online softmax
  • a contract that intentionally changes the delayed value path while keepingrow_sumin float
  • a kernel that exports finalrowmax/rowsumas part of the visible contract

Decisions worth copying

  • updaterow_sumfrom the floatp_jtile before anyhalf/ hif8 cast
  • keep stage-1 score scratch and stage-2pvscratch separate in the readable baseline
  • implement the non-negative hif8 simulation without relying on unsupporteduint8 -> floatshortcuts
  • copy[M,64]score slices into contiguous scratch beforereinterpret(...)when the quantized helper needs contiguous lanes
  • handle non-alignedS2in score space with suffix invalidation and a sufficiently negative finite sentinel
  • handle non-alignedS1separately fromS2; invalid rows should become zero contribution to delayedp @ vwhile GM still writes only valid rows

Prefer another kernel when

  • you still want the plainp.half().float()value path
  • you are debugging the normalized float/half baseline before introducing hif8 behavior

【免费下载链接】cannbot-skillsCANNBot 是面向 CANN 开发的用于提升开发效率的系列智能体,本仓库为其提供可复用的 Skills 模块。项目地址: https://gitcode.com/cann/cannbot-skills

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/5/9 17:02:33

通过Taotoken CLI工具一键配置开发环境与团队协作

🚀 告别海外账号与网络限制!稳定直连全球优质大模型,限时半价接入中。 👉 点击领取海量免费额度 通过Taotoken CLI工具一键配置开发环境与团队协作 在团队协作开发中,快速、统一地配置大模型API接入环境是一个常见的痛…

作者头像 李华
网站建设 2026/5/9 16:58:47

2026论文降AI工具实测:4个核心维度选出高性价比首选

一、测评前言 2026年国内高校、期刊编辑部已经全面启用知网4.0、维普2026版、万方学术风控3.0三大AIGC溯源审核机制,检测逻辑从过去的“词频匹配”彻底升级为“语义逻辑溯源”,新增了段落逻辑结构、个人写作习惯画像、语义熵检测等核心考核维度。过去仅靠…

作者头像 李华
网站建设 2026/5/9 16:58:45

企业内如何利用Taotoken实现API Key的精细化访问控制与审计

🚀 告别海外账号与网络限制!稳定直连全球优质大模型,限时半价接入中。 👉 点击领取海量免费额度 企业内如何利用Taotoken实现API Key的精细化访问控制与审计 将大模型能力引入企业内部系统,例如用于智能客服、代码生成…

作者头像 李华
网站建设 2026/5/9 16:58:42

CANN/pyasc矩阵乘加API文档

asc.language.basic.mmad 【免费下载链接】pyasc 本项目为Python用户提供算子编程接口,支持在昇腾AI处理器上加速计算,接口与Ascend C一一对应并遵守Python原生语法。 项目地址: https://gitcode.com/cann/pyasc asc.language.basic.mmad(dst: Lo…

作者头像 李华
网站建设 2026/5/9 16:57:41

CANN/AMCT快速安装指南

环境部署 【免费下载链接】amct AMCT是CANN提供的昇腾AI处理器亲和的模型压缩工具仓。 项目地址: https://gitcode.com/cann/amct 使用AMCT工具之前,请先参考下面步骤完成基础环境搭建和源码下载,确保已经安装NPU固件、驱动和CANN软件&#xff08…

作者头像 李华