Megatron colocated LoRA weight sync fails on CUDA IPC and needs CPU staging fallback
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- python, pytorch
- Domain
- distributed-systems, machine-learning
Research direction
No file paths or tests are named. Start by locating the Megatron colocated LoRA synchronization path and the reported serialize_named_weights → ForkingPickler call chain, then review how lora_rank and converter kwargs flow through it. Done should be defined separately for the optional CPU-staging transport, converter propagation fixes, and manifest prepare/commit behavior.
Written by the indexing model from the issue text.
Description
Problem
We encountered a weight synchronization failure when running Qwen3.6-27B LoRA PPO with:
- Megatron actor training
- vLLM actor inference
- colocated train/infer workers
- TP=4, PP=4
- LoRA weight updates
The original colocated synchronization path serializes GPU tensors through MultiprocessingSerializer, which eventually calls:
serialize_named_weights
-> ForkingPickler
-> torch.multiprocessing.reductions.reduce_tensor
-> storage._share_cuda_()
-> CUDA driver error: unknown error
This happens on our accelerator environment where CUDA IPC is unavailable or incompatible.
Workaround that succeeded
We implemented an optional CPU staging path for colocated LoRA updates:
GPU LoRA tensors
-> flattened bucket
-> bucket.to("cpu")
-> standard pickle bytes
-> Gloo gather_object
-> Ray RPC
-> one bucket.to(device) on the vLLM worker
-> reconstruct tensor views
-> prepare and commit LoRA
With this workaround, the PPO task trained continuously for more than 91 steps.The synchronized payload was LoRA-only:
624 tensors
169,417,728 bytes
Scope
The workaround is strictly limited to:
Megatron + colocated + LoRA
We have not validated it for:
- Full-weight synchronization
- Megatron separated mode
- FSDP2
- SGLang
We also did not add or register GDN LoRA support. GDN in_proj LoRA modules were excluded because the current converter expects special StackedTensors semantics.
Related fixes
During this investigation, we also found:
lora_rankwas not propagated through the complete Megatron-to-HF converter call chain.**kwargscould be lost during an intermediate weight-buffer flush.- Dynamic LoRA updates benefit from an
update_id, manifest validation, and prepare/commit semantics to prevent partial updates.
Proposal
Would the maintainers be interested in:
- A generic optional CPU-staging transport for colocated LoRA synchronization?
- A separate fix for lora_rank and converter kwargs propagation?
- LoRA update manifest validation and prepare/commit support?
If this direction is acceptable, I can prepare the changes as separate pull requests with tests.
- Dominant language
- Python
- Stars
- 3.4k
- Forks
- 313
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from alibaba/ROLL
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
求,什么时候支持一下RSI。 Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100