已合并
rename torchao-ascend #90
rename torchao-ascend #90
已合并
梁松伟创建于 20 天前
共 18 个文件变更+66-66
@@ -1,31 +1,31 @@
1# 版本配套1# 版本配套
2 2 
3-torchao_npu 需与特定版本的 torchao、PyTorch、TorchNPU、CANN 及 Python 配合使用。各版本间的匹配关系由本文件统一维护,建议优先使用推荐版本组合以确保最佳兼容性和性能。固件与驱动的版本配套与所使用的昇腾硬件及 CANN 版本相关,具体选择请参考 [固件与驱动安装页面](https://www.hiascend.com/hardware/firmware-drivers/commercial)。3+torchao-ascend 需与特定版本的 torchao、PyTorch、TorchNPU、CANN 及 Python 配合使用。各版本间的匹配关系由本文件统一维护,建议优先使用推荐版本组合以确保最佳兼容性和性能。固件与驱动的版本配套与所使用的昇腾硬件及 CANN 版本相关,具体选择请参考 [固件与驱动安装页面](https://www.hiascend.com/hardware/firmware-drivers/commercial)。
4 4 
5## 推荐版本组合5## 推荐版本组合
6 6 
7| 组件 | 推荐版本 |7| 组件 | 推荐版本 |
8|:----------:|:--------------------------------:|8|:----------:|:--------------------------------:|
9-| torchao_npu | 0.18.0 |9+| torchao-ascend | 0.18.0 |
10| torchao | >= 0.18.0, < 0.19.0(0.18.x) |10| torchao | >= 0.18.0, < 0.19.0(0.18.x) |
11| PyTorch | 2.11.0 |11| PyTorch | 2.11.0 |
12| TorchNPU | 2.11.0(安装包版本) |12| TorchNPU | 2.11.0(安装包版本) |
13| CANN | 9.1.0 |13| CANN | 9.1.0 |
14| Python | 3.10 / 3.11 / 3.12 |14| Python | 3.10 / 3.11 / 3.12 |
15 15 
16-## torchao_npu 版本配套表16+## torchao-ascend 版本配套表
17 17 
18下表为当前活跃版本的匹配关系,安装依赖也可参考仓库根目录的 `requirements.txt`:18下表为当前活跃版本的匹配关系,安装依赖也可参考仓库根目录的 `requirements.txt`:
19 19 
20-| torchao_npu版本 | torchao版本 | PyTorch版本 | TorchNPU版本 | CANN版本 |20+| torchao-ascend版本 | torchao版本 | PyTorch版本 | TorchNPU版本 | CANN版本 |
21|:-------:|:---------:|:---------:|:---------:|:-------:|21|:-------:|:---------:|:---------:|:---------:|:-------:|
22| 0.18.0 | 0.18.x | 2.11.0 | 2.11.0 | 9.1.0 |22| 0.18.0 | 0.18.x | 2.11.0 | 2.11.0 | 9.1.0 |
23 23 
24-其中 TorchNPU 与 CANN、固件驱动的详细配套关系以 [TorchNPU 版本配套表](https://gitcode.com/Ascend/pytorch) 为准;torchao_npu 随 torchao 的 minor 版本演进发布,版本号与所适配的 torchao 版本保持一致(如 `0.18.0` 适配 torchao `0.18.x`)。24+其中 TorchNPU 与 CANN、固件驱动的详细配套关系以 [TorchNPU 版本配套表](https://gitcode.com/Ascend/pytorch) 为准;torchao-ascend 随 torchao 的 minor 版本演进发布,版本号与所适配的 torchao 版本保持一致(如 `0.18.0` 适配 torchao `0.18.x`)。
25 25 
26## 硬件支持26## 硬件支持
27 27 
28-torchao_npu 依托 TorchNPU 运行,支持的昇腾产品系列如下:28+torchao-ascend 依托 TorchNPU 运行,支持的昇腾产品系列如下:
29 29 
30| 产品系列 | 说明 |30| 产品系列 | 说明 |
31|:-------------:|:--------------------------------------------------:|31|:-------------:|:--------------------------------------------------:|
@@ -1,31 +1,31 @@
1# Version Compatibility1# Version Compatibility
2 2 
3-torchao_npu must be used together with specific versions of torchao, PyTorch, TorchNPU, CANN, and Python. The matching relationships between versions are maintained in this file. The recommended version combination is preferred to ensure optimal compatibility and performance. The version compatibility of firmware and drivers depends on the Ascend hardware and the CANN version in use. For details, see the [firmware and driver installation page](https://www.hiascend.com/hardware/firmware-drivers/commercial).3+torchao-ascend must be used together with specific versions of torchao, PyTorch, TorchNPU, CANN, and Python. The matching relationships between versions are maintained in this file. The recommended version combination is preferred to ensure optimal compatibility and performance. The version compatibility of firmware and drivers depends on the Ascend hardware and the CANN version in use. For details, see the [firmware and driver installation page](https://www.hiascend.com/hardware/firmware-drivers/commercial).
4 4 
5## Recommended Version Combination5## Recommended Version Combination
6 6 
7| Component | Recommended Version |7| Component | Recommended Version |
8|:-----------:|:-------------------------------------------:|8|:-----------:|:-------------------------------------------:|
9-| torchao_npu | 0.18.0 |9+| torchao-ascend | 0.18.0 |
10| torchao | >= 0.18.0, < 0.19.0 (0.18.x) |10| torchao | >= 0.18.0, < 0.19.0 (0.18.x) |
11| PyTorch | 2.11.0 |11| PyTorch | 2.11.0 |
12| TorchNPU | 2.11.0 (package version) |12| TorchNPU | 2.11.0 (package version) |
13| CANN | 9.1.0 |13| CANN | 9.1.0 |
14| Python | 3.10 / 3.11 / 3.12 |14| Python | 3.10 / 3.11 / 3.12 |
15 15 
16-## torchao_npu Version Compatibility Table16+## torchao-ascend Version Compatibility Table
17 17 
18The following is the matching relationship for the currently active version. For installation dependencies, you can also refer to `requirements.txt` in the repository root:18The following is the matching relationship for the currently active version. For installation dependencies, you can also refer to `requirements.txt` in the repository root:
19 19 
20-| torchao_npu Version | torchao Version | PyTorch Version | TorchNPU Version | CANN Version |20+| torchao-ascend Version | torchao Version | PyTorch Version | TorchNPU Version | CANN Version |
21|:---------:|:-------------:|:-------------:|:-------------:|:---------:|21|:---------:|:-------------:|:-------------:|:-------------:|:---------:|
22| 0.18.0 | 0.18.x | 2.11.0 | 2.11.0 | 9.1.0 |22| 0.18.0 | 0.18.x | 2.11.0 | 2.11.0 | 9.1.0 |
23 23 
24-For the detailed compatibility between TorchNPU, CANN, and firmware drivers, see the [TorchNPU version compatibility table](https://gitcode.com/Ascend/pytorch). torchao_npu releases follow the minor-version evolution of torchao, and its version number stays aligned with the adapted torchao version (for example, `0.18.0` adapts to torchao `0.18.x`).24+For the detailed compatibility between TorchNPU, CANN, and firmware drivers, see the [TorchNPU version compatibility table](https://gitcode.com/Ascend/pytorch). torchao-ascend releases follow the minor-version evolution of torchao, and its version number stays aligned with the adapted torchao version (for example, `0.18.0` adapts to torchao `0.18.x`).
25 25 
26## Hardware Support26## Hardware Support
27 27 
28-torchao_npu runs on top of TorchNPU and supports the following Ascend product series:28+torchao-ascend runs on top of TorchNPU and supports the following Ascend product series:
29 29 
30| Product Series | Description |30| Product Series | Description |
31|:------------------------:|:-------------------------------------------------------------------------------------------------:|31|:------------------------:|:-------------------------------------------------------------------------------------------------:|
@@ -1,10 +1,10 @@
1-# TorchAO for AscendNPU 贡献指南1+# Ascend for TorchAO 贡献指南
2 2 
3-感谢您考虑为 TorchAO for AscendNPU 做出贡献!我们欢迎任何形式的贡献,包括错误修复、功能增强、文档改进等。无论您是经验丰富的开发者还是第一次参与开源项目,您的帮助都是非常宝贵的。3+感谢您考虑为 Ascend for TorchAO 做出贡献!我们欢迎任何形式的贡献,包括错误修复、功能增强、文档改进等。无论您是经验丰富的开发者还是第一次参与开源项目,您的帮助都是非常宝贵的。
4 4 
5## 项目介绍5## 项目介绍
6 6 
7-`torchao_npu` 是面向量化生态 [torchao](https://github.com/pytorch/ao) 的昇腾 NPU 适配插件,使 torchao 的量化方案(FP8 / Blockwise FP8 / MX 系列)以及昇腾原生 HiFloat8(HIF8)数据类型能够在昇腾 NPU 上运行,支持量化训练与推理场景。7+`torchao-ascend` 是面向量化生态 [torchao](https://github.com/pytorch/ao) 的昇腾 NPU 适配插件,使 torchao 的量化方案(FP8 / Blockwise FP8 / MX 系列)以及昇腾原生 HiFloat8(HIF8)数据类型能够在昇腾 NPU 上运行,支持量化训练与推理场景。
8 8 
9### 项目架构9### 项目架构
10 10 
@@ -1,10 +1,10 @@
1-# TorchAO for AscendNPU Contributing Guide1+# Ascend for TorchAO Contributing Guide
2 2 
3-Thank you for considering contributing to TorchAO for AscendNPU! We welcome contributions of any kind, including bug fixes, feature enhancements, and documentation improvements. Whether you are an experienced developer or contributing to open source for the first time, your help is greatly appreciated.3+Thank you for considering contributing to Ascend for TorchAO! We welcome contributions of any kind, including bug fixes, feature enhancements, and documentation improvements. Whether you are an experienced developer or contributing to open source for the first time, your help is greatly appreciated.
4 4 
5## Project Introduction5## Project Introduction
6 6 
7-`torchao_npu` is an Ascend NPU adaptation plugin for the quantization ecosystem [torchao](https://github.com/pytorch/ao). It enables torchao's quantization schemes (FP8 / Blockwise FP8 / MX series) as well as the Ascend-native HiFloat8 (HIF8) data type to run on Ascend NPUs, supporting both quantized training and inference scenarios.7+`torchao-ascend` is an Ascend NPU adaptation plugin for the quantization ecosystem [torchao](https://github.com/pytorch/ao). It enables torchao's quantization schemes (FP8 / Blockwise FP8 / MX series) as well as the Ascend-native HiFloat8 (HIF8) data type to run on Ascend NPUs, supporting both quantized training and inference scenarios.
8 8 
9### Project Structure9### Project Structure
10 10 
MREADME.md+10-10
@@ -1,4 +1,4 @@
1-<h1 align="center">TorchAO for AscendNPU</h1>1+<h1 align="center">Ascend for TorchAO</h1>
2 2 
3<p align="center">3<p align="center">
4 <strong>面向 torchao 的昇腾 NPU 适配插件</strong>4 <strong>面向 torchao 的昇腾 NPU 适配插件</strong>
@@ -28,11 +28,11 @@
28 28 
29## 简介29## 简介
30 30 
31-**TorchAO for AscendNPU(`torchao_npu`)** 是面向量化生态 [torchao](https://github.com/pytorch/ao) 的昇腾 NPU 适配插件,使 torchao 的量化方案(FP8 / Blockwise FP8 / MX 系列)以及昇腾原生 HiFloat8(HIF8)数据类型能够在昇腾 NPU 上运行,支持量化训练与推理场景。31+**Ascend for TorchAO(`torchao-ascend`)** 是面向量化生态 [torchao](https://github.com/pytorch/ao) 的昇腾 NPU 适配插件,使 torchao 的量化方案(FP8 / Blockwise FP8 / MX 系列)以及昇腾原生 HiFloat8(HIF8)数据类型能够在昇腾 NPU 上运行,支持量化训练与推理场景。
32 32 
33## 最新动态33## 最新动态
34 34 
35-- 📢 [2026-09-01] torchao_npu 0.18.0 版本已完成适配开发,支持 torchao 0.18.x 与 PyTorch 2.11+,覆盖 FP8 / Blockwise FP8 / MXFP8 / HiFloat8 量化方案,提供量化训练与推理能力。35+- 📢 [2026-09-01] torchao-ascend 0.18.0 版本已完成适配开发,支持 torchao 0.18.x 与 PyTorch 2.11+,覆盖 FP8 / Blockwise FP8 / MXFP8 / HiFloat8 量化方案,提供量化训练与推理能力。
36 36 
37## 支持版本37## 支持版本
38 38 
@@ -41,7 +41,7 @@
41- Python `>= 3.10`41- Python `>= 3.10`
42- PyTorch `>= 2.11.0`42- PyTorch `>= 2.11.0`
43- torchao `>= 0.18.0, < 0.19.0`43- torchao `>= 0.18.0, < 0.19.0`
44-- CANN `9.1.0`44+- CANN `>=9.2.0`
45 45 
46其中 torch_npu 与 CANN 的配套关系以 [TorchNPU 版本配套表](https://gitcode.com/Ascend/pytorch) 为准。46其中 torch_npu 与 CANN 的配套关系以 [TorchNPU 版本配套表](https://gitcode.com/Ascend/pytorch) 为准。
47 47 
@@ -73,7 +73,7 @@ pip install torch==2.11.0 --index-url https://download.pytorch.org/whl/cpu
73pip install torch-npu==2.11.073pip install torch-npu==2.11.0
74```74```
75 75 
76-### 安装 torchao_npu76+### 安装 torchao-ascend
77 77 
78支持源码可编辑安装与编译 wheel 后安装两种方式:78支持源码可编辑安装与编译 wheel 后安装两种方式:
79 79 
@@ -152,11 +152,11 @@ optimizer.step()
152 152 
153## 模型支持概览153## 模型支持概览
154 154 
155-当前torchao_npu已经支持多种主流开源模型的低精度训练,详情可以参考[模型训练支持说明](./docs/zh/model/model_support.md)。155+当前torchao-ascend已经支持多种主流开源模型的低精度训练,详情可以参考[模型训练支持说明](./docs/zh/model/model_support.md)。
156 156 
157## 特性支持概览157## 特性支持概览
158 158 
159-此表展示了 torchao_npu 针对不同硬件设备、量化数据类型与训练模式的特性支持情况。159+此表展示了 torchao-ascend 针对不同硬件设备、量化数据类型与训练模式的特性支持情况。
160 160 
161| 硬件设备 | weight | activation | [QAT](./docs/zh/workflows/Quantization-Aware_Training.md) | [quantized training](./docs/zh/workflows/Quantized_Training.md) | [quantized inference](./docs/zh/workflows/Quantized_Inference.md) |161| 硬件设备 | weight | activation | [QAT](./docs/zh/workflows/Quantization-Aware_Training.md) | [quantized training](./docs/zh/workflows/Quantized_Training.md) | [quantized inference](./docs/zh/workflows/Quantized_Inference.md) |
162|---|---|---|---|--------------------------|---|162|---|---|---|---|--------------------------|---|
@@ -174,7 +174,7 @@ TorchAONPU复用PyTorch的device-backend自动加载通道,NPU环境下首次`
174 174 
175## 社区交流175## 社区交流
176 176 
177-TorchAO for AscendNPU 依托昇腾与 torchao 开源生态,围绕昇腾 NPU 平台提供量化适配能力。欢迎通过以下方式参与交流与贡献:177+Ascend for TorchAO 依托昇腾与 torchao 开源生态,围绕昇腾 NPU 平台提供量化适配能力。欢迎通过以下方式参与交流与贡献:
178 178 
179- 使用过程中遇到任何问题或建议,请提交 [Issue](https://gitcode.com/Ascend/torchao-ascend/issues),我们会尽快回复。179- 使用过程中遇到任何问题或建议,请提交 [Issue](https://gitcode.com/Ascend/torchao-ascend/issues),我们会尽快回复。
180- 欢迎提交 Pull Request 贡献代码,代码规范与提交流程请参考[贡献指南](./CONTRIBUTING.md)。180- 欢迎提交 Pull Request 贡献代码,代码规范与提交流程请参考[贡献指南](./CONTRIBUTING.md)。
@@ -184,7 +184,7 @@ TorchAO for AscendNPU 依托昇腾与 torchao 开源生态,围绕昇腾 NPU
184 184 
185## 安全声明185## 安全声明
186 186 
187-TorchAO for AscendNPU 的系统安全加固、运行用户建议和文件权限控制等内容,请参见 [安全声明](SECURITYNOTE.md)。187+Ascend for TorchAO 的系统安全加固、运行用户建议和文件权限控制等内容,请参见 [安全声明](SECURITYNOTE.md)。
188 188 
189## 免责声明189## 免责声明
190 190 
@@ -196,4 +196,4 @@ TorchAO for AscendNPU 的系统安全加固、运行用户建议和文件权限
196 196 
197## 致谢197## 致谢
198 198 
199-感谢来自社区的每一个 PR,欢迎开发者向 TorchAO for AscendNPU 贡献代码!199+感谢来自社区的每一个 PR,欢迎开发者向 Ascend for TorchAO 贡献代码!
@@ -1,4 +1,4 @@
1-<h1 align="center">TorchAO for AscendNPU</h1>1+<h1 align="center">Ascend for TorchAO</h1>
2 2 
3<p align="center">3<p align="center">
4 <strong>An Ascend NPU adaptation plugin for torchao</strong>4 <strong>An Ascend NPU adaptation plugin for torchao</strong>
@@ -28,11 +28,11 @@
28 28 
29## Introduction29## Introduction
30 30 
31-**TorchAO for AscendNPU (`torchao_npu`)** is an Ascend NPU adaptation plugin for the quantization ecosystem [torchao](https://github.com/pytorch/ao). It enables torchao's quantization schemes (FP8 / Blockwise FP8 / MX series) as well as the Ascend-native HiFloat8 (HIF8) data type to run on Ascend NPUs, supporting both quantized training and inference scenarios.31+**Ascend for TorchAO (`torchao-ascend`)** is an Ascend NPU adaptation plugin for the quantization ecosystem [torchao](https://github.com/pytorch/ao). It enables torchao's quantization schemes (FP8 / Blockwise FP8 / MX series) as well as the Ascend-native HiFloat8 (HIF8) data type to run on Ascend NPUs, supporting both quantized training and inference scenarios.
32 32 
33## What's New33## What's New
34 34 
35-- 📢 [2026-09-01] torchao_npu 0.18.0 has completed adaptation development. It supports torchao 0.18.x and PyTorch 2.11+, covers the FP8 / Blockwise FP8 / MXFP8 / HiFloat8 quantization schemes, and provides quantized training and inference capabilities.35+- 📢 [2026-09-01] torchao-ascend 0.18.0 has completed adaptation development. It supports torchao 0.18.x and PyTorch 2.11+, covers the FP8 / Blockwise FP8 / MXFP8 / HiFloat8 quantization schemes, and provides quantized training and inference capabilities.
36 36 
37## Supported Versions37## Supported Versions
38 38 
@@ -41,7 +41,7 @@ The following versions are currently supported:
41- Python `>= 3.10`41- Python `>= 3.10`
42- PyTorch `>= 2.11.0`42- PyTorch `>= 2.11.0`
43- torchao `>= 0.18.0, < 0.19.0`43- torchao `>= 0.18.0, < 0.19.0`
44-- CANN `9.1.0`44+- CANN `>=9.2.0`
45 45 
46For the compatibility between torch_npu and CANN, refer to the [TorchNPU version compatibility table](https://gitcode.com/Ascend/pytorch).46For the compatibility between torch_npu and CANN, refer to the [TorchNPU version compatibility table](https://gitcode.com/Ascend/pytorch).
47 47 
@@ -73,7 +73,7 @@ Run the following command to install TorchNPU 2.11.0:
73pip install torch-npu==2.11.073pip install torch-npu==2.11.0
74```74```
75 75 
76-### Install torchao_npu76+### Install torchao-ascend
77 77 
78Both editable installation from source and building a wheel for installation are supported:78Both editable installation from source and building a wheel for installation are supported:
79 79 
@@ -152,11 +152,11 @@ optimizer.step()
152 152 
153## Model Support Overview153## Model Support Overview
154 154 
155-torchao_npu currently supports low-precision training for a variety of mainstream open-source models. For details, see the [model training support guide](./docs/zh/model/model_support.md) (in Chinese).155+torchao-ascend currently supports low-precision training for a variety of mainstream open-source models. For details, see the [model training support guide](./docs/zh/model/model_support.md) (in Chinese).
156 156 
157## Feature Support Overview157## Feature Support Overview
158 158 
159-This table shows the feature support status of torchao_npu across different hardware devices, quantization data types, and training modes.159+This table shows the feature support status of torchao-ascend across different hardware devices, quantization data types, and training modes.
160 160 
161| Hardware | weight | activation | [QAT](./docs/zh/workflows/Quantization-Aware_Training.md) | [quantized training](./docs/zh/workflows/Quantized_Training.md) | [quantized inference](./docs/zh/workflows/Quantized_Inference.md) |161| Hardware | weight | activation | [QAT](./docs/zh/workflows/Quantization-Aware_Training.md) | [quantized training](./docs/zh/workflows/Quantized_Training.md) | [quantized inference](./docs/zh/workflows/Quantized_Inference.md) |
162|---|---|---|---|--------------------------|---|162|---|---|---|---|--------------------------|---|
@@ -176,7 +176,7 @@ TorchAONPU reuses PyTorch's device-backend auto-loading channel. It is activated
176 176 
177## Community177## Community
178 178 
179-TorchAO for AscendNPU is built on the Ascend and torchao open-source ecosystems, providing quantization adaptation capabilities for the Ascend NPU platform. You are welcome to join the discussion and contribute in the following ways:179+Ascend for TorchAO is built on the Ascend and torchao open-source ecosystems, providing quantization adaptation capabilities for the Ascend NPU platform. You are welcome to join the discussion and contribute in the following ways:
180 180 
181- If you run into any problems or have suggestions, please submit an [Issue](https://gitcode.com/Ascend/torchao-ascend/issues) and we will respond as soon as possible.181- If you run into any problems or have suggestions, please submit an [Issue](https://gitcode.com/Ascend/torchao-ascend/issues) and we will respond as soon as possible.
182- Pull Requests are welcome. For code standards and the submission process, see the [Contributing Guide](./CONTRIBUTING_EN.md).182- Pull Requests are welcome. For code standards and the submission process, see the [Contributing Guide](./CONTRIBUTING_EN.md).
@@ -186,7 +186,7 @@ Thank you for your support.
186 186 
187## Security Notes187## Security Notes
188 188 
189-For system security hardening, recommended runtime users, and file permission control of TorchAO for AscendNPU, see the [Security Notes](SECURITYNOTE_EN.md).189+For system security hardening, recommended runtime users, and file permission control of Ascend for TorchAO, see the [Security Notes](SECURITYNOTE_EN.md).
190 190 
191## Disclaimer191## Disclaimer
192 192 
@@ -198,4 +198,4 @@ The open-source license of this project is subject to the License statement main
198 198 
199## Acknowledgements199## Acknowledgements
200 200 
201-Thanks for every PR from the community — contributions to TorchAO for AscendNPU are welcome!201+Thanks for every PR from the community — contributions to Ascend for TorchAO are welcome!
@@ -1,13 +1,13 @@
1-# TorchAO for AscendNPU 安全声明1+# Ascend for TorchAO 安全声明
2 2 
3## 运行用户建议3## 运行用户建议
4 4 
5-出于安全性及权限最小化角度考虑,不建议使用 root 等管理员类型账户使用 `torchao_npu`。5+出于安全性及权限最小化角度考虑,不建议使用 root 等管理员类型账户使用 `torchao-ascend`。
6 6 
7## 文件权限控制7## 文件权限控制
8 8 
91. 建议用户对训练所需文件、训练过程中保存的文件、用户个人的隐私数据、商业资产等敏感文件做好权限控制等安全措施,例如多用户共享数据集场景下的数据集文件写权限控制等。91. 建议用户对训练所需文件、训练过程中保存的文件、用户个人的隐私数据、商业资产等敏感文件做好权限控制等安全措施,例如多用户共享数据集场景下的数据集文件写权限控制等。
10-2. `torchao_npu` 加载/保存模型权重依赖 PyTorch 的 `torch.load` / `torch.save` 接口,生成文件权限依赖系统设定。建议当前执行脚本的用户根据自身需要,对生成文件做好权限控制。10+2. `torchao-ascend` 加载/保存模型权重依赖 PyTorch 的 `torch.load` / `torch.save` 接口,生成文件权限依赖系统设定。建议当前执行脚本的用户根据自身需要,对生成文件做好权限控制。
113. 可使用 `umask` 控制默认权限,降低提权等安全风险。建议用户将主机(包括宿主机)和容器中的 `umask` 设置为 `0027` 及其以上,提高安全性。113. 可使用 `umask` 控制默认权限,降低提权等安全风险。建议用户将主机(包括宿主机)和容器中的 `umask` 设置为 `0027` 及其以上,提高安全性。
12 12 
13### 文件权限参考13### 文件权限参考
@@ -33,17 +33,17 @@ PyTorch 使用过程中需要加载和保存数据,部分接口使用风险模
33 33 
34## 构建安全声明34## 构建安全声明
35 35 
36-`torchao_npu` 支持源码编译安装,在编译(`bash ci/build.sh`)时会通过 pip 下载依赖第三方库并执行构建脚本,在编译过程中会产生临时程序文件和编译目录。用户可根据需要自行对源代码目录内的文件进行权限管控,降低安全风险。36+`torchao-ascend` 支持源码编译安装,在编译(`bash ci/build.sh`)时会通过 pip 下载依赖第三方库并执行构建脚本,在编译过程中会产生临时程序文件和编译目录。用户可根据需要自行对源代码目录内的文件进行权限管控,降低安全风险。
37 37 
38## 运行安全声明38## 运行安全声明
39 39 
401. 建议用户结合运行环境资源状况编写对应训练脚本。若训练脚本与资源状况不匹配,如数据集加载内存大小超出内存容量限制、训练脚本在本地生成数据超过磁盘空间大小等情况,可能引发错误并导致进程意外退出。401. 建议用户结合运行环境资源状况编写对应训练脚本。若训练脚本与资源状况不匹配,如数据集加载内存大小超出内存容量限制、训练脚本在本地生成数据超过磁盘空间大小等情况,可能引发错误并导致进程意外退出。
41-2. PyTorch 和 `torchao_npu` 在运行异常时会退出进程并打印报错信息,属于正常现象。建议用户根据报错提示定位具体错误原因,包括查看 CANN 日志、解析生成的 Core Dump 文件等方式。41+2. PyTorch 和 `torchao-ascend` 在运行异常时会退出进程并打印报错信息,属于正常现象。建议用户根据报错提示定位具体错误原因,包括查看 CANN 日志、解析生成的 Core Dump 文件等方式。
423. 分布式特性(如 FP8 + FSDP)仅适用于内部通信。出于性能考虑,这些分布式特性不包含任何授权协议,并且会发送未加密的消息。关于 PyTorch 分布式特性的详细说明及安全注意事项,可参考 [using-distributed-features](https://github.com/pytorch/pytorch/security#using-distributed-features)。423. 分布式特性(如 FP8 + FSDP)仅适用于内部通信。出于性能考虑,这些分布式特性不包含任何授权协议,并且会发送未加密的消息。关于 PyTorch 分布式特性的详细说明及安全注意事项,可参考 [using-distributed-features](https://github.com/pytorch/pytorch/security#using-distributed-features)。
43 43 
44## 公网地址声明44## 公网地址声明
45 45 
46-在 `torchao_npu` 的配置文件和文档中存在以下公网地址:46+在 `torchao-ascend` 的配置文件和文档中存在以下公网地址:
47 47 
48| 类型 | 开源代码地址 | 文件名 | 公网URL地址 | 用途说明 |48| 类型 | 开源代码地址 | 文件名 | 公网URL地址 | 用途说明 |
49|:---|:---|:---|:---|:---|49|:---|:---|:---|:---|:---|
@@ -1,13 +1,13 @@
1-# TorchAO for AscendNPU Security Notes1+# Ascend for TorchAO Security Notes
2 2 
3## Recommended Runtime User3## Recommended Runtime User
4 4 
5-For security and least-privilege considerations, it is not recommended to use `torchao_npu` with administrator accounts such as root.5+For security and least-privilege considerations, it is not recommended to use `torchao-ascend` with administrator accounts such as root.
6 6 
7## File Permission Control7## File Permission Control
8 8 
91. Users are advised to apply permission controls and other security measures to sensitive files, such as files required for training, files saved during training, privacy-sensitive data, and business assets — for example, controlling write permissions on dataset files shared in multi-user scenarios.91. Users are advised to apply permission controls and other security measures to sensitive files, such as files required for training, files saved during training, privacy-sensitive data, and business assets — for example, controlling write permissions on dataset files shared in multi-user scenarios.
10-2. `torchao_npu` relies on PyTorch's `torch.load` / `torch.save` interfaces to load and save model weights. The permissions of generated files depend on system settings. Users running the scripts are advised to control the permissions of generated files according to their own needs.10+2. `torchao-ascend` relies on PyTorch's `torch.load` / `torch.save` interfaces to load and save model weights. The permissions of generated files depend on system settings. Users running the scripts are advised to control the permissions of generated files according to their own needs.
113. `umask` can be used to control default permissions and reduce security risks such as privilege escalation. Users are advised to set `umask` to `0027` or higher on the host (including the host machine) and in containers to improve security.113. `umask` can be used to control default permissions and reduce security risks such as privilege escalation. Users are advised to set `umask` to `0027` or higher on the host (including the host machine) and in containers to improve security.
12 12 
13### File Permission Reference13### File Permission Reference
@@ -33,17 +33,17 @@ PyTorch needs to load and save data during use. Some interfaces use the risky mo
33 33 
34## Build Security Statement34## Build Security Statement
35 35 
36-`torchao_npu` supports source-code installation. During the build (`bash ci/build.sh`), third-party dependencies are downloaded via pip and build scripts are executed, which generates temporary program files and build directories in the process. Users may apply permission controls to the files in the source code directory as needed to reduce security risks.36+`torchao-ascend` supports source-code installation. During the build (`bash ci/build.sh`), third-party dependencies are downloaded via pip and build scripts are executed, which generates temporary program files and build directories in the process. Users may apply permission controls to the files in the source code directory as needed to reduce security risks.
37 37 
38## Runtime Security Statement38## Runtime Security Statement
39 39 
401. Users are advised to write training scripts that match the resources of the runtime environment. If a training script does not match the available resources — for example, the memory required to load the dataset exceeds the memory capacity, or the data generated locally by the training script exceeds the disk space — errors may occur and the process may exit unexpectedly.401. Users are advised to write training scripts that match the resources of the runtime environment. If a training script does not match the available resources — for example, the memory required to load the dataset exceeds the memory capacity, or the data generated locally by the training script exceeds the disk space — errors may occur and the process may exit unexpectedly.
41-2. PyTorch and `torchao_npu` exit the process and print error messages when runtime exceptions occur. This is normal behavior. Users are advised to locate the specific cause based on the error messages, including checking CANN logs and analyzing the generated core dump files.41+2. PyTorch and `torchao-ascend` exit the process and print error messages when runtime exceptions occur. This is normal behavior. Users are advised to locate the specific cause based on the error messages, including checking CANN logs and analyzing the generated core dump files.
423. Distributed features (such as FP8 + FSDP) are intended for internal communication only. For performance reasons, these distributed features do not include any authorization protocol and send unencrypted messages. For detailed descriptions and security considerations of PyTorch's distributed features, see [using-distributed-features](https://github.com/pytorch/pytorch/security#using-distributed-features).423. Distributed features (such as FP8 + FSDP) are intended for internal communication only. For performance reasons, these distributed features do not include any authorization protocol and send unencrypted messages. For detailed descriptions and security considerations of PyTorch's distributed features, see [using-distributed-features](https://github.com/pytorch/pytorch/security#using-distributed-features).
43 43 
44## Public Network Address Statement44## Public Network Address Statement
45 45 
46-The following public network addresses exist in the configuration files and documentation of `torchao_npu`:46+The following public network addresses exist in the configuration files and documentation of `torchao-ascend`:
47 47 
48| Type | Open-Source Code Address | File Name | Public URL | Purpose |48| Type | Open-Source Code Address | File Name | Public URL | Purpose |
49|:---|:---|:---|:---|:---|49|:---|:---|:---|:---|:---|
@@ -2,15 +2,15 @@
2 2 
3## 版本支持矩阵3## 版本支持矩阵
4 4 
5-torchao_npu 各软件包版本的支持状态如下:5+torchao-ascend 各软件包版本的支持状态如下:
6 6 
7-| torchao_npu软件包版本 | 当前状态 | 发布时间 | 后续状态 | EOL日期 |7+| torchao-ascend软件包版本 | 当前状态 | 发布时间 | 后续状态 | EOL日期 |
8|:---------------:|:----:|:----------:|:---------------------|:----------:|8|:---------------:|:----:|:----------:|:---------------------|:----------:|
9| 0.18.0 | 开发 | 2026/11/30 | 预计2027/03/01起进入维护状态 | - |9| 0.18.0 | 开发 | 2026/11/30 | 预计2027/03/01起进入维护状态 | - |
10 10 
11## 维护策略11## 维护策略
12 12 
13-torchao_npu 版本的维护阶段如下:13+torchao-ascend 版本的维护阶段如下:
14 14 
15| 状态 | 时间 | 说明 |15| 状态 | 时间 | 说明 |
16|:------------|:--------------|:---------------------------------|16|:------------|:--------------|:---------------------------------|
@@ -2,15 +2,15 @@
2 2 
3## Version Support Matrix3## Version Support Matrix
4 4 
5-The support status of each torchao_npu package version is as follows:5+The support status of each torchao-ascend package version is as follows:
6 6 
7-| torchao_npu Package Version | Current Status | Release Date | Next Status | EOL Date |7+| torchao-ascend Package Version | Current Status | Release Date | Next Status | EOL Date |
8|:---------------------------:|:--------------:|:--------------:|:--------------------------------|:---------:|8|:---------------------------:|:--------------:|:--------------:|:--------------------------------|:---------:|
9| 0.18.0 | Development | 2026/09/01 | Expected to enter maintenance on 2027/03/01 | - |9| 0.18.0 | Development | 2026/09/01 | Expected to enter maintenance on 2027/03/01 | - |
10 10 
11## Maintenance Policy11## Maintenance Policy
12 12 
13-The maintenance phases of torchao_npu versions are as follows:13+The maintenance phases of torchao-ascend versions are as follows:
14 14 
15| Status | Timeframe | Description |15| Status | Timeframe | Description |
16|:--------|:-------------------------|:-----------------------------------------------------------------|16|:--------|:-------------------------|:-----------------------------------------------------------------|
@@ -1,6 +1,6 @@
1# HiFloat8 使用说明1# HiFloat8 使用说明
2 2 
3-HiFloat8(HIF8)是昇腾 NPU 原生 8 位浮点数据类型。`torchao_npu` 支持将3+HiFloat8(HIF8)是昇腾 NPU 原生 8 位浮点数据类型。`torchao-ascend` 支持将
4`torch.nn.Linear` 转换为 HiFloat8 训练或推理路径,以及将 MoE 专家的单次4`torch.nn.Linear` 转换为 HiFloat8 训练或推理路径,以及将 MoE 专家的单次
5grouped GEMM 转换为 HiFloat8 训练路径。5grouped GEMM 转换为 HiFloat8 训练路径。
6 6 
@@ -11,7 +11,7 @@ W4A16 使用**单步假量化训练**:调用 `quantize_` 完成模块类交换
11 11 
12## 架构定位(重要)12## 架构定位(重要)
13 13 
14-torchao_npu 不创建新的模型容器,而是通过 torchao `quantize_` 对框架已有模块14+torchao-ascend 不创建新的模型容器,而是通过 torchao `quantize_` 对框架已有模块
15执行**类交换**:15执行**类交换**:
16 16 
17- `torch.nn.Linear` → `W4A16Linear`;17- `torch.nn.Linear` → `W4A16Linear`;
@@ -25,7 +25,7 @@ W4A16 的覆盖范围由 filter 决定,可分别用于:
25- attention、dense MLP 等普通 `nn.Linear`;25- attention、dense MLP 等普通 `nn.Linear`;
26- 具有融合 `gate_up_proj` / `down_proj` 权重的 MoE 专家 grouped GEMM。26- 具有融合 `gate_up_proj` / `down_proj` 权重的 MoE 专家 grouped GEMM。
27 27 
28-权重假量化重建函数本身无状态,不在 torchao_npu 内保存权重缓存。生产训练可28+权重假量化重建函数本身无状态,不在 torchao-ascend 内保存权重缓存。生产训练可
29通过 `config.weight_fakequant_fn` 注入框架已有的缓存函数;缓存池及其在29通过 `config.weight_fakequant_fn` 注入框架已有的缓存函数;缓存池及其在
30optimizer step 边界的清理由注入方负责。30optimizer step 边界的清理由注入方负责。
31 31 
@@ -8,7 +8,7 @@ master 权重并在线量化,使权重自然适应量化误差。该方案迁
8 8 
9## 架构定位(重要)9## 架构定位(重要)
10 10 
11-**torchao_npu 不提供自己的 MoE 专家容器**(早期的 `W4A8Experts` demo11+**torchao-ascend 不提供自己的 MoE 专家容器**(早期的 `W4A8Experts` demo
12容器已删除)。量化目标是**模型框架自带的融合布局 MoE 专家模块**:12容器已删除)。量化目标是**模型框架自带的融合布局 MoE 专家模块**:
13 13 
14- 3-D `gate_up_proj` `[E, K, 2N]`(w1 | w3 融合)与 `down_proj`14- 3-D `gate_up_proj` `[E, K, 2N]`(w1 | w3 融合)与 `down_proj`
@@ -73,7 +73,7 @@ from torchao.w4a8 import (
73 73 
74### QAT 全流程(prepare → 训练 → convert)74### QAT 全流程(prepare → 训练 → convert)
75 75 
76-模型按框架常规方式搭建(MoE 专家层为框架的融合布局模块),torchao_npu76+模型按框架常规方式搭建(MoE 专家层为框架的融合布局模块),torchao-ascend
77只按 fqn 匹配并就地补丁:77只按 fqn 匹配并就地补丁:
78 78 
79```python79```python
@@ -7,7 +7,7 @@ BF16 master 并自然适应量化误差。
7 7 
8## 架构定位(重要)8## 架构定位(重要)
9 9 
10-**torchao_npu 不提供自己的 MoE 专家容器**。量化目标是模型自带的模块,10+**torchao-ascend 不提供自己的 MoE 专家容器**。量化目标是模型自带的模块,
11按目标类型分双 Config,经 torchao `_QUANTIZE_CONFIG_HANDLER` 精确类型分发:11按目标类型分双 Config,经 torchao `_QUANTIZE_CONFIG_HANDLER` 精确类型分发:
12 12 
13| 路径 | 目标模块 | 载体 | Config | 生命周期 |13| 路径 | 目标模块 | 载体 | Config | 生命周期 |
@@ -10,7 +10,7 @@
10 10 
11## 版本说明11## 版本说明
12 12 
13-本清单对应 torchao 0.18.0 版本,适配 PyTorch ≥ 2.11.0 且 TorchNPU ≥ 2.11.0,并确保 PyTorch、TorchNPU 与 CANN 版本配套。torchao_npu 通过 monkey-patcher 方案在 NPU 后端适配 torchao 原生接口,底层 kernel 调用经 `torchao_npu.ops.npu` 转发至 `torch_npu` / `cann_ops_nn` 低精度内核。13+本清单对应 torchao 0.18.0 版本,适配 PyTorch ≥ 2.11.0 且 TorchNPU ≥ 2.11.0,并确保 PyTorch、TorchNPU 与 CANN 版本配套。torchao-ascend 通过 monkey-patcher 方案在 NPU 后端适配 torchao 原生接口,底层 kernel 调用经 `torchao_npu.ops.npu` 转发至 `torch_npu` / `cann_ops_nn` 低精度内核。
14 14 
15版本变更依据:[torchao 0.18.0 发布说明](https://github.com/pytorch/ao/releases)。15版本变更依据:[torchao 0.18.0 发布说明](https://github.com/pytorch/ao/releases)。
16 16 
@@ -1,6 +1,6 @@
1## 模型训练支持概况1## 模型训练支持概况
2 2 
3-此页展示了torchao_npu针对当前主流开源模型的训练支持情况3+此页展示了torchao-ascend针对当前主流开源模型的训练支持情况
4 4 
5| 特性 | 训练框架 | 支持状态 | 量化模式 |5| 特性 | 训练框架 | 支持状态 | 量化模式 |
6|---|---|---|---|6|---|---|---|---|
@@ -1,6 +1,6 @@
1# 量化感知训练(QAT)工作流1# 量化感知训练(QAT)工作流
2 2 
3-本文梳理 torchao_npu 当前支持的 **QAT(Quantization-Aware Training)** 特性。QAT 与量化训练(真低精反向、追求训练效率)不同:其目标是**让模型在训练中适应量化网格,使最终 convert 出的量化推理模型精度损失最小**——master 权重保持高精度,forward 在线模拟部署量化形态,训练结束后固化。量化训练的内容见 [量化训练工作流](./Quantized_Training.md)。3+本文梳理 torchao-ascend 当前支持的 **QAT(Quantization-Aware Training)** 特性。QAT 与量化训练(真低精反向、追求训练效率)不同:其目标是**让模型在训练中适应量化网格,使最终 convert 出的量化推理模型精度损失最小**——master 权重保持高精度,forward 在线模拟部署量化形态,训练结束后固化。量化训练的内容见 [量化训练工作流](./Quantized_Training.md)。
4 4 
5## 总览5## 总览
6 6 
@@ -1,6 +1,6 @@
1# 量化训练工作流1# 量化训练工作流
2 2 
3-本文梳理 torchao_npu 当前支持的**量化训练**(quantized training)特性,即训练场景下的低精度方案。核心维度为:**每种低精度类型支持对哪些层/算子做量化**(模块层如 `torch.nn.Linear`、MoE 专家;算子层如 `torch.matmul` / grouped matmul),以及对应的实现机制与入口 API。3+本文梳理 torchao-ascend 当前支持的**量化训练**(quantized training)特性,即训练场景下的低精度方案。核心维度为:**每种低精度类型支持对哪些层/算子做量化**(模块层如 `torch.nn.Linear`、MoE 专家;算子层如 `torch.matmul` / grouped matmul),以及对应的实现机制与入口 API。
4 4 
5> 范围说明:本文**不涉及 QAT(量化感知训练)相关适配**(如 `features/qat/w4a8` 的 QAT 注入),相关内容见 [W4A8 QAT 使用说明](../W4A8_QAT_usage.md)。5> 范围说明:本文**不涉及 QAT(量化感知训练)相关适配**(如 `features/qat/w4a8` 的 QAT 注入),相关内容见 [W4A8 QAT 使用说明](../W4A8_QAT_usage.md)。
6 6