Skip to main content
Run any Skill in Manus
with one click

triton-ascend-elementwise-reduce-fused

Stars255
Forks48
UpdatedApril 7, 2026 at 02:26

适用于同时包含逐元素计算和全局归约两个阶段的复合算子。典型算子包括:损失函数(MSELoss, HuberLoss, HingeLoss, SmoothL1Loss, CrossEntropyLoss, KLDivLoss, CosineSimilarityLoss, TripletMarginLoss 等)、以及自定义的先逐元素变换再全局聚合的算子。这类算子的计算模式是:第一步对张量每个元素独立执行变换(差值、平方、clamp 等),第二步对变换结果做全局或按维度归约(sum/mean)得到标量或低维结果。与纯 elementwise 或纯 reduce 不同,这类算子需要在同一个 kernel 中融合两个阶段以避免中间结果的额外 GM 读写。

Installation

Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.

SKILL.md
readonly