-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix row parallel lora layers parameters initialization bug #9427
base: develop
Are you sure you want to change the base?
Conversation
Thanks for your contribution! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #9427 +/- ##
===========================================
+ Coverage 52.82% 52.91% +0.09%
===========================================
Files 676 676
Lines 107910 107926 +16
===========================================
+ Hits 57001 57107 +106
+ Misses 50909 50819 -90 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
paddlenlp/peft/lora/lora_layers.py
Outdated
if self.is_mp and paddle.in_dynamic_mode(): | ||
with get_rng_state_tracker().rng_state(): | ||
self.lora_A = self.create_parameter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要写两个if else 代码太冗余了, 直接 import contextlib ctx = contextlib.nullcontext() if xxx else get_rng_state_tracker().rng_state()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Bug fixes
PR changes
Models
Description
Fix the bug that in row-parallel LoRA layers, without
get_rng_state_tracker().rng_state()
specified, shards of LoRA A are initialized identically among all devices in MP group. Please refer to how the parameter is initialized inpaddle.distributed.fleet.meta_parallel.RowParallelLinear
.