·torch_npu

華為Ascend Extension for PyTorch (torch_npu)環境檢查、部署與能力指南。當使用者使用@torch_npu、Ascend NPU、CANN或需要將PyTorch遷移到NPU時自動套用;當使用者使用@torch_npu_doc時,它會根據技能參考提供項目內的中文文件能力描述。

14安裝·1熱度·@ascend-ai-coding

安裝

$npx skills add https://github.com/ascend-ai-coding/awesome-ascend-skills --skill torch_npu

如何安裝 torch_npu

透過命令列快速安裝 torch_npu AI 技能到你的開發環境

  1. 開啟終端機: 開啟你的終端機或命令列工具(如 Terminal、iTerm、Windows Terminal 等)
  2. 執行安裝指令: 複製並執行以下指令:npx skills add https://github.com/ascend-ai-coding/awesome-ascend-skills --skill torch_npu
  3. 驗證安裝: 安裝完成後,技能將自動設定到你的 AI 程式設計環境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

來源:ascend-ai-coding/awesome-ascend-skills。

SKILL.md

查看原文

检查 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、Ascend NPU、CANN或需要將PyTorch遷移到NPU時自動套用;當使用者使用@torch_npu_doc時,它會根據技能參考提供項目內的中文文件能力描述。 來源:ascend-ai-coding/awesome-ascend-skills。

可引用資訊

為搜尋與 AI 引用準備的穩定欄位與指令。

安裝指令
npx skills add https://github.com/ascend-ai-coding/awesome-ascend-skills --skill torch_npu
分類
</>開發工具
認證
收錄時間
2026-03-09
更新時間
2026-03-10

Browse more skills from ascend-ai-coding/awesome-ascend-skills

快速解答

什麼是 torch_npu?

華為Ascend Extension for PyTorch (torch_npu)環境檢查、部署與能力指南。當使用者使用@torch_npu、Ascend NPU、CANN或需要將PyTorch遷移到NPU時自動套用;當使用者使用@torch_npu_doc時,它會根據技能參考提供項目內的中文文件能力描述。 來源:ascend-ai-coding/awesome-ascend-skills。

如何安裝 torch_npu?

開啟你的終端機或命令列工具(如 Terminal、iTerm、Windows Terminal 等) 複製並執行以下指令:npx skills add https://github.com/ascend-ai-coding/awesome-ascend-skills --skill torch_npu 安裝完成後,技能將自動設定到你的 AI 程式設計環境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

這個 Skill 的原始碼在哪?

https://github.com/ascend-ai-coding/awesome-ascend-skills

詳情

分類
</>開發工具
來源
skills.sh
收錄時間
2026-03-09