What is torch_npu?
华为昇腾 Ascend Extension for PyTorch (torch_npu) 的环境检查、部署与能力指引。在用户使用 @torch_npu、昇腾 NPU、CANN、或需要将 PyTorch 迁移到 NPU 时自动应用;当用户使用 @torch_npu_doc 时,基于 skill 的 reference 文档提供项目内中文文档能力说明。 Source: ascend-ai-coding/awesome-ascend-skills.
华为昇腾 Ascend Extension for PyTorch (torch_npu) 的环境检查、部署与能力指引。在用户使用 @torch_npu、昇腾 NPU、CANN、或需要将 PyTorch 迁移到 NPU 时自动应用;当用户使用 @torch_npu_doc 时,基于 skill 的 reference 文档提供项目内中文文档能力说明。
Quickly install torch_npu AI skill to your development environment via command line
Source: ascend-ai-coding/awesome-ascend-skills.
检查 PyTorch 与 Python 版本是否在配套范围内(参见 README.zh.md 中的「PyTorch与Python版本配套表」):
| 设备与内存 | torch.npu:设备管理、devicecount、currentdevice、setdevice、synchronize、Stream/Event、内存统计与分配(memoryallocated、emptycache、MemPool 等)。 | | 张量/存储 | tensor.npu()、tensor.isnpu、NPU Storage、序列化 torch.save/load 支持 NPU,DDP/多进程 reductions。 | | 训练/优化 | torch.npu.amp 混合精度、torchnpu.optim、FSDP 补丁(ShardedGradScaler)、梯度检查点默认 NPU。 |
| 分布式 | torchnpu.distributed:HCCL/LCCL 后端、ishcclavailable、reinitprocessgroup、RPC、symmetric memory、DTensor 规则。 | | 扩展 API | torchnpu.contrib:NMS、IoU 系列、ROIAlign、DCN、FusedAttention、自定义模块(如 DropoutWithByteMask)等。 | | 图与编译 | NPU Graph(npugraphify)、Dynamo、Inductor、torch.compile 支持 NPU。 |
华为昇腾 Ascend Extension for PyTorch (torch_npu) 的环境检查、部署与能力指引。在用户使用 @torch_npu、昇腾 NPU、CANN、或需要将 PyTorch 迁移到 NPU 时自动应用;当用户使用 @torch_npu_doc 时,基于 skill 的 reference 文档提供项目内中文文档能力说明。 Source: ascend-ai-coding/awesome-ascend-skills.
Stable fields and commands for AI/search citations.
npx skills add https://github.com/ascend-ai-coding/awesome-ascend-skills --skill torch_npuBrowse more skills from ascend-ai-coding/awesome-ascend-skills
华为昇腾 Ascend Extension for PyTorch (torch_npu) 的环境检查、部署与能力指引。在用户使用 @torch_npu、昇腾 NPU、CANN、或需要将 PyTorch 迁移到 NPU 时自动应用;当用户使用 @torch_npu_doc 时,基于 skill 的 reference 文档提供项目内中文文档能力说明。 Source: ascend-ai-coding/awesome-ascend-skills.
Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.) Copy and run this command: npx skills add https://github.com/ascend-ai-coding/awesome-ascend-skills --skill torch_npu Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code, Cursor, or OpenClaw
https://github.com/ascend-ai-coding/awesome-ascend-skills