Fix SimpleNonlinearSolve GPU compat: replace isinplace() with isa checks#865
Closed
AdityaPandeyCN wants to merge 13 commits intoSciML:masterfrom
Closed
Fix SimpleNonlinearSolve GPU compat: replace isinplace() with isa checks#865AdityaPandeyCN wants to merge 13 commits intoSciML:masterfrom
AdityaPandeyCN wants to merge 13 commits intoSciML:masterfrom
Conversation
Removed 'src' from the coverage directories in the pipeline configuration.
SciMLBase.isinplace extracts a type parameter and returns a compile-time constant (true/false). The compiler constant-folds it, so @generated functions are unnecessary for eliminating dead branches. Regular functions with if SciMLBase.isinplace(prob) infer identically. Reverted: incompatible_backend_and_problem, evaluate_f!!, evaluate_f, should_cache_fx, and prepare_jacobian back to regular functions. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Member
|
|
5 tasks
Contributor
Author
|
After we know that iip is already a bool and still using that is throwing error, should we give this pr a retry? @ChrisRackauckas |
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.
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
SciMLBase.isinplace()returns a type parameter value that GPUs cannot branch on as GPU masked execution runs both sides of anif, so the dead in-place branch hitssimilar()or mismatched call signatures and throws. The fix replaces allisinplace()checks in the GPU code path withprob.f isa NonlinearFunction{true}which returns a properBool, callsf.f()directly to avoid varargs splatting, and adds GPU-safe fast paths forincompatible_backend_and_problemfor AutoForwardDiff/AutoFiniteDiff/AutoEnzyme whoseDI.check_available/DI.check_inplacedo method table lookups that GPU kernels cannot handle.I have built the PR on #854