external-mindstudio-cluster-fast-slow-rank-detector
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "external-mindstudio-cluster-fast-slow-rank-detector" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-81dcc729cea549f5bb38c45c2d38f8011f828ecc6c5f185f82c4c5850409543c. Verify the upstream source and version against https://github.com/ascend-ai-coding/awesome-ascend-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
An expert diagnostic skill for 'fast/slow card' analysis of Ascend cluster profiling performance data. Triggered when a user provides a cluster performance data path and requests analysis of fast/slow cards, slow nodes, load imbalance, or cluster bottlenecks; it accepts the cluster path and outputs macro-level findings and micro-level root cause analysis (e.g., hardware performance differences, communication latency, uneven task assignment).
Introduction source: third_party · ascend-ai-coding · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: external-mindstudio-cluster-fast-slow-rank-detector
description: 专门用于 Ascend 集群 Profiling 性能数据的“快慢卡”诊断专家技能。当用户提供【集群性能数据目录/路径】并要求分析【快慢卡】、【慢节点】、【负载不均衡】或【集群瓶颈】时,必须触发此技能。该技能会自动接收集群路径,调度相关工具输出快慢卡的宏观定性与微观根因(如
Host 下发瓶颈、算子计算劣化)。
original-name: cluster-fast-slow-rank-detector
synced-from: https://github.com/kali20gakki/mindstudio-skills
synced-date: '2026-05-26'
synced-commit: f6695da3cfa864a100db5a94f594b638aeff6389
license: UNKNOWN集群快慢卡诊断
1. 技能目标
在 Ascend 多卡/集群场景下,利用 Advisor 工具结合专家规则,自动识别因计算、通信或 Host 下发导致的性能瓶颈卡(慢卡),并下钻定位微观根因。
2. 诊断先验知识库 (Expert Rules)
禁止仅凭单项指标字面意思下结论,必须严格遵守以下华为官方诊断逻辑:
- 【Host 下发瓶颈 (伪快卡)】
- 现象:某卡(Rank X)的
Free Time极长(占比 > 10% 或远超均值),且Compute和Communication时间异常偏短。 - 定性:Rank X 绝非快卡,而是导致集群阻塞的“慢卡”。 CPU 下发慢导致其 NPU 饿死(产生巨大 Free Time)。当它终于发起通信时,其他卡已等待多时(其他卡 Wait 长),故其通信瞬间完成。
- 动作:调用
scripts/compare_api_stats.py,重点观察launch、aclrtSynchronizeDevice等下发/同步 API 的耗时与间隙差异。
- 现象:某卡(Rank X)的
- 【纯计算快慢卡】
- 现象:各卡
Free Time普遍较短且均匀,但某卡Compute Time显著大于均值。 - 定性:计算型慢卡。若单算子调用次数 (
count) 不同,为负载切分不均;若次数相同但平均耗时 (avg_time) 激增,为算子硬件劣化或动态 Shape 导致。 - 动作:调用
scripts/compare_op_stats.py对比算子执行差异。
- 现象:各卡
- 【通信/慢链路瓶颈】
- 现象:各卡通信带宽远低于理论值(如 SDMA < 2GB/s)。
- 定性:通常为小包通信(ZeRO3 切分过细)、SDMA 地址未对齐或硬件问题。
3. 硬性约束 (MUST DO)
- 执行已有脚本,严禁造轮子:微观下钻环节(Step 3)必须且只能通过在终端执行
scripts/下的对比脚本获取差异数据。严禁在未执行脚本前自行读取 CSV/DB 进行 Diff 分析。 - 禁止 Trace 分析:本技能流程不包含 Timeline 级分析,Step 4 输出报告后立即结束,禁止主动读取
trace_view.json。
4. 标准操作流程 (SOP)
- 宏观体检:强制调用
msprof-analyze-advisor工具输入集群路径,获取总体耗时极差与“慢卡分析”矩阵。 - 瓶颈定性:对照【先验知识库】,判定核心瓶颈属于
Host下发慢、计算慢还是纯通信慢,并锁定真正的“慢卡 RankID”。 - 微观下钻:根据瓶颈类型,在终端直接执行下方对应的对比脚本(计算慢用 OP 脚本,下发慢用 API 脚本)。仅当路径自动发现失败报错时,才可通过补充
--slow-path参数重试。 - 输出报告:按以下结构输出最终回复:
- 诊断结论:瓶颈类型及真正慢卡的 RankID。
- 宏观证据:引用 Advisor 报告中的极差数据(如 Free Time 对比)。
- 微观根因:结合脚本输出的 Top 差异数据(特定 API 或算子的耗时比对),解释物理原因。
- 优化建议:给出针对性建议(如绑核、切分策略、排查算子Shape差异等)。
5. 脚本调用手册
对比脚本统一存放在本技能目录的 scripts/ 文件夹中,支持自动发现集群目录或手动指定文件(优先 CSV,次选 DB)。
核心命令模板:
# 【计算类瓶颈】调用算子对比脚本(将 <本技能目录> 替换为 get_skill 返回中的路径)
python <本技能目录>/scripts/compare_op_stats.py <集群数据根目录> <慢卡RankID> <快卡RankID> [--top N]
# 【下发类瓶颈】调用 API 对比脚本
python <本技能目录>/scripts/compare_api_stats.py <集群数据根目录> <慢卡RankID> <快卡RankID> [--top N]
参数说明:
- cluster_pah: 集群数据根目录(包含 profilerinfo{rank}.json)。
- slow_rank / fast_rank: 慢卡与快卡(基准)的 Rank ID。
- --top N: (可选)输出差异最大的前 N 条,默认 20。
- --slow-path / --fast-path: (可选)当集群自动发现机制报错时,用于手动指定慢/快卡的 .csv 或 .db 绝对路径。
- --json: (可选)以 JSON 格式结构化输出。
Current listing version
0.0.1
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 针对 Ascend 集群 Profiling 性能数据的“快慢卡”诊断,属于特定领域的高频刚需工具(AI 训练性能调优),直接解决用户明确的核心任务痛点(定位慢卡根因)
- 具备高实际使用价值,能够显著提升日常高频场景的效率
Highlights
- description 明确指定了触发条件(提供【集群性能数据目录/路径】并要求分析【快慢卡】、【慢节点】、【负载不均衡】或【集群瓶颈】),覆盖多种变体,边界清晰
Highlights
- 文档结构清晰(技能目标、先验知识库、硬性约束、标准操作流程、脚本调用手册),步骤划分明确(宏观体检、瓶颈定性、微观下钻、输出报告)
- 有详细的端到端示例和命令模板,frontmatter 完整
Highlights
- 工具来源明确(msprof-analyze-advisor、scripts/compare_op_stats.py、scripts/compare_api_stats.py),参数说明详细
- 覆盖了主要异常处理(如路径自动发现失败时手动指定),不可逆操作有确认机制(通过脚本执行获取数据)
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- github.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.