aigc-apps / aigc-apps/VideoX-Fun

WAN2.1-14B LoRA Training problem

Open
#170 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.3k
Forks
188
Avg merge
2d 22h
Merged PRs (30d)
3

Description

I attempted to fine-tune WAN2.1 14B using LoRA on 8 L40s GPUs (48GB each).

When using ZeRO-2, I encountered OOM (Out of Memory) errors regardless of parameter settings.
When switching to ZeRO-3, the following error occurred:

[rank5]: torch.utils.checkpoint.CheckpointError: torch.utils.checkpoint: Recomputed values for the following tensors have different metadata than during the forward pass.  
[rank5]: tensor at position 14:                                                                                                                                             
[rank5]: saved metadata: {'shape': torch.Size([5120]), 'dtype': torch.bfloat16, 'device': device(type='cuda', index=5)}                                                     
[rank5]: recomputed metadata: {'shape': torch.Size([0]), 'dtype': torch.bfloat16, 'device': device(type='cuda', index=5)}                                                   
[rank5]: tensor at position 24:                                                                                                                                             
[rank5]: saved metadata: {'shape': torch.Size([5120]), 'dtype': torch.bfloat16, 'device': device(type='cuda', index=5)}                                                     
[rank5]: recomputed metadata: {'shape': torch.Size([0]), 'dtype': torch.bfloat16, 'device': device(type='cuda', index=5)}                                                   
[rank5]: tensor at position 60:                                                                                                                                             
[rank5]: saved metadata: {'shape': torch.Size([5120]), 'dtype': torch.bfloat16, 'device': device(type='cuda', index=5)}                                                     
[rank5]: recomputed metadata: {'shape': torch.Size([0]), 'dtype': torch.bfloat16, 'device': device(type='cuda', index=5)}
[rank5]: tensor at position 70:
[rank5]: saved metadata: {'shape': torch.Size([5120]), 'dtype': torch.bfloat16, 'device': device(type='cuda', index=5)}
[rank5]: recomputed metadata: {'shape': torch.Size([0]), 'dtype': torch.bfloat16, 'device': device(type='cuda', index=5)}
[rank5]: tensor at position 85:
[rank5]: saved metadata: {'shape': torch.Size([5120]), 'dtype': torch.bfloat16, 'device': device(type='cuda', index=5)}
[rank5]: recomputed metadata: {'shape': torch.Size([0]), 'dtype': torch.bfloat16, 'device': device(type='cuda', index=5)}

This occurred while using the default LoRA configuration.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing WAN2.1 14B LoRA training with the default LoRA configuration on 8 L40 GPUs, comparing ZeRO-2 and ZeRO-3. Investigate the reported checkpoint metadata mismatch and OOM behavior; done means the training run completes without either failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
distributed-systems, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.