Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add mindspore-ai/akg --skill triton-ascend-case-reduction-amax-largegit clone --depth 1 https://github.com/mindspore-ai/akgWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/mindspore-ai/akg/triton-ascend-case-reduction-amax-large)<a href="https://agentmods.dev/skills/mindspore-ai/akg/triton-ascend-case-reduction-amax-large"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/triton-ascend-case-reduction-amax-large/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/mindspore-ai/akg/triton-ascend-case-reduction-amax-large"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/triton-ascend-case-reduction-amax-large.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00081 | $0.00647 |
| Opus 5 | $0.00041 | $0.00324 |
| Sonnet 5 | $0.00016 | $0.00129 |
| Haiku 4.5 | $0.00008 | $0.00065 |
Grade A, and why
triton-ascend-case-reduction-amax-large scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
大规模 Amax 归约优化(reduce轴映射多核)
任务特征
- 数据尺寸:(16, 262144),非reduce轴很小,reduce轴很大
- 策略:将reduce轴映射到多核,使用原子操作
优化 1:切分策略调整
# 错误:简单方式:非reduce轴映射多核
grid = lambda meta: (triton.cdiv(M, meta['BLOCK_SIZE_M']),)
# 正确:优化方式:reduce轴映射多核
grid = lambda meta: (triton.cdiv(N, meta['BLOCK_SIZE_N']),)
# Kernel内对列进行二次切分
for n_start in range(0, BLOCK_SIZE_N, SUB_BLOCK_SIZE_N):
n_offsets = pid * BLOCK_SIZE_N + n_start + tl.arange(0, SUB_BLOCK_SIZE_N)
优化 2:原子操作
方案一:循环内原子操作
for m_start in range(0, M, BLOCK_SIZE_M):
row_min = tl.min(curr_min, 1)
tl.atomic_min(output_ptrs, row_min, mask=mmask)
方案二:循环外原子操作
all_row_min = tl.full((M,), float('inf'), dtype=tl.float32)
for m_start in range(0, M, BLOCK_SIZE_M):
row_min = tl.min(curr_min, 1)
all_row_min = tl.insert_slice(all_row_min, row_min, ...)
tl.atomic_min(output_ptrs, all_row_min)
优化 3:配置
@triton.autotune(
configs=[
# grid=32<40, UB用满
triton.Config({'BLOCK_SIZE_M': 8, 'BLOCK_SIZE_N': 8192, 'SUB_BLOCK_SIZE_N': 1024}),
triton.Config({'BLOCK_SIZE_M': 16, 'BLOCK_SIZE_N': 8192, 'SUB_BLOCK_SIZE_N': 512}),
],
key=[...],
restore_value=['out_ptr0'], # autotune 必须加 restore_value
)
总结
非reduce轴很小、reduce轴很大时,将reduce轴映射到多核并结合原子操作,通过二次切分避免超出UB。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 13d ago First seen · 66 lines · 81 tokens per session scan A 139ee9621f06
triton-ascend-case-reduction-amax-large is a skill published in the GitHub repository mindspore-ai/akg (259 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 81 tokens to every session and 647 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
triton-ascend-case-reduction-mean-medium
A guide to optimizing medium-sized mean operations that reduce values along the first axis of a tensor.
triton-ascend-case-reduction-prod-small
A guide to optimizing small product reductions, which multiply a group of tensor values into one result.
triton-ascend-case-reduction-sum-large
A guide to optimizing large two-dimensional sum reductions when the non-reduced axis is very large and the reduced axis is medium-sized.
pypto-case-matvec
A matrix–vector multiplication workaround for cases where K is greater than 65,535. It replaces matrix multiplication with element-by-element multiplication followed by summing.
instrument-data-to-allotrope
Convert laboratory instrument output files (PDF, CSV, Excel, TXT) to Allotrope Simple Model (ASM) JSON format or flattened 2D CSV. Use this skill when scientists need to standardize instrument data for LIMS systems, data lakes, or downstream analysis. Supports auto-detection of instrument types. Outputs include full…
matlab
Build, review, migrate, and safely plan MATLAB or GNU Octave numerical workflows, including arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.