Merged
[fix] Preserve resumable LoRA checkpoints and PEFT exports on dev_0.4.0 #1168
[fix] Preserve resumable LoRA checkpoints and PEFT exports on dev_0.4.0 #1168
Merged
leedongkun30-archAdd on Nov 3
leedongkun30-arch

描述

DeepSeek LoRA retention now recognizes completed PEFT exports and preserves the latest native resume point when model-only exports occupy the retention slots. PEFT writes stage both files and publish the configuration last. Native LoRA resume rejects missing adapter tensors before loading any state.

The checkpoint changes reuse the existing cleanup schedule on dev_0.4.0 and validate adapter completeness before selecting or protecting a native LoRA resume point. The review follow-ups select the fused shared-expert gate/up weight for dense quantization and keep V4.1 compiler dispatch changes local to each model, including the standard AllToAll reorder workaround.

The LoRA integration export check derives target names from the exported tensors and compares rank and alpha with the input model configuration.

The V4 and V4.1 guides include native checkpoint resume test commands.

类型

Checklist

如何测试

当前 CI

CI #2514 is running for source 986dec6 against dev_0.4.0 at 775fdcd. Both A3 smoke jobs are skipped by branch policy.

此前 Ascend A3 验证

The following device results were measured on the revisions named in each section.

A3 integration and DVM validation for 9c463eb

The V4 and V4.1 LoRA integration harnesses now use the current training engine, optimizer and checkpointer APIs. On two Ascend A3 devices, all four native save and fresh-process resume cases passed under EP2/FSDP2. Loss and gradient norm matched the uninterrupted run for all 11 replayed steps. Both ranks verified the final PEFT export. The two adapter-only cases also matched adapter and optimizer state at load and after each replayed step.

DVM generated NPU kernels for the V4.1 block compile policy. The candidate's standard and fused HCCL dispatchers matched eager outputs and input and expert gradients across two changing split patterns. The runtime assertion setting and the separate eager model were preserved.

Anonymized A3 results and reproduction commands

A3 variable-split EP validation for 90d1bd0

Both standard and fused HCCL dispatchers on two logical Ascend A3 devices matched eager outputs and input and expert-scale gradients exactly across two changing split patterns. The test selected the production V4.1 Inductor dispatcher policy and compiled the test block with aot_eager. NPU Inductor code generation stopped at an AutoFuse API mismatch in the installed runtime.

Anonymized A3 per-rank data and CI evidence

A3 restart validation for 33a369e

On two logical Ascend A3 devices, a fresh process automatically resumed from the complete native step-5 checkpoint with a newer weights-only DCP and PEFT export in the same folder. Global average loss and gradient norm matched the uninterrupted run for all five replayed updates. Both ranks matched the final training state, and the step-10 PEFT exports matched byte for byte across all 98 adapter tensors and the configuration. The restart arm retained the step-5 checkpoint.

Anonymized A3 validation report and per-rank results

The earlier Ascend A3 debug and 20-update DeepSeek V4.1 Flash comparison ran on revision 28e378d. Earlier revision evidence.

此前 CI

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for leedongkun30-arch's contribution.)
leedongkun30-archleedongkun30-arch
Nov 3 Created pull request, commit 17a41a39
CANN-robotCANN-robotCollaborators
Nov 3 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Nov 3 Comments:

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.
For more, you also can visit HICANN.


PR Approval Progress

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

Module Approval Details

module lgtm status approve status
repo-cann/torchtitan-npu ✅ lrwei0709, xuyujun (2/2) ✅ xuyujun (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
Nov 3 Set hwcaifubi,lrwei0709,zhaowei1936,zhong_lin,zhanghz1,depeng1994,shengnan666,XDaoHong,xuyujun,zhuofanshen,wanghui0,panchao-gitcode,zzyyjj012 as approver
CANN-robotCANN-robotCollaborators
Nov 3 Set hwcaifubi,lrwei0709,zhaowei1936,zhong_lin,zhanghz1,depeng1994,shengnan666,XDaoHong,xuyujun,zhuofanshen,wanghui0,panchao-gitcode,zzyyjj012 as approver
458 messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
24 days ago Added label: lgtm
CANN-robotCANN-robotCollaborators
24 days ago Merged pull request
CANN-robot
CANN-robotCollaborators
24 days ago Comments:

Pull Request 已合并或已关闭。

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

likedislike
1Fire41Fire4Collaborators
23 days ago Associated issue: [RFC] TorchTitan v0.4.0 分阶段升级规划与进度跟踪
CANN-robot
CANN-robotCollaborators
23 days ago Comments:

Pull Request 已合并或已关闭。

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

likedislike