尧图网络 高端网站定制 · 原创设计
免费咨询热线
400-888-6620
免费获取方案
CANN PTO TAXPY缩放累加指令
TAXPY【免费下载链接】pto-isaParallel Tile Operation (PTO) is a virtual instruction set architecture designed by Ascend CANN, focusing on tile-level operations. This repository offers high-performance, cross-platform tile operations across Ascend platforms.项目地址: https://gitcode.com/cann/pto-isaIntroductionPerform an in-place scaled accumulation (AXPY, $a \cdot x y$) on a tile: scalesrc0byscalarand accumulate it intodst.$$ \mathrm{dst}{i,j} \leftarrow \mathrm{scalar} \cdot \mathrm{src0}{i,j} \mathrm{dst}_{i,j} $$dstis both the accumulation input ($y$) and the output, and must be initialized before the call;src0($x$) is read-only;scalar($a$) is a scalar.Math InterpretationFor each element(i, j)in the valid region:$$ \mathrm{dst}{i,j}^{\text{new}} \mathrm{scalar} \cdot \mathrm{src0}{i,j} \mathrm{dst}_{i,j}^{\text{old}} $$dst: read-modify-write (RMW). Its old value is read as the accumulation base $y$, and $\mathrm{scalar} \cdot x y$ is written back.src0: read-only, contributes element-wise ($x$).scalar: the scalar scale factor ($a$), of typeTileDataSrc::DType.Unless otherwise specified, semantics are defined over the valid region and target-dependent behavior is marked as implementation-defined.C IntrinsicsDeclared ininclude/pto/common/pto_instr.hpp.template typename TileDataDst, typename TileDataSrc, typename... WaitEvents PTO_INST RecordEvent TAXPY(TileDataDst dst, TileDataSrc src0, typename TileDataSrc::DType scalar, WaitEvents ...events);ParameterDirectionMeaningdstinput/outputAccumulation base and result tile ($y$), read-modify-write,Vecsrc0inputScaled source tile ($x$), read-only,Vec, same valid shape asdstscalarinputScalar scale factor ($a$), of typeTileDataSrc::DTypeevents...inputWait events (WaitEvents); an implicitTSYNCprecedes the opTile Sizes Data TypesFor a valid tile shape of $M \times N$:TiledtypeValid shapeTileTypeNotesdsthalforfloat$M \times N$Vec(UB)Accumulation base result (RMW)src0halforfloat$M \times N$Vec(UB)Scaled source, element-wisedstandsrc0must have identical valid row and column counts.Supported Input Dtypesdstdtypesrc0dtypescalardtypeNoteshalfhalfhalfSame-type path, directvaxpyfloatfloatfloatSame-type path, directvaxpyfloathalfhalfDiff path:src0widened to FP32 before accumulationdstandsrc0must share a dtype, ordstisfloatwhilesrc0ishalf(a half→float widening accumulation is allowed). Ahalfdstwith afloatsrc0is illegal (rejected by an in-implementationstatic_assert).Implementation NotesTAXPY runs on the vector pipeline (PIPE_V) using thevaxpy($a \cdot x y$) vector intrinsic:Same type (dstandsrc0share a dtype): loadsrc0anddstper repeat, runvaxpy(dst, src0, scalar), and store back todst; tail columns shorter than a full repeat are masked by a predicate.Diff type (dstfloat,src0half): the half data ofsrc0is widened to FP32 before accumulating (on A5 viaUNPK_B16unpack followed byvcvt; on A2/A3 handled natively byvaxpywith 4-block src / 8-block dst).On A2/A3, count mode vs. norm mode is selected based on whether the repeat-stride overflows and the relation between column count and row count, so any valid shape is covered.ConstraintsConstraintApplies toReasondstandsrc0must beTileType::Vecall targetsexecutes on UB (vector pipeline)dstandsrc0share the valid shape ($M \times N$)all targetsone-to-one element mappingdstdtype ∈ {half,float}all targetsfloating-point widths supported byvaxpydst/src0dtype equal, or (float,half)all targetsonly half→float widening accumulation alloweddstmust be initialized before the callall targetsdstis read in as the accumulation base $y$Examples// dst must be initialized first (as the accumulation base y); result: dst scalar * src0 dst TAXPY(dstTile, srcTile, scalar);Seetests/npu/a5/src/st/testcase/taxpy/(A5),tests/npu/a2a3/src/st/testcase/taxpy/(A2/A3),tests/npu/kirin9030/src/st/testcase/taxpy/(Kirin9030), andtests/cpu/st/testcase/taxpy/(CPU reference) for complete ST examples.【免费下载链接】pto-isaParallel Tile Operation (PTO) is a virtual instruction set architecture designed by Ascend CANN, focusing on tile-level operations. This repository offers high-performance, cross-platform tile operations across Ascend platforms.项目地址: https://gitcode.com/cann/pto-isa创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
RELATED

