Skip to content

Conversation

alekseymalakhov11
Copy link

@alekseymalakhov11 alekseymalakhov11 commented Sep 27, 2025

What does this PR do?

This PR implements the experimental SVD-LoRA-GRPO method derived by paper ESSA: Evolutionary Strategies for Scalable Alignment

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include fsdp, megatron, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data
    • If this PR involves multiple modules, separate them with , like [megatron, fsdp, doc]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][fsdp, megatron] feat: dynamic batching

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

Малахов Алексей Павлович added 3 commits September 27, 2025 17:56
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an experimental implementation of SVD-LoRA-GRPO. The core logic is in the new verl/utils/experimental/svd_lora.py file, with integrations in FSDP utilities and worker configurations. My review has identified a few critical issues. There's a TypeError in SVDLinear.create_from_weight that will cause a runtime crash. More importantly, the implementation in apply_svd_lora seems to misinterpret the paper by performing SVD on LoRA's A and B matrices separately, instead of on their product W=BA. I've also pointed out a high-severity issue in fsdp_utils.py where reconstructed weights are not moved to the CPU, and a high-severity maintainability issue regarding the use of a deprecated PyTorch function. Please address these points to ensure the correctness and robustness of this new feature.

@alekseymalakhov11
Copy link
Author

alekseymalakhov11 commented Sep 28, 2025

We’re implementing SVD-LoRA-GRPO on top of the existing SFT-LoRA adapter. Since #3523 is already in progress and touches the same components, we won’t push our implementation here to avoid conflicts. We’ll wait for #3523 to merge, then rebase and update this PR.

@alekseymalakhov11
Copy link
Author

alekseymalakhov11 commented Sep 28, 2025

IMG_2528
Example training run — Qwen2.5-7B on PRM800K with an SFT-LoRA adapter.
The SFT adapter was trained on a different (non-overlapping) PRM800K training subset.
Hyperparameters:

max_prompt_length = 512
max_response_length = 4096
train_batch_size = 512
lr = 0.01
n = 8
loss_agg_mode = "token-mean"
lora_rank = 16
lora_alpha = 32
target_modules = ["q_proj", "k_proj", "v_proj", "o_proj"]
ppo_mini_batch_size = 64
strategy = "fsdp2"
nnodes = 1
n_gpus_per_node = 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant