Vec-to-Cube-to-Vec Pattern【免费下载链接】cannbot-skillsCANNBot 是面向 CANN 开发的用于提升开发效率的系列智能体本仓库为其提供可复用的 Skills 模块。项目地址: https://gitcode.com/cann/cannbot-skillsGeneric baseline only. For a2 (b3) kernels, prefer the a2-specific patterns underagent/references/patterns/(e.g.,a2-cube-vec.md,a2-cube-vec-cube.md) and readagent/references/constraints/a2-device.mdfor device-side rules.Read this file when the kernel needs vec preprocessing, cube compute, and vec postprocessing in one fused flow.Use this pattern wheninput data needs a vec-side transform firstcube does the main matmul or cube-heavy stagevec performs the final output transformMinimal flowGM - UB - vf - UB - L1 - L0 - L0C - UB - vf - GMOwnership ruleThis pattern has two cross-side handoffs:vec - cube needsVcMutexcube - vec needsCvMutexKeep those two ownership edges conceptually separate. Do not let one counter or one fuzzy stage boundary blur them together.What usually matters mostseparate stage countersclear stage ownershipavoiding accidental reuse of one buffer lifetime across both handoff directionskeeping validation incremental instead of building the whole fusion at onceTypical files to studyagent/example/kernels/a5/vec_cube_vec_scale2_abs_add1_matmul.py【免费下载链接】cannbot-skillsCANNBot 是面向 CANN 开发的用于提升开发效率的系列智能体本仓库为其提供可复用的 Skills 模块。项目地址: https://gitcode.com/cann/cannbot-skills创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考