You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @BenjaminBossan — we'd like to revive the Riemannian Preconditioned LoRA integration from #1807 and check maintainer interest before opening a fresh PR.
Prior PR: Integrating Riemannian Preconditioner #1807 by @fangzhaozhang (May 2024). Reached your second review round on 2024-07-17 ("getting closer but still a few areas need to be improved"), then went stale and auto-closed on 2024-09-21.
Proposed scope (narrow)
src/peft/optimizers/riemannian.py — a create_riemannian_optimizer(model, optimizer_cls, *, lr, reg, **kwargs) factory in the LoRA+ / LoRA-FA style, with the preconditioner applied via a subclass wrapper so it works with any Optimizer (AdamW, SGD, …) — addresses your issubclass comment on Integrating Riemannian Preconditioner #1807.
Verification: make style clean; pytest tests/test_riemannian_lora.py — 9/9 passing (factory, subclass permissiveness on AdamW + SGD, DoRA compatibility, error cases, exact paper formula, bf16 gradient finiteness).
Questions
Is there still maintainer interest in landing this?
Any objection to the wrapper-subclass approach (thin diff on top of optimizer_cls.step(), works with any optimizer) over Integrating Riemannian Preconditioner #1807's copy-and-modify AdamW approach?
Should the example workflow live in this PR or defer as a follow-up?
If greenlit, credit for the original design + review-round work goes to @fangzhaozhang in the PR body.
Disclosure: this coordination check and any subsequent PR are AI-assisted; will follow the guidelines in CLAUDE.md.
Hi @BenjaminBossan — we'd like to revive the Riemannian Preconditioned LoRA integration from #1807 and check maintainer interest before opening a fresh PR.
Context
r x rpreconditioner to LoRA's gradient step; claim is faster / more LR-robust fine-tuning at negligible overhead.Proposed scope (narrow)
src/peft/optimizers/riemannian.py— acreate_riemannian_optimizer(model, optimizer_cls, *, lr, reg, **kwargs)factory in the LoRA+ / LoRA-FA style, with the preconditioner applied via a subclass wrapper so it works with anyOptimizer(AdamW, SGD, …) — addresses yourissubclasscomment on Integrating Riemannian Preconditioner #1807.src/peft/optimizers/__init__.py— one-line export.tests/test_riemannian_lora.py— new tests.Round-1 review asks from #1807 folded in preemptively:
assertin code — properTypeError/ValueError/RuntimeErrorissubclasscheck onoptimizer_clslora_A/lora_Bpair discovery skips the magnitude vector)Explicitly deferring from #1807's tree:
src/peft/tuners/lycoris_utils.py/poly/router.py— unclear necessity; will drop unless you confirm they're neededexamples/riemannian_lora/— happy to add here or as a follow-upevents.out.tfevents.*fileDraft branch for review
A draft is pushed to a fork so you can see the diff before we open a PR:
Compare against
main: main...smellslikeml:peft:feat/riemannian-preconditioned-loraVerification:
make styleclean;pytest tests/test_riemannian_lora.py— 9/9 passing (factory, subclass permissiveness on AdamW + SGD, DoRA compatibility, error cases, exact paper formula, bf16 gradient finiteness).Questions
optimizer_cls.step(), works with any optimizer) over Integrating Riemannian Preconditioner #1807's copy-and-modify AdamW approach?If greenlit, credit for the original design + review-round work goes to @fangzhaozhang in the PR body.
Disclosure: this coordination check and any subsequent PR are AI-assisted; will follow the guidelines in
CLAUDE.md.