已合并
[atb-models] [bug-fix] Fix Quant+LoRA+FlashComm combination bugs #1080
[atb-models] [bug-fix] Fix Quant+LoRA+FlashComm combination bugs #1080
已合并
gengli8创建于 6月27日
gengli8
gengli8成员
6月27日

1、修复quant+lora+flashcomm精度劣化,请求回复出现重复乱码等。
2、根因:同时启用lora+flashcomm+w8a8_quant,allgather在父图只能读到 in_input,但量化会让父图读子图还没初始化的 intermediate_inner_tp_input。
3、修改atb-models的allgatehr逻辑,在开启lora时候读取in_input。

修复前:gsm8k精度80%,输出内容有重复;修复后gsm8k精度84.38%,和不使用lora的场景持平,输出内容无重复。

likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 gengli8 的贡献)
ascend-robotascend-robot成员
6月27日 添加了label:ascend-cla/yes
gengli8
gengli8成员
6月27日 评论:

compile

likedislike
ascend-robotascend-robot成员
6月27日 添加了label:needs-issue
ascend-robot
ascend-robot成员
6月27日 评论:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here
You can get sig-info at here


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-Ascend/MindIE-LLM 陈歆怡, earthmanylf (2/2) 陈歆怡 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

forcekeng, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
ascend-robot
ascend-robot成员
6月27日 评论:

Linking Issue Notice

@forcekeng , the pull request must be linked to at least one issue.
If an issue has already been linked, but the needs-issue label remains, you can remove the label by commenting /check-issue .

likedislike
ascend-robotascend-robot成员
6月27日 添加了label:ci-pipeline-running
ascend-robotascend-robot成员
6月27日 删除了label:ci-pipeline-running
ascend-robot
ascend-robot成员
6月27日 评论:
流水线 PR-pipeline_MindIE-LLM_gitcode#5691 [ commitID:69506b67 ] 已终止运行
>>>代码风格自动修复执行失败,具体请查看日志,不影响流水线执行及PR合入
阶段 任务名 状态 详情
编译构建 Build_ops_x86_A3 🕚 >>>
Build_ops_arm_A3 🕚 >>>
Build_ops_x86_A2 🕚 >>>
Build_ops_arm_A2 🕚 >>>
Build_linux_x86_abi1_atb 🕚 >>>
Build_linux_x86_abi1_llm 🕚 >>>
Build_linux_arm_abi1_atb 🕚 >>>
Build_linux_arm_abi1_llm 🕚 >>>
Build_linux_arm_abi0_atb 🕚 >>>
Build_linux_arm_abi0_llm 🕚 >>>
恶意代码检查 Antipoison 🕚 >>>
编码安全与规范检查 pre-commit 🕚 >>>
开源片段检查 SCA 🕚 >>>
开发者测试 UT_linux_arm_mindie-llm 🕚 >>>
UT_linux_arm_atb-models 🕚 >>>
流水线 PR-pipeline_MindIE-LLM_gitcode 🟨 >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员评论有效
  • compile : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
ascend-robotascend-robot成员
6月27日 添加了label:ci-pipeline-running
ascend-robot
ascend-robot成员
6月27日 评论:

ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
6月27日 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
6月27日 评论:

ascend docs pipeline is running...

likedislike
atomgit-bot
atomgit-bot
6月27日 评论:

变更摘要

该 PR 修复了同时启用 W8A8 量化 + LoRA + FlashComm 时出现的精度劣化和回复重复乱码问题。根因是:AllGather 在父图中原本读取 intermediate_quant_input 张量,但量化操作使父图试图读取子图中尚未初始化的 intermediate_inner_tp_input。修复方案是在 AddAllGather 函数中增加对 supportLora 标志的判断,当 LoRA 启用时统一回退到读取父图的 in_input,避免跨图引用未初始化张量。

主要改动

  • AllGather 输入张量选择逻辑增加 LoRA 条件: 在 linear.cppAddAllGather 中,原本仅根据 quantType 是否为 W8A8 系列量化类型来决定使用 "intermediate_quant_input" 还是 "in_input";现在增加了 && !param.supportLora 条件,当 LoRA 启用时强制使用 "in_input",避免读取子图未初始化的中间张量。

  • 动态量化场景的 AllGatherInputScale 节点创建增加 LoRA 条件: 原本当 quantTypeLINEAR_W8A8_DYNAMIC_QUANTLINEAR_W8A8_DYNAMIC_DEQUANT 时会额外创建 allGatherInputScaleNode;现在同样加入 && !param.supportLora 判断,LoRA 启用时跳过该节点的创建,保持与主 AllGather 输入张量选择的一致性。

likedislike
ascend-robot
ascend-robot成员
6月27日 评论:

✅ 跳过 docs ci 检查,没有需要检查的文档文件

likedislike
ascend-robotascend-robot成员
6月27日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
6月27日 添加了label:docs-ci-pipeline-success
ascend-robot
ascend-robot成员
6月27日 评论:

