-
Notifications
You must be signed in to change notification settings - Fork 19.4k
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
Update layout_map to use re.search instead of re.match. #18555
Conversation
This allow user to skip the leading ".*' and make the rule more readable.
layout_map['.*dense.*bias'] = ('model',) | ||
layout_map['.*conv2d.*kernel'] = (None, None, None, 'model') | ||
layout_map['.*conv2d.*bias'] = ('model',) | ||
layout_map['dense.*kernel'] = (None, 'model') |
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.
what's the reason for .*
in the middle instead of /
again? the optimizer layout paths?
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.
oh, that's for dense_1/dense_2.
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.
ah right thanks! so i guess that will be up to the user's practice. if they are setting the name themselves on all layers, that won't be necessary (I think?), if they are not, they should leave that in
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.
Correct.
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #18555 +/- ##
==========================================
- Coverage 78.00% 74.25% -3.76%
==========================================
Files 334 334
Lines 32351 32384 +33
Branches 6313 6319 +6
==========================================
- Hits 25237 24046 -1191
- Misses 5546 6815 +1269
+ Partials 1568 1523 -45
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ 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.
This looks good to me! I am trying to follow suit for the LoRA api (similar weight matching based on path required), so I can make the same change over there.
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
This allow user to skip the leading ".*' and make the rule more readable.