Add PiSSA initialization for Megatron LoRA adapters - #2069
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for offline PiSSA (Principal Singular values and Singular vectors Adaptation) initialization with Megatron, including launcher scripts, documentation, and tests for both dense and grouped-expert MoE models. The feedback focuses on enhancing the robustness and safety of the implementation: running the memory-intensive SVD decomposition on the CPU instead of the GPU to prevent OOM errors on large models, avoiding the discouraged use of .data in PyTorch in favor of .detach(), and passing an integer instead of a float for the training steps parameter.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 47b983c. Configure here.

Summary
Following Meng et al., this adds PiSSA initialization for Megatron LoRA adapters.
Results
Initialization numerical error
PiSSA initialization preserves the base model at approximately the same log-probability error scale as standard LoRA initialization.
Qwen3-0.6B training
The included Qwen3-0.6B PiSSA recipe was trained against the corresponding SkyRL Megatron LoRA example.
Follow-ups
Testing
The focused suite passes 20 tests, with the two multi-GPU identity cases deselected. A real two-process collective smoke test also passes. SkyRL's pinned Black check, launcher shell syntax checks, pre-commit workflow, and SkyRL Gym CI pass.
The test suite includes dense TP=2/PP=2 and grouped-MoE TP=4/EP=8/ETP=1 identity cases. The upstream GPU workflow could not start for this fork PR because the Anyscale credential is unavailable to fork workflows; it failed before allocating hardware or running tests.