✅ 跳过 docs ci 检查,没有需要检查的文档文件

likedislike
atomgit-bot
atomgit-bot
6月27日 评论:

代码审查

✅ 未发现问题

likedislike
ascend-robotascend-robot成员
6月27日 删除了label:ci-pipeline-running
ascend-robotascend-robot成员
6月27日 添加了label:ci-pipeline-failed
ascend-robot
ascend-robot成员
6月27日 评论:
流水线 PR-pipeline_MindIE-LLM_gitcode#5692 [ commitID:69506b67 ] 运行失败
>>>代码风格自动修复执行失败,具体请查看日志,不影响流水线执行及PR合入
阶段 任务名 状态 详情
编译构建 Build_ops_x86_A3 🕚 >>>
Build_ops_arm_A3 🕚 >>>
Build_ops_x86_A2 🕚 >>>
Build_ops_arm_A2 🕚 >>>
Build_linux_x86_abi1_atb 🕚 >>>
Build_linux_x86_abi1_llm 🕚 >>>
Build_linux_arm_abi1_atb 🕚 >>>
Build_linux_arm_abi1_llm 🕚 >>>
Build_linux_arm_abi0_atb 🕚 >>>
Build_linux_arm_abi0_llm 🕚 >>>
恶意代码检查 Antipoison >>>
编码安全与规范检查 pre-commit >>>
开源片段检查 SCA >>>
开发者测试 UT_linux_arm_mindie-llm 🕚 >>>
UT_linux_arm_atb-models 🕚 >>>
流水线 PR-pipeline_MindIE-LLM_gitcode >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员评论有效
  • compile : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
gengli8gengli8成员
6月27日 强制推送  2 个提交:29c80ba2-[atb-models] [bug-fix] Fix Quant+LoRA+FlashComm combination bugs,e9b9065e-[style] pre-commit format fix
ascend-robotascend-robot成员
6月27日 删除了label:ci-pipeline-failed
ascend-robotascend-robot成员
6月27日 添加了label:stat/needs-squash
gengli8
gengli8成员
6月27日 评论:

compile

likedislike
ascend-robotascend-robot成员
6月27日 添加了label:ci-pipeline-running
ascend-robot
ascend-robot成员
6月27日 评论:

ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
6月27日 删除了label:docs-ci-pipeline-success
ascend-robotascend-robot成员
6月27日 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
6月27日 评论:

ascend docs pipeline is running...

likedislike
ascend-robot
ascend-robot成员
6月27日 评论:

✅ 跳过 docs ci 检查,没有需要检查的文档文件

likedislike
ascend-robotascend-robot成员
6月27日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
6月27日 添加了label:docs-ci-pipeline-success
ascend-robot
ascend-robot成员
6月27日 评论:

✅ 跳过 docs ci 检查,没有需要检查的文档文件

likedislike
gengli8gengli8成员
6月27日 修改了pull request 的描述
gengli8gengli8成员
6月27日 关联了issue:[Bug]: Qwen3-4B量化权重+LoRA+高并发精度劣化,输出出现重复
ascend-robotascend-robot成员
6月27日 删除了label:needs-issue
ascend-robotascend-robot成员
6月27日 删除了label:ci-pipeline-running
ascend-robotascend-robot成员
6月27日 添加了label:ci-pipeline-passed
ascend-robot
ascend-robot成员
6月27日 评论:
流水线 PR-pipeline_MindIE-LLM_gitcode#5693 [ commitID:e9b9065e ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
阶段 任务名 状态 详情
编译构建 Build_ops_x86_A3 >>>
Build_ops_arm_A3 >>>
Build_ops_x86_A2 >>>
Build_ops_arm_A2 >>>
Build_linux_x86_abi1_atb >>>
Build_linux_x86_abi1_llm >>>
Build_linux_arm_abi1_atb >>>
Build_linux_arm_abi1_llm >>>
Build_linux_arm_abi0_atb >>>
Build_linux_arm_abi0_llm >>>
恶意代码检查 Antipoison >>>
编码安全与规范检查 pre-commit >>>
开源片段检查 SCA >>>
开发者测试 UT_linux_arm_mindie-llm >>>
UT_linux_arm_atb-models >>>
流水线 PR-pipeline_MindIE-LLM_gitcode >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员评论有效
  • compile : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
earthmanylf
earthmanylf
7月1日 评论:

/lgtm

likedislike
CXY-Katrina
CXY-Katrina成员
7月1日 评论:

/merge

likedislike
ascend-robotascend-robot成员
7月1日 添加了label:keeper_approved
CXY-Katrina
CXY-Katrina成员
7月1日 评论:

/approve

likedislike
ascend-robotascend-robot成员
7月1日 添加了label:approvedlgtm
ascend-robotascend-robot成员
7月1日 合入了pull request