Skip to content

Commit 21ebe51

Browse files
committed
move Hy3-specific merge scripts and MTP utilities to tools/hy3
1 parent 0dd025e commit 21ebe51

6 files changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/ptq/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ bash tools/vllm_patch/install.sh --help # 查看完整用法
120120
| 脚本 | 用途 | 入口 |
121121
| --- | --- | --- |
122122
| [`run_vllm_quant_for_Hy3.sh`](./run_vllm_quant_for_Hy3.sh) | ★ FP8 一键流水线:校准 + 量化 | `tools/run_vllm_calibrate.py` + `tools/fp8_quant_with_vllm_activation.py` |
123-
| [`run_nvfp4_quant_for_Hy3.sh`](./run_nvfp4_quant_for_Hy3.sh) | ★ NVFP4 一键流水线:校准 + weight-only 量化 + 合并 | `tools/run_vllm_calibrate.py` + `tools/run.py` + `tools/merge_hy3_nvfp4_c8.py` |
123+
| [`run_nvfp4_quant_for_Hy3.sh`](./run_nvfp4_quant_for_Hy3.sh) | ★ NVFP4 一键流水线:校准 + weight-only 量化 + 合并 | `tools/run_vllm_calibrate.py` + `tools/run.py` + `tools/hy3/merge_hy3_nvfp4_c8.py` |
124124
| [`run_vllm_calibrate_for_Hy3.sh`](./run_vllm_calibrate_for_Hy3.sh) | 仅 W8A8C8 联合校准 | `tools/run_vllm_calibrate.py` |
125125
| [`run_kvcache_calibrate_for_Hy3.sh`](./run_kvcache_calibrate_for_Hy3.sh) | 仅 KV-cache 校准(轻量) | `tools/kvcache/run_kvcache_calibrate.py` |
126126
| [`run_smooth_for_HY3.sh`](./run_smooth_for_HY3.sh) | SmoothQuant 一键流水线:统计收集 + 权重变换 | `tools/smooth/run_vllm_smooth.py` + `tools/smooth/convert_smooth_weights.py` |
@@ -220,7 +220,7 @@ bash run_vllm_quant_for_Hy3.sh --help # 打印用法
220220
- 默认配置为 [`configs/Hy3/ptq/nvfp4_weight_only/hunyuan_a20b_nvfp4_weight_only.yaml`](../../configs/Hy3/ptq/nvfp4_weight_only/hunyuan_a20b_nvfp4_weight_only.yaml)
221221
- 量化模型目录需与 `${NVFP4_W_PATH}` 保持一致,供阶段 3 读取。
222222

223-
#### 阶段 3:调用 `tools/merge_hy3_nvfp4_c8.py`
223+
#### 阶段 3:调用 `tools/hy3/merge_hy3_nvfp4_c8.py`
224224

225225
- 读取 `${STATISTICS_PATH}` 下的 `activation_stats.json` / `moe_expert_stats.json``${NVFP4_W_PATH}` 下的 NVFP4 权重及 `${BF16_MODEL_PATH}` 下的原始模型文件。
226226
- 把 NVFP4 expert 权重、bf16 非 expert 权重、expert input scale 和 KV-cache scale 合并到 `${OUTPUT_PATH}`

scripts/ptq/run_nvfp4_quant_for_Hy3.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ if [[ "${do_merge}" -eq 1 ]]; then
117117
echo "[pipeline] BF16_MODEL_PATH=${BF16_MODEL_PATH}"
118118
echo "[pipeline] OUTPUT_PATH=${OUTPUT_PATH}"
119119

120-
python3 tools/merge_hy3_nvfp4_c8.py \
120+
python3 tools/hy3/merge_hy3_nvfp4_c8.py \
121121
--statistics_path "${STATISTICS_PATH}" \
122122
--nvfp4_w_path "${NVFP4_W_PATH}" \
123123
--bf16_model_path "${BF16_MODEL_PATH}" \

tools/run_vllm_calibrate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def parse_args():
349349
)
350350

351351
if args.auto_detect_mtp:
352-
from hy3_mtp_utils import detect_hy3_mtp
352+
from hy3.hy3_mtp_utils import detect_hy3_mtp
353353

354354
mtp_layout = detect_hy3_mtp(args.model_path)
355355
if mtp_layout.has_mtp:

0 commit comments

Comments
 (0)