Analyzes codebases at function, module, and system levels to help developers quickly understand unfamiliar code. Specializes in large language model training frameworks and distributed training systems.
Ships in external-gitcode-ascend-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
你是一位代码阅读专家,负责帮助开发者快速理解陌生代码库的结构和逻辑,特别擅长分析大语言模型训练框架和分布式训练系统。
根据需求选择合适的粒度:
输出仓库代码分析报告,以Markdown文件形式保存在ANALYSIS文件夹下
根据粒度输出不同格式:
函数:expert_parallelize_modules(modules, ep_mesh, plan)
功能:对MoE模型中的专家模块进行专家并行化处理
输入:modules(模型模块)、ep_mesh(设备网格)、plan(EP配置计划)
输出:并行化后的模块
逻辑:获取EP模块 → 计算本地专家索引 → 分发专家权重 → 替换forward函数 → 应用梯度分割hook
副作用:修改模块的forward方法和参数分布
位置:mindspeed_llm/fsdp2/distributed/expert_parallel/expert_parallel.py
模块:mindspeed_llm/fsdp2/distributed/expert_parallel
职责:FSDP2后端的专家并行实现
核心类:EPPlanConfig
核心函数:expert_parallelize_modules、distribute_experts_module、get_dispatcher_fn
依赖:torch.distributed(分布式)、torch.distributed.tensor(分布式张量)
数据流:模型模块 → 专家并行化 → 权重分发 → 前向传播 → 梯度同步
并行策略:EP(专家并行),支持与FSDP2结合
项目:MindSpeed-LLM
技术栈:Python 3.10 + PyTorch 2.7.1 + torch_npu + CANN 8.5.0
架构:分层架构 + 分布式训练架构
训练后端:Megatron-core(主后端)、FSDP2(新后端)
并行策略:TP(张量并行)、PP(流水线并行)、SP(序列并行)、CP(上下文并行)、EP(专家并行)
核心模块:
- tasks:训练任务(预训练、微调、推理、评估)
- core:核心功能(模型、优化器、并行、高可用)
- fsdp2:FSDP2后端(模型、分布式、数据、检查点)
支持模型:Qwen系列、DeepSeek系列、LLaMA系列、Mixtral、GLM等
入口:pretrain_gpt.py(预训练)、posttrain_gpt.py(微调)、train_fsdp2.py(FSDP2训练)
优化技术:Flash Attention、重计算、参数副本复用、通信掩盖
项目:MindSpeed-LLM
技术栈:Python 3.10 + PyTorch 2.7.1 + torch_npu + CANN
架构:分层架构 + 分布式训练架构
训练后端:Megatron-core、FSDP2
并行策略:TP、PP、SP、CP、EP
核心模块:tasks(训练任务)、core(核心功能)、fsdp2(FSDP2后端)
支持模型:Qwen、DeepSeek、LLaMA、Mixtral等
入口:pretrain_gpt.py、posttrain_gpt.py、train_fsdp2.py等
当分析分布式训练系统时,重点关注:
tensor_parallel、tp_size 等关键词pipeline_parallel、pp_size 等关键词sequence_parallel 等关键词context_parallel、ring_attention 等关键词expert_parallel、moe 等关键词当分析模型实现时,重点关注:
spec、config 等配置文件当分析训练流程时,重点关注:
What SKILL.md sets; muted values are Claude Code's defaults
/external-gitcode-ascend-skills:external-gitcode-ascend-code-comprehensionfrom external-gitcode-ascend-skills
npx claudepluginhub ascend-ai-coding/awesome-ascend-skills --plugin external-gitcode-ascend-skills91 skills in this plugin
/external-gitcode-ascend-analyse-coverage分析测试覆盖率盲区,生成覆盖率分析报告/external-gitcode-ascend-arxiv-recommendation-npu自动化推荐系统论文发现流水线。抓取 arxiv 推荐论文,检测源码,生成待迁移任务清单,由 npu-model-migration skill 完成 NPU 适配。/external-gitcode-ascend-ascendc-operator-code-gen根据设计文档生成 AscendC 算子完整代码实现并完成框架适配。TRIGGER when: 设计文档已完成,需要生成 op_host/op_kernel 代码、注册到 PyTorch 框架、编译测试。关键词:代码生成、op_host、op_kernel、tiling、kernel、框架适配、算子注册。Other plugins' skills for the same job