Skip to content

[feat]: Support vllm calibrate for hy_v3.#309

Merged
yghstill merged 7 commits into
Tencent:mainfrom
C-KRSW:hyv3_vllm_calib
May 21, 2026
Merged

[feat]: Support vllm calibrate for hy_v3.#309
yghstill merged 7 commits into
Tencent:mainfrom
C-KRSW:hyv3_vllm_calib

Conversation

@C-KRSW

@C-KRSW C-KRSW commented May 19, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@C-KRSW C-KRSW force-pushed the hyv3_vllm_calib branch 2 times, most recently from 181bf35 to 258f49a Compare May 19, 2026 13:43
@C-KRSW C-KRSW force-pushed the hyv3_vllm_calib branch from 258f49a to 7fea5aa Compare May 19, 2026 14:11
print("---------KV-cache hooks skipped (kv_granularity=none)---------")

elif kv_granularity == "per-tensor":
kvcache_layers = _find_layers(model, layers=[Attention])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码风格保持一致,per-head调用setup_kvcache_perhead_hooks,per-tensor也这样调用hook函数

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

)


class KVScaleSearcher:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kv-cache scale search的逻辑再拆分到新的py文件,当前文件代码行数太多

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Comment thread tools/fp8_quant_with_vllm_activation.py Outdated

int(parts[expert_idx + 1]) # 尝试转换为整数

# # 检查 expert 之前是否存在 gate/up/down

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

清理下注释内容,并删除中文comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Comment thread tools/replace_kv_scales.py Outdated
from safetensors import safe_open
from safetensors.torch import save_file

json_path = "/apdcephfs_gy7/share_303171455/linchuanxie/code_0403_kvcache_tensor/kv_cache_tuned_scales.json" # noqa: E501

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除绝对路径

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Comment thread tools/run_p_scale_calibrate.py Outdated
@@ -0,0 +1,452 @@
# Copyright 2025 Tencent Inc. All Rights Reserved.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

关于kvcache量化相关的在tools下新建一个文件夹

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

暂时将p scale的文件删掉,并将其余关于kvcache量化相关的文件移动到新目录下.

Comment thread scripts/ptq/run_kvcache_calibrate_for_HY3.sh Outdated
@yghstill yghstill merged commit dcca5d3 into Tencent:main May 21, 2026
5 checks passed
cctvqxj pushed a commit to cctvqxj/AngelSlim that referenced this pull request Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants