已合并
[Feature]:使能LayerwiseDisaggregated边云协同推理特性前提下, 支持配置使能多机推理特性和2p下发的计算图适配 #372
K先生创建于 2月4日
[Feature]:使能LayerwiseDisaggregated边云协同推理特性前提下, 支持配置使能多机推理特性和2p下发的计算图适配 #372
已合并
K先生创建于 2月4日
已删除 :dev合入到Ascend/MindIE-LLMdev
K先生
K先生
2月4日

合入背景

请描述为什么要做这个PR内的改动。
如涉及,请关联前序PR或同特性/需求下的其他PR。
如果是修复之前PR引入的问题,请关联引入问题的PR。
注意:Fixes #ISSUE ID会自动关闭issue,如问题部分解决请不要使用Fixes,可以用Fix part of #ISSUE ID替代.

Fix part of #150
Fix part of #140

修改内容

请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列。
如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容)。

计算图当前的代码仅适配了DP=1的情况,且编写时新增的部分代码在编写时未考虑到DP>1的情况,需要对上述代码进行检查,对不支持DP=2的代码进行适配。同时需要适配支持QKVDownDP优化。
主要调整包括:
1、DP开启后计算图有变化,当前代码存在未修改DP>1成立的分支,需要进行检查适配。
2、需要对QKVDownDP优化进行适配。
QKVDownDP通过在MOE层中更改AllGather位置起到优化。开启后从MoE第一层至倒数第二层,输出的hidden为未进行AllGather的数据,只有最后一层输出之前会AllGather。由于边侧和云侧卡数不同,为保证边云之间传输正确的hidden,需要在云侧最后一层输出执行了AllGather后的hidden。QKVDownDP在边云场景中应只作用于MoE第一层至云侧倒数第二层。
需要在decoder_model和decoder_layer中新增参数,用于判断是否为云侧最后一层。将QKVDownDP的操作限制在云测最后一层之前。
decoder_model和decoder_layer中的InferShape函数需要对输出的shape进行相应的适配。

资料变更

请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及”。
不涉及

接口变更

请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及”。
不涉及

测试结果

请说明测试场景,测试方法以及测试结果。
测试用例设计时需考虑硬件、部署方式、功能、性能、精度、显存等维度。
测试针对集中式/分布式/2P/多机均进行了测旧测新

CheckList

PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x]。

likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 K先生 的贡献)
ascend-robot
ascend-robot成员
2月4日 评论:

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

以下是根据您提交的修改文件推荐的Reviewer和Committer序列,需各模块评审通过后方可合入.

Module List Reviewers Committers
repo-Ascend/MindIE-LLM zzhao2012, winton_he, wbj1207, bowenli, imwangyue jyoung6652, niushiya, evakkkkkkk, zk123, senxiangms
likedislike
ascend-robotascend-robot成员
2月4日 添加了label:ascend-cla/yes
ascend-robotascend-robot成员
2月4日 添加了label:needs-issue
ascend-robot
ascend-robot成员
2月4日 评论:

Linking Issue Notice

@kk1994 , 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
K先生
K先生2月4日进行代码检视2
examples/atb_models/atb_llm/models/deepseekv2/flash_causal_deepseekv2.py
已过期
@@ -2855,3 +2886,4 @@
28552886 self.encode_op_list[layer].set_kv_cache([k_caches[layer]], [v_caches[layer]])
28562887 self.encode_op_prefix_cache_list[layer].set_kv_cache([k_caches[layer]], [v_caches[layer]])
28572888 
K先生
K先生2月4日评论:

函数改名,加上layerwise标志,save_input_param同

likedislike
System
系统消息系统
2月4日 评论:

changed this line on 91ad436f view diff detail

此处折叠了44条消息 查看更多
ascend-robotascend-robot成员
2月7日 添加了label:approvedlgtm
纪涛
纪涛成员
2月11日 评论:

/merge

likedislike
ascend-robotascend-robot成员
2月11日 添加了label:keeper_approved
ascend-robot
ascend-robot成员
2月11日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: Katrina-CXY.
Reviewers who wrote a comment of /lgtm are: Katrina-CXY, zxf_boluochuishui.

likedislike
ascend-robotascend-robot成员
2月11日 合入了pull request