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 tilelang-cuda-synchronizationgit 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/tilelang-cuda-synchronization)<a href="https://agentmods.dev/skills/mindspore-ai/akg/tilelang-cuda-synchronization"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/tilelang-cuda-synchronization/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/tilelang-cuda-synchronization"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/tilelang-cuda-synchronization.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.00062 | $0.02208 |
| Opus 5.5 | $0.00025 | $0.00883 |
| Sonnet 5.5 | $0.00012 | $0.00442 |
| Haiku 4.5 | $0.00006 | $0.00221 |
Grade A, and why
tilelang-cuda-synchronization 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 3mo 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.
How it starts
The opening of the file, as written. The whole thing — 291 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TileLang CUDA 同步和线程安全
本文档详细说明 TileLang 中 T.sync_threads() 的使用规范和线程安全最佳实践。同步问题是 TileLang 编程中最常见也是最危险的错误来源。
1. T.sync_threads() 使用规范
⚠️ 严格禁止的使用场景
1.1 条件分支中的同步
# ❌ 错误示例 - 会导致死锁
if condition:
T.sync_threads() # 只有部分线程执行,其他线程永远等待
# ✅ 正确做法 - 所有线程都执行同步
T.sync_threads()
if condition:
# 同步后的操作
1.2 循环中的条件同步
# ❌ 错误示例 - 死锁风险
for i in range(n):
if tid < threshold:
T.sync_threads() # 死锁风险
# ✅ 正确做法
for i in range(n):
T.sync_threads() # 所有线程都同步
if tid < threshold:
# 同步后的操作
1.3 共享内存分配后的条件同步
# ❌ 错误示例
if tid < N:
shared_mem = T.alloc_shared((N,), dtype)
T.sync_threads() # 只有部分线程分配了共享内存
# ✅ 正确做法
shared_mem = T.alloc_shared((N,), dtype)
T.sync_threads()
if tid < N:
# 使用共享内存
2. ❌ 绝对禁止:手动归约
手动归约是导致线程卡死的最常见原因。必须使用内置归约函数。
手动归约的危险
# ❌ 绝对禁止:手动归约会导致线程卡死
while stride > 0:
if tid < stride:
shared[tid] += shared[tid + stride]
T.sync_threads() # 死锁风险,线程卡死
stride //= 2
# ❌ 绝对禁止:条件分支中的同步
if condition:
T.sync_threads() # 死锁风险
# ❌ 绝对禁止:循环中的条件同步
for i in range(n):
if tid < threshold:
T.sync_threads() # 死锁风险
症状识别
- UTL(GPU 利用率)打满但 MEM 低: 通常是线程卡死在同步点
- 内核永远不返回: 死锁导致的无限等待
- 性能极差: 不当的同步模式导致串行化
3. ✅ 正确的同步模式
3.1 在共享内存操作前后同步
# ✅ 写入共享内存后同步
shared_mem[tid] = value
T.sync_threads() # 确保所有写入完成
# ✅ 读取共享内存前同步
T.sync_threads() # 确保所有写入完成
result = shared_mem[tid]
3.2 确保所有线程参与同步
# ✅ 正确的同步模式
T.sync_threads() # 所有线程都必须执行
# 后续操作
3.3 避免不必要的同步
# ❌ 过度同步
for i in range(n):
T.sync_threads() # 每次迭代都同步,开销大
# ✅ 只在必要时同步
# 只在数据依赖需要时添加同步
4. ✅ 推荐的内置函数(替代手动同步)
4.1 内置归约函数
# ✅ 推荐:内置归约函数,无需手动同步
T.reduce_sum(input_tensor, output_tensor, dim=axis) # 求和归约
T.reduce_max(input_tensor, output_tensor, dim=axis) # 最大值归约
T.reduce_min(input_tensor, output_tensor, dim=axis) # 最小值归约
T.reduce_mean(input_tensor, output_tensor, dim=axis) # 平均值归约
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.
- 3mo ago First seen · 291 lines · 62 tokens per session scan A 08ac4b07e61a
tilelang-cuda-synchronization is a skill published in the GitHub repository mindspore-ai/akg (269 stars, last pushed yesterday), licensed Apache-2.0. It adds 62 tokens to every session and 2,208 once invoked, about $0.0002 per session on Opus 5.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.
tilelang-cuda-synchronization compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| tilelang-cuda-synchronizationmindspore-ai/akg | Skill | 269 | yesterday | Apache-2.0 | A | 62 | Claude Code, Codex |
| ai-loopsickn33/agentic-awesome-skills | Skill | 51k | today | MIT | A | 28 | Claude Code |
| software-implementationstencila/stencila | Skill | 916 | today | Apache-2.0 | A | 124 | Claude Code |
| project-executionathola/claude-night-market | Skill | 358 | yesterday | MIT | A | 31 | Claude Code |
| architecture-paradigmsathola/claude-night-market | Skill | 358 | yesterday | MIT | A | 27 | Claude Code |
| algolia-search-v2diegosouzapw/awesome-omni-skills | Skill | 181 | 4d ago | MIT | A | 50 | Claude Code, Codex |
| notion-spec-to-implementationseaworld008/Commonly-used-high-value-skills | Skill | 75 | 6d ago | MIT | A | 38 | Codex |