-
Notifications
You must be signed in to change notification settings - Fork 56
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
OM_DVGEOCOMP
tests and forward mode derivatives
#250
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #250 +/- ##
==========================================
+ Coverage 65.41% 67.03% +1.61%
==========================================
Files 47 47
Lines 12315 12331 +16
==========================================
+ Hits 8056 8266 +210
+ Misses 4259 4065 -194 ☔ 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.
Thanks for catching this, LGTM
@eytanadler, this was discussed during the maintenance meeting last week (missed the last one), but just want to clarify, do you plan to add the forward mode in this PR? We can also just add that in a separate PR, but in that case please make an issue documenting the forward mode additions etc. |
Yes, I’ll add it here. I just haven’t got around to it yet. |
I did a first pass of forward mode derivatives for the MPhys DVGeo component. I'm not super familiar with the parallelization hacks, so @anilyil please check those and let me know if you have any concerns. Tests for this component and its derivatives are included on the mphys-tests branch, so I think it'd be best to either merge that branch into this one or this branch into that one. That way, we can ensure these derivatives work as expected before merging to main. I ran the tests locally and this seems to produce the same results as reverse mode. A couple other things I found and changed while making this:
In the meantime, I'll add fwd mode derivative checking to the tests on the mphys-tests branch. |
This is finally ready for review |
OM_DVGEOCOMP
OM_DVGEOCOMP
tests and forward mode derivatives
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.
Thanks for the hard work @hajdik and @eytanadler . Just a few small changes, but overall this is great.
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.
Great stuff. 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.
Not very familiar with the MPhys wrapper here, but the code changes make sense and are well implemented. Good job!
Is this change worth version update @eytanadler @hajdik ? Feel free to merge otherwise |
Yeah probably a good idea |
ec99fe4
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. @hajdik go ahead and merge this when you get the chance.
Purpose
The MPhys component for pygeo supports only reverse mode derivatives and otherwise gives zero derivatives. However, no warning or error is thrown. This PR adds forward mode derivatives to the MPhys component so it supports
mode="fwd"
.The branch for testing the MPhys wrapper for DVGeo/DVCon was merged into this in order to test the forward mode derivatives. The tests so far include commonly used functions in DVGeo, DVCon, and DVGeoESP.
This also addresses the ESP side of #249.
Expected time until merged
A few days
Type of change
Testing
Checklist
flake8
andblack
to make sure the Python code adheres to PEP-8 and is consistently formattedfprettify
or C/C++ code withclang-format
as applicable