已合并
feat: add mhc recompute #3619
feat: add mhc recompute #3619
已合并
wuweiqiang24创建于 7月5日
wuweiqiang24
wuweiqiang24成员
7月5日

What this PR does / why we need it?

This PR adds fine-grained recomputation for DeepSeek V4 to reduce peak NPU memory usage.

Main changes:

  • Add CSA recomputation controlled by --recompute-csa-attention.
  • Add fused MHC recomputation controlled by --mhc-recompute.
  • Support regular Transformer and MoE FB overlap paths.
  • Adapt PP layout, MTP, norm recomputation and swap layer input.
  • Replace legacy G2 naming with CSA terminology.

Does this PR introduce any user-facing change?

Two new options are added:

--recompute-csa-attention
--mhc-recompute

Does this PR introduce any user-facing change?

  • Compared loss, gradient norm and peak NPU memory with recomputation-disabled and full-recomputation configurations.
likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 wuweiqiang24 的贡献)
wuweiqiang24wuweiqiang24成员
7月5日 创建了 pull request,commit 86f4c698
ascend-robotascend-robot成员
7月5日 添加了label:ascend-cla/yes
ascend-robot
ascend-robot成员
7月5日 评论:

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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.


PR Approval Progress

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

Module Approval Details

module lgtm status approve status
repo-Ascend/MindSpeed 郑加利, dao_qian (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

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

likedislike
ascend-robot
ascend-robot成员
7月5日 评论:

ascend docs pipeline is running...

likedislike
此处折叠了181条消息 查看更多
ascend-robotascend-robot成员
12 天前 添加了label:lgtm
ascend-robot
ascend-robot成员
12 天前 评论:

The MR can not be merged, because of CodeReview discussion not resolved

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike
dao_qiandao_qian成员
12 天前 解决了最后一个问题
ascend-robotascend-robot成员
12 天前 合入了pull request
ascend-robot
ascend-robot成员
12 天前 评论:

Pull Request 已合并或已关闭。

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike