Skip to content

Make type parameter of passed in sensealg in setvjp a parameteric type from Nothing #1034

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

Closed
wants to merge 1 commit into from

Conversation

Vaibhavdixit02
Copy link
Member

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Add any other context about the problem here.

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.79%. Comparing base (10b49a4) to head (7d77d89).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1034   +/-   ##
=======================================
  Coverage   57.79%   57.79%           
=======================================
  Files          19       19           
  Lines        4525     4525           
=======================================
  Hits         2615     2615           
  Misses       1910     1910           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +390 to 392
function setvjp(sensealg::InterpolatingAdjoint{CS, AD, FDT, VJP},
vjp) where {CS, AD, FDT, VJP}
InterpolatingAdjoint{CS, AD, FDT, typeof(vjp)}(vjp, sensealg.checkpointing,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense, this is a dispatch for how to set the case where vjp isn't set?

@ChrisRackauckas ChrisRackauckas deleted the vjptype branch May 14, 2024 18:03
@Vaibhavdixit02
Copy link
Member Author

This shows up as

ERROR: MethodError: no method matching setvjp(::GaussAdjoint{0, true, Val{:central}, ReverseDiffVJP{false}}, ::ReverseDiffVJP{f[91/414]
                                                                                                                                       
Closest candidates are:                                                                                                                
  setvjp(::SteadyStateAdjoint{CS, AD, FDT, VJP, LS, LK}, ::Any) where {CS, AD, FDT, VJP, LS, LK}                                       
   @ SciMLSensitivity ~/.julia/packages/SciMLSensitivity/ZCFhF/src/sensitivity_algorithms.jl:1107                                      
  setvjp(::GaussAdjoint{CS, AD, FDT, Nothing}, ::Any) where {CS, AD, FDT}                                                              
   @ SciMLSensitivity ~/.julia/packages/SciMLSensitivity/ZCFhF/src/sensitivity_algorithms.jl:583                                       
  setvjp(::QuadratureAdjoint{CS, AD, FDT, Nothing}, ::Any) where {CS, AD, FDT}                                                         
   @ SciMLSensitivity ~/.julia/packages/SciMLSensitivity/ZCFhF/src/sensitivity_algorithms.jl:489                                       
  ...                                                                                                                                  
                                                                                                                                       
Stacktrace:                                                                                                                            
  [1] _concrete_solve_adjoint(::ODEProblem{…}, ::Tsit5{…}, ::Nothing, ::Vector{…}, ::ComponentVector{…}, ::SciMLBase.ChainRulesOriginat
or; verbose::Bool, kwargs::@Kwargs{…})
    @ SciMLSensitivity ~/.julia/packages/SciMLSensitivity/ZCFhF/src/concrete_solve.jl:223
  [2] _concrete_solve_adjoint
    @ SciMLSensitivity ~/.julia/packages/SciMLSensitivity/ZCFhF/src/concrete_solve.jl:209 [inlined]
  [3] #_solve_adjoint#75
    @ DiffEqBase ~/.julia/packages/DiffEqBase/X5SZr/src/solve.jl:1537 [inlined]
  [4] _solve_adjoint
    @ DiffEqBase ~/.julia/packages/DiffEqBase/X5SZr/src/solve.jl:1510 [inlined]
  [5] #rrule#6
    @ DiffEqBaseChainRulesCoreExt ~/.julia/packages/DiffEqBase/X5SZr/ext/DiffEqBaseChainRulesCoreExt.jl:26 [inlined]
  [6] rrule
    @ DiffEqBaseChainRulesCoreExt ~/.julia/packages/DiffEqBase/X5SZr/ext/DiffEqBaseChainRulesCoreExt.jl:22 ```

@ChrisRackauckas
Copy link
Member

MWE?

And no, that still doesn't motivate this PR at all. The nothing dispatch is a default setter. Deleting the default setter is not the solution...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants