已合并
【docs】low error correction #42971
lyx324521创建于 7月27日
【docs】low error correction #42971
已合并
共 15 个文件变更+26-23
| @@ -27,7 +27,7 @@ export TORCH_TRANSFER_TO_NPU=0 | |||
| 27 | ## 使用约束 | 27 | ## 使用约束 |
| 28 | 28 | ||
| 29 | - 此环境变量必须在导入torch之前设置,否则不生效。 | 29 | - 此环境变量必须在导入torch之前设置,否则不生效。 |
| 30 | -- 更多transfer\_to\_npu相关约束参考[(推荐)自动迁移](https://gitcode.com/Ascend/ModelZoo-PyTorch/blob/master/PyTorch/docs/model_migration/auto_migration.md)。 | 30 | +- 更多transfer\_to\_npu相关约束参考[(推荐)自动迁移](https://gitcode.com/Ascend/ModelZoo-PyTorch/blob/master/PyTorch/docs/zh/model_migration/auto_migration.md)。 |
| 31 | 31 | ||
| 32 | ## 支持的型号 | 32 | ## 支持的型号 |
| 33 | 33 | ||
| @@ -13,7 +13,7 @@ LTO是成熟的编译优化技术,业界已经广泛使用。可以通过跨 | |||
| 13 | 13 | ||
| 14 | ## 编译技术:PGO反馈优化 | 14 | ## 编译技术:PGO反馈优化 |
| 15 | 15 | ||
| 16 | -PGO (Profile-Guided Optimization)是一种编译器优化技术。它通过在程序运行时收集性能数据,并在编译阶段使用这些数据来优化程序的性能。PGO需要两次编译过程,第一次编译时在应用代码中插桩,通过运行典型用例和业务,收集应用代码中函数及分支的执行次数信息,第二次编译时根据运行统计信息进一步优化,生成高性能应用。PGO的反馈优化技术在数据库、分布式存储等数据和计算密集型等前端瓶颈较高的场景效果显著,性能可提升10-30%。它能够有效减少计算时间和资源消耗,提升应用性能,显著降低运营成本并提高用户体验。 | 16 | +PGO(Profile-Guided Optimization)是一种编译器优化技术。它通过在程序运行时收集性能数据,并在编译阶段使用这些数据来优化程序的性能。PGO需要两次编译过程,第一次编译时在应用代码中插桩,通过运行典型用例和业务,收集应用代码中函数及分支的执行次数信息,第二次编译时根据运行统计信息进一步优化,生成高性能应用。PGO的反馈优化技术在数据库、分布式存储等数据和计算密集型等前端瓶颈较高的场景效果显著,性能可提升10-30%。它能够有效减少计算时间和资源消耗,提升应用性能,显著降低运营成本并提高用户体验。 |
| 17 | 17 | ||
| 18 | ## 编译优化方案介绍<a id="sustom-anchor"></a> | 18 | ## 编译优化方案介绍<a id="sustom-anchor"></a> |
| 19 | 19 | ||
| @@ -50,7 +50,7 @@ TorchNPU插件是基于昇腾的深度学习适配框架,使昇腾NPU可以支 | |||
| 50 | <td>支持以ranktable文件配置方式建立通信域。</td> | 50 | <td>支持以ranktable文件配置方式建立通信域。</td> |
| 51 | </tr> | 51 | </tr> |
| 52 | <tr> | 52 | <tr> |
| 53 | - <td rowspan="2">计算性能优化</td> | 53 | + <td rowspan="3">计算性能优化</td> |
| 54 | <td><a href="./automatic_core_binding.md">自动绑核</a></td> | 54 | <td><a href="./automatic_core_binding.md">自动绑核</a></td> |
| 55 | <td>通过设置粗/细粒度绑核,优化TorchNPU下发性能。</td> | 55 | <td>通过设置粗/细粒度绑核,优化TorchNPU下发性能。</td> |
| 56 | </tr> | 56 | </tr> |
| @@ -58,6 +58,10 @@ TorchNPU插件是基于昇腾的深度学习适配框架,使昇腾NPU可以支 | |||
| 58 | <td><a href="./stream_taskqueue_parallel_delivery.md">Stream级TaskQueue并行下发</a></td> | 58 | <td><a href="./stream_taskqueue_parallel_delivery.md">Stream级TaskQueue并行下发</a></td> |
| 59 | <td>每个Stream会初始化独立的TaskQueue和对应的Dequeue线程,实现真正的二级流水并行下发机制。</td> | 59 | <td>每个Stream会初始化独立的TaskQueue和对应的Dequeue线程,实现真正的二级流水并行下发机制。</td> |
| 60 | </tr> | 60 | </tr> |
| 61 | + <tr> | ||
| 62 | + <td><a href="./comp_opt.md">编译优化</a></td> | ||
| 63 | + <td>使用毕昇编译器的LTO和PGO编译优化技术,对Python、PyTorch、TorchNPU三个组件进行编译,可以有效提升程序性能。</td> | ||
| 64 | + </tr> | ||
| 61 | <tr> | 65 | <tr> |
| 62 | <td rowspan="2">辅助报错定位</td> | 66 | <td rowspan="2">辅助报错定位</td> |
| 63 | <td><a href="./feature_value_detection.md">特征值检测</a></td> | 67 | <td><a href="./feature_value_detection.md">特征值检测</a></td> |
| @@ -32,7 +32,7 @@ export PER_STREAM_QUEUE=1 | |||
| 32 | ## 约束说明 | 32 | ## 约束说明 |
| 33 | 33 | ||
| 34 | - 该特性依赖TaskQueue,当TASK\_QUEUE\_ENABLE配置为“1”/“2”时,此特性才能生效。 | 34 | - 该特性依赖TaskQueue,当TASK\_QUEUE\_ENABLE配置为“1”/“2”时,此特性才能生效。 |
| 35 | -- 该特性不支持[进程级在线恢复](https://gitcode.com/Ascend/mind-cluster/blob/master/docs/zh/scheduling/04_usage/resumable_training/04_verifying_fault_handling_policies.md#%E9%AA%8C%E8%AF%81%E8%BF%9B%E7%A8%8B%E7%BA%A7%E5%88%AB%E5%9C%A8%E7%BA%BF%E6%81%A2%E5%A4%8D)的场景。 | 35 | +- 该特性不支持[进程级在线恢复](https://gitcode.com/Ascend/mind-cluster/blob/branch_v26.1.0/docs/zh/scheduling/04_usage/04_resumable_training/03_configuration/02_configuring_fault_handling_policies.md#%E9%85%8D%E7%BD%AE%E8%BF%9B%E7%A8%8B%E7%BA%A7%E5%9C%A8%E7%BA%BF%E6%81%A2%E5%A4%8D)的场景。 |
| 36 | - 开启此特性时,非默认流的TaskQueue的OOM不会立即触发内存快照。 | 36 | - 开启此特性时,非默认流的TaskQueue的OOM不会立即触发内存快照。 |
| 37 | - 开启此特性时,多流情况下会有多个TaskQueue,对应多个线程,可能存在资源抢占,影响性能。 | 37 | - 开启此特性时,多流情况下会有多个TaskQueue,对应多个线程,可能存在资源抢占,影响性能。 |
| 38 | - 开启此特性时,如果多流间存在Event交互,为了Event在二级流水保序下发,一级流水可能会有额外耗时,影响性能。 | 38 | - 开启此特性时,如果多流间存在Event交互,为了Event在二级流水保序下发,一级流水可能会有额外耗时,影响性能。 |
| @@ -79,8 +79,8 @@ | |||
| 79 | |torch.cuda.memory.caching_allocator_alloc|torch_npu.npu.caching_allocator_alloc|是<br>暂不支持<term>Ascend 950DT</term>|-| | 79 | |torch.cuda.memory.caching_allocator_alloc|torch_npu.npu.caching_allocator_alloc|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 80 | |torch.cuda.memory.caching_allocator_delete|torch_npu.npu.caching_allocator_delete|是<br>暂不支持<term>Ascend 950DT</term>|-| | 80 | |torch.cuda.memory.caching_allocator_delete|torch_npu.npu.caching_allocator_delete|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 81 | |torch.cuda.memory.get_allocator_backend|torch_npu.npu.get_allocator_backend|是<br>暂不支持<term>Ascend 950DT</term>|-| | 81 | |torch.cuda.memory.get_allocator_backend|torch_npu.npu.get_allocator_backend|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 82 | -|torch.cuda.memory.CUDAPluggableAllocator|torch_npu.npu.NPUPluggableAllocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“torch_npu.npu.NPUPluggableAllocator”章节。| | 82 | +|torch.cuda.memory.CUDAPluggableAllocator|torch_npu.npu.NPUPluggableAllocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“[torch_npu.npu.NPUPluggableAllocator](https://gitcode.com/Ascend/op-plugin/blob/26.1.0/docs/zh/custom_APIs/torch_npu-npu/torch-npu-npu-NPUPluggableAllocator.md)”章节。| |
| 83 | -|torch.cuda.memory.change_current_allocator|torch_npu.npu.change_current_allocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“torch_npu.npu.change_current_allocator”章节。| | 83 | +|torch.cuda.memory.change_current_allocator|torch_npu.npu.change_current_allocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“[torch_npu.npu.change_current_allocator](https://gitcode.com/Ascend/op-plugin/blob/26.1.0/docs/zh/custom_APIs/torch_npu-npu/torch-npu-npu-change_current_allocator.md)”章节。| |
| 84 | |torch.cuda._sanitizer.enable_cuda_sanitizer|torch_npu.npu._sanitizer.enable_npu_sanitizer|是<br>暂不支持<term>Ascend 950DT</term>|-| | 84 | |torch.cuda._sanitizer.enable_cuda_sanitizer|torch_npu.npu._sanitizer.enable_npu_sanitizer|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 85 | |torch.cuda.memory.reset_accumulated_host_memory_stats| torch_npu.npu.reset_accumulated_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| | 85 | |torch.cuda.memory.reset_accumulated_host_memory_stats| torch_npu.npu.reset_accumulated_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 86 | |torch.cuda.memory.reset_peak_host_memory_stats|torch_npu.npu.reset_peak_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| | 86 | |torch.cuda.memory.reset_peak_host_memory_stats|torch_npu.npu.reset_peak_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| @@ -79,8 +79,8 @@ | |||
| 79 | |torch.cuda.caching_allocator_alloc|torch_npu.npu.caching_allocator_alloc|是<br>暂不支持<term>Ascend 950DT</term>|-| | 79 | |torch.cuda.caching_allocator_alloc|torch_npu.npu.caching_allocator_alloc|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 80 | |torch.cuda.caching_allocator_delete|torch_npu.npu.caching_allocator_delete|是<br>暂不支持<term>Ascend 950DT</term>|-| | 80 | |torch.cuda.caching_allocator_delete|torch_npu.npu.caching_allocator_delete|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 81 | |torch.cuda.get_allocator_backend|torch_npu.npu.get_allocator_backend|是|-| | 81 | |torch.cuda.get_allocator_backend|torch_npu.npu.get_allocator_backend|是|-| |
| 82 | -|torch.cuda.CUDAPluggableAllocator|torch_npu.npu.NPUPluggableAllocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“torch_npu.npu.NPUPluggableAllocator”章节。| | 82 | +|torch.cuda.CUDAPluggableAllocator|torch_npu.npu.NPUPluggableAllocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“[torch_npu.npu.NPUPluggableAllocator](https://gitcode.com/Ascend/op-plugin/blob/26.1.0/docs/zh/custom_APIs/torch_npu-npu/torch-npu-npu-NPUPluggableAllocator.md)”章节。| |
| 83 | -|torch.cuda.change_current_allocator|torch_npu.npu.change_current_allocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“torch_npu.npu.change_current_allocator”章节。| | 83 | +|torch.cuda.change_current_allocator|torch_npu.npu.change_current_allocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“[torch_npu.npu.change_current_allocator](https://gitcode.com/Ascend/op-plugin/blob/26.1.0/docs/zh/custom_APIs/torch_npu-npu/torch-npu-npu-change_current_allocator.md)”章节。| |
| 84 | |torch.cuda._sanitizer.enable_cuda_sanitizer|torch_npu.npu._sanitizer.enable_npu_sanitizer|是<br>暂不支持<term>Ascend 950DT</term>|-| | 84 | |torch.cuda._sanitizer.enable_cuda_sanitizer|torch_npu.npu._sanitizer.enable_npu_sanitizer|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 85 | |torch.cuda.reset_accumulated_host_memory_stats|torch_npu.npu.reset_accumulated_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| | 85 | |torch.cuda.reset_accumulated_host_memory_stats|torch_npu.npu.reset_accumulated_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 86 | |torch.cuda.reset_peak_host_memory_stats| torch_npu.npu.reset_peak_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| | 86 | |torch.cuda.reset_peak_host_memory_stats| torch_npu.npu.reset_peak_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| @@ -3,8 +3,8 @@ | |||
| 3 | > [!NOTE] | 3 | > [!NOTE] |
| 4 | > 若API“是否支持”为“是”,“限制与说明”为“-”,说明此API和原生API支持度保持一致。 | 4 | > 若API“是否支持”为“是”,“限制与说明”为“-”,说明此API和原生API支持度保持一致。 |
| 5 | 5 | ||
| 6 | -| API名称 |是否支持<br>暂不支持<term>Ascend 950DT</term>|限制与说明| | 6 | +| API名称 | 是否支持 | 限制与说明 | |
| 7 | -|------------------------------------------------------------------------------------------------------------------|--|--| | 7 | +|--|--|--| |
| 8 | | torch.cpu.current_stream |是<br>暂不支持<term>Ascend 950DT</term>|-| | 8 | | torch.cpu.current_stream |是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 9 | | torch.cpu.is_available |是<br>暂不支持<term>Ascend 950DT</term>|-| | 9 | | torch.cpu.is_available |是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 10 | | torch.cpu.synchronize |是<br>暂不支持<term>Ascend 950DT</term>|-| | 10 | | torch.cpu.synchronize |是<br>暂不支持<term>Ascend 950DT</term>|-| |
| @@ -79,8 +79,8 @@ | |||
| 79 | |torch.cuda.caching_allocator_alloc|torch_npu.npu.caching_allocator_alloc|是<br>暂不支持<term>Ascend 950DT</term>|-| | 79 | |torch.cuda.caching_allocator_alloc|torch_npu.npu.caching_allocator_alloc|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 80 | |torch.cuda.caching_allocator_delete|torch_npu.npu.caching_allocator_delete|是<br>暂不支持<term>Ascend 950DT</term>|-| | 80 | |torch.cuda.caching_allocator_delete|torch_npu.npu.caching_allocator_delete|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 81 | |torch.cuda.get_allocator_backend|torch_npu.npu.get_allocator_backend|是|-| | 81 | |torch.cuda.get_allocator_backend|torch_npu.npu.get_allocator_backend|是|-| |
| 82 | -|torch.cuda.CUDAPluggableAllocator|torch_npu.npu.NPUPluggableAllocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“torch_npu.npu.NPUPluggableAllocator”章节。| | 82 | +|torch.cuda.CUDAPluggableAllocator|torch_npu.npu.NPUPluggableAllocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“[torch_npu.npu.NPUPluggableAllocator](https://gitcode.com/Ascend/op-plugin/blob/26.1.0/docs/zh/custom_APIs/torch_npu-npu/torch-npu-npu-NPUPluggableAllocator.md)”章节。| |
| 83 | -|torch.cuda.change_current_allocator|torch_npu.npu.change_current_allocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“torch_npu.npu.change_current_allocator”章节。| | 83 | +|torch.cuda.change_current_allocator|torch_npu.npu.change_current_allocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“[torch_npu.npu.change_current_allocator](https://gitcode.com/Ascend/op-plugin/blob/26.1.0/docs/zh/custom_APIs/torch_npu-npu/torch-npu-npu-change_current_allocator.md)”章节。| |
| 84 | |torch.cuda._sanitizer.enable_cuda_sanitizer|torch_npu.npu._sanitizer.enable_npu_sanitizer|是<br>暂不支持<term>Ascend 950DT</term>|-| | 84 | |torch.cuda._sanitizer.enable_cuda_sanitizer|torch_npu.npu._sanitizer.enable_npu_sanitizer|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 85 | |torch.cuda.reset_accumulated_host_memory_stats|torch_npu.npu.reset_accumulated_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| | 85 | |torch.cuda.reset_accumulated_host_memory_stats|torch_npu.npu.reset_accumulated_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 86 | |torch.cuda.reset_peak_host_memory_stats| torch_npu.npu.reset_peak_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| | 86 | |torch.cuda.reset_peak_host_memory_stats| torch_npu.npu.reset_peak_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| @@ -79,8 +79,8 @@ | |||
| 79 | |torch.cuda.caching_allocator_alloc|torch_npu.npu.caching_allocator_alloc|是<br>暂不支持<term>Ascend 950DT</term>|-| | 79 | |torch.cuda.caching_allocator_alloc|torch_npu.npu.caching_allocator_alloc|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 80 | |torch.cuda.caching_allocator_delete|torch_npu.npu.caching_allocator_delete|是<br>暂不支持<term>Ascend 950DT</term>|-| | 80 | |torch.cuda.caching_allocator_delete|torch_npu.npu.caching_allocator_delete|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 81 | |torch.cuda.get_allocator_backend|torch_npu.npu.get_allocator_backend|是|-| | 81 | |torch.cuda.get_allocator_backend|torch_npu.npu.get_allocator_backend|是|-| |
| 82 | -|torch.cuda.CUDAPluggableAllocator|torch_npu.npu.NPUPluggableAllocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“torch_npu.npu.NPUPluggableAllocator”章节。| | 82 | +|torch.cuda.CUDAPluggableAllocator|torch_npu.npu.NPUPluggableAllocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“[torch_npu.npu.NPUPluggableAllocator](https://gitcode.com/Ascend/op-plugin/blob/26.1.0/docs/zh/custom_APIs/torch_npu-npu/torch-npu-npu-NPUPluggableAllocator.md)”章节。| |
| 83 | -|torch.cuda.change_current_allocator|torch_npu.npu.change_current_allocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“torch_npu.npu.change_current_allocator”章节。| | 83 | +|torch.cuda.change_current_allocator|torch_npu.npu.change_current_allocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“[torch_npu.npu.change_current_allocator](https://gitcode.com/Ascend/op-plugin/blob/26.1.0/docs/zh/custom_APIs/torch_npu-npu/torch-npu-npu-change_current_allocator.md)”章节。| |
| 84 | |torch.cuda._sanitizer.enable_cuda_sanitizer|torch_npu.npu._sanitizer.enable_npu_sanitizer|是<br>暂不支持<term>Ascend 950DT</term>|-| | 84 | |torch.cuda._sanitizer.enable_cuda_sanitizer|torch_npu.npu._sanitizer.enable_npu_sanitizer|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 85 | |torch.cuda.reset_peak_host_memory_stats|torch_npu.npu.reset_peak_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| | 85 | |torch.cuda.reset_peak_host_memory_stats|torch_npu.npu.reset_peak_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 86 | |torch.cuda.host_memory_stats|torch_npu.npu.host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| | 86 | |torch.cuda.host_memory_stats|torch_npu.npu.host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| @@ -79,8 +79,8 @@ | |||
| 79 | |torch.cuda.caching_allocator_alloc|torch_npu.npu.caching_allocator_alloc|是<br>暂不支持<term>Ascend 950DT</term>|-| | 79 | |torch.cuda.caching_allocator_alloc|torch_npu.npu.caching_allocator_alloc|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 80 | |torch.cuda.caching_allocator_delete|torch_npu.npu.caching_allocator_delete|是<br>暂不支持<term>Ascend 950DT</term>|-| | 80 | |torch.cuda.caching_allocator_delete|torch_npu.npu.caching_allocator_delete|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 81 | |torch.cuda.get_allocator_backend|torch_npu.npu.get_allocator_backend|是|-| | 81 | |torch.cuda.get_allocator_backend|torch_npu.npu.get_allocator_backend|是|-| |
| 82 | -|torch.cuda.CUDAPluggableAllocator|torch_npu.npu.NPUPluggableAllocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“torch_npu.npu.NPUPluggableAllocator”章节。| | 82 | +|torch.cuda.CUDAPluggableAllocator|torch_npu.npu.NPUPluggableAllocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“[torch_npu.npu.NPUPluggableAllocator](https://gitcode.com/Ascend/op-plugin/blob/26.1.0/docs/zh/custom_APIs/torch_npu-npu/torch-npu-npu-NPUPluggableAllocator.md)”章节。| |
| 83 | -|torch.cuda.change_current_allocator|torch_npu.npu.change_current_allocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“torch_npu.npu.change_current_allocator”章节。| | 83 | +|torch.cuda.change_current_allocator|torch_npu.npu.change_current_allocator|是<br>暂不支持<term>Ascend 950DT</term>|该接口涉及高危操作,使用请参考《自定义API》中的“[torch_npu.npu.change_current_allocator](https://gitcode.com/Ascend/op-plugin/blob/26.1.0/docs/zh/custom_APIs/torch_npu-npu/torch-npu-npu-change_current_allocator.md)”章节。| |
| 84 | |torch.cuda._sanitizer.enable_cuda_sanitizer|torch_npu.npu._sanitizer.enable_npu_sanitizer|是<br>暂不支持<term>Ascend 950DT</term>|-| | 84 | |torch.cuda._sanitizer.enable_cuda_sanitizer|torch_npu.npu._sanitizer.enable_npu_sanitizer|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 85 | |torch.cuda.reset_accumulated_host_memory_stats|torch_npu.npu.reset_accumulated_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| | 85 | |torch.cuda.reset_accumulated_host_memory_stats|torch_npu.npu.reset_accumulated_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| 86 | |torch.cuda.reset_peak_host_memory_stats| torch_npu.npu.reset_peak_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| | 86 | |torch.cuda.reset_peak_host_memory_stats| torch_npu.npu.reset_peak_host_memory_stats|是<br>暂不支持<term>Ascend 950DT</term>|-| |
| @@ -98,7 +98,7 @@ | |||
| 98 | 98 | ||
| 99 | > [!NOTE] | 99 | > [!NOTE] |
| 100 | > | 100 | > |
| 101 | - > 具体介绍可参见[混合精度适配](https://gitcode.com/Ascend/ModelZoo-PyTorch/blob/master/PyTorch/docs/mixed_precision_adaptation/README.md)。 | 101 | + > 具体介绍可参见[混合精度适配](https://gitcode.com/Ascend/ModelZoo-PyTorch/blob/master/PyTorch/docs/zh/mixed_precision_adaptation/adaptation_introduction.md)。 |
| 102 | 102 | ||
| 103 | ```diff | 103 | ```diff |
| 104 | import time | 104 | import time |
| @@ -109,7 +109,7 @@ | |||
| 109 | + from torch_npu.contrib import transfer_to_npu # 开启自动迁移 | 109 | + from torch_npu.contrib import transfer_to_npu # 开启自动迁移 |
| 110 | ``` | 110 | ``` |
| 111 | 111 | ||
| 112 | - 若未开启自动迁移,用户可参考[手工迁移](https://gitcode.com/Ascend/ModelZoo-PyTorch/blob/master/PyTorch/docs/model_migration/manual_migration.md)进行相关操作。 | 112 | + 若未开启自动迁移,用户可参考[手工迁移](https://gitcode.com/Ascend/ModelZoo-PyTorch/blob/master/PyTorch/docs/zh/model_migration/manual_migration.md)进行相关操作。 |
| 113 | 113 | ||
| 114 | 3. 开启AMP混合精度计算。若用户使用<term>Atlas A2 训练系列产品</term>、<term>Atlas A3 训练系列产品</term>或<term>Ascend 950DT</term>,则可以选择跳过此步骤。 | 114 | 3. 开启AMP混合精度计算。若用户使用<term>Atlas A2 训练系列产品</term>、<term>Atlas A3 训练系列产品</term>或<term>Ascend 950DT</term>,则可以选择跳过此步骤。 |
| 115 | 115 | ||
| @@ -169,7 +169,7 @@ | |||
| 169 | 169 | ||
| 170 | ## 进阶开发 | 170 | ## 进阶开发 |
| 171 | 171 | ||
| 172 | -- 如果您想体验PyTorch模型训练迁移更丰富的功能,请前往《[PyTorch 训练模型迁移调优指南](https://gitcode.com/Ascend/ModelZoo-PyTorch/blob/master/PyTorch/docs/README.md)》文档阅读了解。 | 172 | +- 如果您想体验PyTorch模型训练迁移更丰富的功能,请前往《[PyTorch训练模型迁移调优指南](https://gitcode.com/Ascend/ModelZoo-PyTorch/blob/master/PyTorch/docs/zh/README.md)》文档阅读了解。 |
| 173 | - 如果您想体验大模型训练更丰富的功能,请参见[表1](#模型迁移指导)了解。 | 173 | - 如果您想体验大模型训练更丰富的功能,请参见[表1](#模型迁移指导)了解。 |
| 174 | 174 | ||
| 175 | **表 1** 模型迁移指导<a id="模型迁移指导"></a> | 175 | **表 1** 模型迁移指导<a id="模型迁移指导"></a> |
| @@ -179,4 +179,3 @@ | |||
| 179 | |Megatron-LM分布式大模型|MindSpeed Core亲和加速模块|请参见《[分布式训练加速库迁移指南](https://gitcode.com/Ascend/MindSpeed/blob/master/docs/zh/user-guide/model-migration.md)》。| | 179 | |Megatron-LM分布式大模型|MindSpeed Core亲和加速模块|请参见《[分布式训练加速库迁移指南](https://gitcode.com/Ascend/MindSpeed/blob/master/docs/zh/user-guide/model-migration.md)》。| |
| 180 | |Megatron-LM大语言模型|MindSpeed LLM套件|请参见《[MindSpeed LLM文档导读](https://gitcode.com/Ascend/MindSpeed-LLM/blob/master/docs/zh/docs_guide.md)》。| | 180 | |Megatron-LM大语言模型|MindSpeed LLM套件|请参见《[MindSpeed LLM文档导读](https://gitcode.com/Ascend/MindSpeed-LLM/blob/master/docs/zh/docs_guide.md)》。| |
| 181 | |Megatron-LM多模态模型|MindSpeed MM套件|请参见《[MindSpeed MM迁移调优指南](https://gitcode.com/Ascend/MindSpeed-MM/blob/master/docs/zh/pytorch/model-migration.md)》。| | 181 | |Megatron-LM多模态模型|MindSpeed MM套件|请参见《[MindSpeed MM迁移调优指南](https://gitcode.com/Ascend/MindSpeed-MM/blob/master/docs/zh/pytorch/model-migration.md)》。| |
| 182 | - |大语言模型或多模态模型|MindSpeed RL套件|请参见《[MindSpeed RL使用指南](https://gitcode.com/Ascend/MindSpeed-RL/tree/master/docs/solutions)》。| | ||
| @@ -26,7 +26,7 @@ compiled_model = torch.compile(model, backend="npugraphs", options=None) | |||
| 26 | | `enable_shape_handling` | 形状处理配置 | | 26 | | `enable_shape_handling` | 形状处理配置 | |
| 27 | | `npu_backend` | 指定算子编译器(`"mlir"`或`"dvm"`,默认Triton) | | 27 | | `npu_backend` | 指定算子编译器(`"mlir"`或`"dvm"`,默认Triton) | |
| 28 | 28 | ||
| 29 | -## 调用样例 | 29 | +## 调用示例 |
| 30 | 30 | ||
| 31 | ```python | 31 | ```python |
| 32 | import torch | 32 | import torch |
| @@ -23,7 +23,7 @@ compiled_model = torch.compile(model, backend="npugraph_ex") | |||
| 23 | 23 | ||
| 24 | NPUGraph_EX支持的编译选项(`options`参数)和详细使用指导请参考《TorchAir》中的 [npugraph_ex后端](https://gitcode.com/Ascend/torchair/blob/26.1.0/docs/zh/npugraph_ex/npugraph_ex.md)。 | 24 | NPUGraph_EX支持的编译选项(`options`参数)和详细使用指导请参考《TorchAir》中的 [npugraph_ex后端](https://gitcode.com/Ascend/torchair/blob/26.1.0/docs/zh/npugraph_ex/npugraph_ex.md)。 |
| 25 | 25 | ||
| 26 | -## 调用样例 | 26 | +## 调用示例 |
| 27 | 27 | ||
| 28 | ```Python | 28 | ```Python |
| 29 | import torch | 29 | import torch |
| @@ -23,7 +23,7 @@ compiled_model = torch.compile(model, backend=npu_backend) | |||
| 23 | 23 | ||
| 24 | TorchAir-GE后端支持的编译选项(`compiler_config`参数)和详细使用指导请参考《TorchAir》中的 [GE图模式](https://gitcode.com/Ascend/torchair/blob/26.1.0/docs/zh/ascend_ir/quick_start.md)。 | 24 | TorchAir-GE后端支持的编译选项(`compiler_config`参数)和详细使用指导请参考《TorchAir》中的 [GE图模式](https://gitcode.com/Ascend/torchair/blob/26.1.0/docs/zh/ascend_ir/quick_start.md)。 |
| 25 | 25 | ||
| 26 | -## 调用样例 | 26 | +## 调用示例 |
| 27 | 27 | ||
| 28 | ```Python | 28 | ```Python |
| 29 | import torch | 29 | import torch |