相关推荐

Hackintool黑苹果配置终极指南:打造完美macOS系统的完整实战手册

Hackintool黑苹果配置终极指南:打造完美macOS系统的完整实战手册

Hackintool黑苹果配置终极指南:打造完美macOS系统的完整实战手册 【免费下载链接】Hackintool The Swiss army knife of vanilla Hackintoshing 项目地址: https://gitcode.com/gh_mirrors/ha/Hackintool 想要在普通PC上运行macOS却总是被显卡驱动、USB端口、…

📅 2026/9/8 15:59:36
LFM2.5-Embedding-350M-bf16 vs 其他嵌入模型:为什么选择这个Apple Silicon优化版本

LFM2.5-Embedding-350M-bf16 vs 其他嵌入模型:为什么选择这个Apple Silicon优化版本

LFM2.5-Embedding-350M-bf16 vs 其他嵌入模型:为什么选择这个Apple Silicon优化版本 【免费下载链接】LFM2.5-Embedding-350M-bf16 项目地址: https://ai.gitcode.com/hf_mirrors/mlx-community/LFM2.5-Embedding-350M-bf16 LFM2.5-Embedding-350M-bf16是一…

📅 2026/10/26 1:53:42
每日10分钟,30天精通CmdChallenge:程序员的命令行能力提升计划

每日10分钟,30天精通CmdChallenge:程序员的命令行能力提升计划

每日10分钟,30天精通CmdChallenge:程序员的命令行能力提升计划 【免费下载链接】cmdchallenge This repo is mirror of https://gitlab.com/jarv/cmdchallenge 项目地址: https://gitcode.com/gh_mirrors/cm/cmdchallenge 你是否曾经在面对复杂的…

📅 2026/9/23 3:12:21
MORE NEWS

更多资讯

📰

热数据处理技术对比与企业决策优化实践

1. 项目概述:热数据报告与企业决策的深度耦合 热数据(Hot Data)这个概念在数据分析领域已经存在多年,但直到最近三年才真正成为企业数字化转型的核心资产。与传统的"冷数据"相比,热数据最大的特征是其时效性…

📰

Vue3 组合查询条件树组件:递归渲染、序列化与校验实践

简介:面向 Vue.js 前端开发者的一份组合查询条件示例源码,适合正在实现多字段筛选、动态查询参数拼装与结果联动更新的初中级开发者参考。代码围绕组件化查询表单展开:输入框、下拉选择、日期等字段各自独立封装,借助计算属性与侦…

📰

AI驱动的测试数据生成:原理、实践与金融案例

1. 项目概述:AI如何重塑测试数据生成领域在软件开发和测试领域,数据质量直接影响着测试结果的可靠性。传统测试数据生成方法通常依赖手工创建或生产环境数据脱敏,这两种方式都存在明显局限:手工创建耗时耗力且覆盖面有限&#xff…

📰

2026年贵阳科目一交警手势题怎么记?实用技巧来了

一、痛点深度剖析:交警手势题不是“背8张图”那么简单我们团队在贵阳观山湖做科一科四理论咨询近10年,发现交警手势题的难点不在题量,而在动态空间关系。很多贵阳学员背图时记住了“左手”“右手”,但题干一换、左右镜像一绕&…

📰

AI伦理测试实战:从技术合规到社会责任

1. 新规背景与测试工程师的挑战当欧盟AI法案将"高风险AI系统"的伦理评估列为强制要求时,整个行业突然意识到:模型准确率99%的后面,可能藏着100%的伦理灾难。作为第一批接到AI伦理测试需求的测试工程师,我清楚地记得那个…

📰

Python+Django构建中医药材销售系统设计与实现

1. 项目背景与选题价值 中医药材销售系统作为传统医药行业数字化转型的典型应用场景,正在经历从纸质台账到信息化管理的转变过程。这个毕业设计选题结合了Python技术栈与中医药行业特性,具有鲜明的时代特征和实践价值。 去年我在参与某中药房管理系统升…

TODAY

今日更新

THIS WEEK

本周精选

THIS MONTH

本月热门

读完文章,想聊聊您的网站?

告诉我们您的行业与需求,资深顾问一对一梳理方案与报价,全程免费。

📞 💬