Recognize explicit second-order AutoSparse AD#1269
Draft
ChrisRackauckas-Claude wants to merge 1 commit into
Draft
Recognize explicit second-order AutoSparse AD#1269ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AutoSparseAD types that explicitly wrapDifferentiationInterface.SecondOrdermissing_second_order_adwarning for implicit first-orderAutoSparseinputsContext
Optimization's exact-Hessian cache warning only recognized a top-level
SecondOrder. The documented sparse form is insteadAutoSparse(SecondOrder(inner, outer)), so an explicitly configured sparse second-order backend was incorrectly warned as missing second-order AD.This became visible in BoundaryValueDiffEq after OptimizationIpopt 1.3 switched to the generic
OptimizationCache. A separate downstream follow-up supplies an explicit sparseSecondOrder; this PR only fixes OptimizationBase's classification.Related prior art: #1061 called out this false warning while working around it downstream, and #1240 concerns another second-order warning edge case. I found no open duplicate PR.
Investigation
AutoSparse(SecondOrder(AutoForwardDiff(), AutoForwardDiff()))solves successfully.AutoSparseoutside the individualSecondOrderbackends is the working sparse representation; the alternative top-level construction fails in DifferentiationInterface's pullback path.Local verification
OPTIMIZATION_TEST_GROUP=Core: 54 passedOPTIMIZATION_TEST_GROUP=QA: 16 passed, 1 pre-existing broken assertion; package test passedPlease ignore this draft until it has been reviewed by @ChrisRackauckas.