Merged
fix: replace leftover torchao_npu references in benchmarks with torchao_ascend #191
fix: replace leftover torchao_npu references in benchmarks with torchao_ascend #191
Merged
pengpeng7872Add on 2 days ago
Total: 6 files changed+7-7
@@ -19,8 +19,8 @@ from pathlib import Path
19import torch19import torch
20 20 
21from torchao.prototype.moe_training.utils import generate_jagged_offs21from torchao.prototype.moe_training.utils import generate_jagged_offs
22-from torchao_npu.features.training.hifloat8.config import HiFloat8GMMConfig22+from torchao_ascend.features.training.hifloat8.config import HiFloat8GMMConfig
23-from torchao_npu.features.training.hifloat8.hifloat8_gmm import hifloat8_gmm23+from torchao_ascend.features.training.hifloat8.hifloat8_gmm import hifloat8_gmm
24 24 
25from timer import bench_fwd_bwd_us, bench_fwd_us25from timer import bench_fwd_bwd_us, bench_fwd_us
26from utils import (26from utils import (
@@ -20,7 +20,7 @@ import torch.nn as nn
20import torch.nn.functional as F20import torch.nn.functional as F
21 21 
22from torchao.quantization import quantize_22from torchao.quantization import quantize_
23-from torchao_npu.features.training.hifloat8.hifloat8_inference import (23+from torchao_ascend.features.training.hifloat8.hifloat8_inference import (
24 HiFloat8DynamicActivationHiFloat8WeightConfig,24 HiFloat8DynamicActivationHiFloat8WeightConfig,
25)25)
26 26 
@@ -22,7 +22,7 @@ import torch.nn as nn
22import torch.nn.functional as F22import torch.nn.functional as F
23 23 
24from torchao.quantization import quantize_24from torchao.quantization import quantize_
25-from torchao_npu.features.training.hifloat8.config import HiFloat8LinearConfig25+from torchao_ascend.features.training.hifloat8.config import HiFloat8LinearConfig
26 26 
27from timer import bench_fwd_bwd_us, bench_fwd_us27from timer import bench_fwd_bwd_us, bench_fwd_us
28from utils import (28from utils import (
@@ -19,7 +19,7 @@ from pathlib import Path
19from typing import Callable, Optional19from typing import Callable, Optional
20 20 
21import torch21import torch
22-import torchao_npu # noqa: F401 activates MXFP8/HiFloat8 patches + injects KernelPreference.NPU22+import torchao_ascend # noqa: F401 activates MXFP8/HiFloat8 patches + injects KernelPreference.NPU
23 23 
24 24 
25# ---------------------------------------------------------------------------25# ---------------------------------------------------------------------------
@@ -24,7 +24,7 @@ torchao PTQ recipe 的 **lm_eval 精度**:进程内量化或从落盘 ckpt 直
24- **会话环境变量**(脚本不内置,按需在运行前 export):24- **会话环境变量**(脚本不内置,按需在运行前 export):
25 - `PYTHONPATH=<仓根>` —— torchao_ascend 未 pip 安装(源码仓直用)时必须;25 - `PYTHONPATH=<仓根>` —— torchao_ascend 未 pip 安装(源码仓直用)时必须;
26 - `HF_ENDPOINT=https://hf-mirror.com` —— HF Hub 不通时用(lm_eval 任务数据**首次**运行在线下载);之后缓存于 `~/.cache/huggingface`,加 `HF_HUB_OFFLINE=1` 可完全离线运行;26 - `HF_ENDPOINT=https://hf-mirror.com` —— HF Hub 不通时用(lm_eval 任务数据**首次**运行在线下载);之后缓存于 `~/.cache/huggingface`,加 `HF_HUB_OFFLINE=1` 可完全离线运行;
27- - `TORCH_DEVICE_BACKEND_AUTOLOAD=0` —— torch import 报 `Failed to load the backend extension: torchao_npu` 时(旧 editable 安装残留触发);27+ - `TORCH_DEVICE_BACKEND_AUTOLOAD=0` —— torch import 报 `Failed to load the backend extension: torchao_ascend` 时(旧 editable 安装残留触发);
28 - CANN:非交互 shell(如 ssh 直跑)需先 `source <cann路径>/set_env.sh`(`.bashrc` 不会加载)。28 - CANN:非交互 shell(如 ssh 直跑)需先 `source <cann路径>/set_env.sh`(`.bashrc` 不会加载)。
29 29 
30## 用法(仓根目录)30## 用法(仓根目录)
@@ -31,7 +31,7 @@
31#31#
32# Session env (NOT set here; see README 环境要求): HF_ENDPOINT for an HF mirror32# Session env (NOT set here; see README 环境要求): HF_ENDPOINT for an HF mirror
33# when the Hub is unreachable, and TORCH_DEVICE_BACKEND_AUTOLOAD=0 when an old33# when the Hub is unreachable, and TORCH_DEVICE_BACKEND_AUTOLOAD=0 when an old
34-# torchao_npu editable install triggers a backend-autoload error.34+# torchao_ascend editable install triggers a backend-autoload error.
35 35 
36set -e36set -e
37cd "$(dirname "$0")/../.." # repo root, so relative output dirs land right37cd "$(dirname "$0")/../.." # repo root, so relative output dirs land right