JuliaDiff / SparseDiffTools.jl

Fast jacobian computation through sparsity exploitation and matrix coloring
MIT License
237 stars 41 forks source link

Fix CI #235

Closed gaurav-arya closed 1 year ago

gaurav-arya commented 1 year ago

Resolves #234. Fixes various typos that crept in when CI was disabled

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +82.30 :tada:

Comparison is base (f191085) 0.21% compared to head (7e41089) 82.52%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #235 +/- ## =========================================== + Coverage 0.21% 82.52% +82.30% =========================================== Files 14 14 Lines 929 944 +15 =========================================== + Hits 2 779 +777 + Misses 927 165 -762 ``` | [Impacted Files](https://codecov.io/gh/JuliaDiff/SparseDiffTools.jl/pull/235?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaDiff) | Coverage Δ | | |---|---|---| | [ext/SparseDiffToolsZygote.jl](https://codecov.io/gh/JuliaDiff/SparseDiffTools.jl/pull/235?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaDiff#diff-ZXh0L1NwYXJzZURpZmZUb29sc1p5Z290ZS5qbA==) | `82.85% <100.00%> (+82.85%)` | :arrow_up: | | [src/differentiation/jaches\_products.jl](https://codecov.io/gh/JuliaDiff/SparseDiffTools.jl/pull/235?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaDiff#diff-c3JjL2RpZmZlcmVudGlhdGlvbi9qYWNoZXNfcHJvZHVjdHMuamw=) | `95.83% <100.00%> (+95.83%)` | :arrow_up: | ... and [11 files with indirect coverage changes](https://codecov.io/gh/JuliaDiff/SparseDiffTools.jl/pull/235/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaDiff) Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaDiff). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaDiff)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

vpuri3 commented 1 year ago

https://github.com/JuliaDiff/SparseDiffTools.jl/actions/runs/4537212339/jobs/7994820746?pr=235#step:6:389

  LoadError: MethodError: no method matching Float64(::ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.##280.staticf), Float64}, Float64, 3})
  Closest candidates are:
    (::Type{T})(::Real, ::RoundingMode) where T<:AbstractFloat at rounding.jl:200
    (::Type{T})(::T) where T<:Number at boot.jl:760
    (::Type{T})(::AbstractChar) where T<:Union{AbstractChar, Number} at char.jl:50
    ...
  Stacktrace:
    [1] convert(#unused#::Type{Float64}, x::ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.##280.staticf), Float64}, Float64, 3})
      @ Base ./number.jl:7
    [2] macro expansion
      @ ~/.julia/packages/StaticArraysCore/U2Z1K/src/StaticArraysCore.jl:81 [inlined]
    [3] convert_ntuple
      @ ~/.julia/packages/StaticArraysCore/U2Z1K/src/StaticArraysCore.jl:77 [inlined]
    [4] StaticArraysCore.SVector{30, Float64}(x::NTuple{30, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.##280.staticf), Float64}, Float64, 3}})
      @ StaticArraysCore ~/.julia/packages/StaticArraysCore/U2Z1K/src/StaticArraysCore.jl:113
    [5] SArray
      @ ~/.julia/packages/StaticArraysCore/U2Z1K/src/StaticArraysCore.jl:117 [inlined]
    [6] StaticArray
      @ ~/.julia/packages/StaticArrays/a4r2v/src/convert.jl:167 [inlined]
    [7] restructure(x::StaticArraysCore.SVector{30, Float64}, y::StaticArraysCore.SVector{30, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.##280.staticf), Float64}, Float64, 3}})
      @ ArrayInterface.ArrayInterfaceStaticArraysCoreExt ~/.julia/packages/ArrayInterface/xqHUD/ext/ArrayInterfaceStaticArraysCoreExt.jl:34
    [8] SparseDiffTools.ForwardColorJacCache(f::typeof(Main.##280.staticf), x::StaticArraysCore.SVector{30, Float64}, _chunksize::Nothing; dx::StaticArraysCore.SVector{30, Float64}, tag::Nothing, colorvec::Vector{Int64}, sparsity::SparseArrays.SparseMatrixCSC{Float64, Int64})
      @ SparseDiffTools ~/work/SparseDiffTools.jl/SparseDiffTools.jl/src/differentiation/compute_jacobian_ad.jl:47
gaurav-arya commented 1 year ago

I don't think it's related to ArrayInterface / StaticArrays? There's just a dual number that's trying to be written into a float array cache.

gaurav-arya commented 1 year ago

Okay, @vpuri3 you're right that's there some StaticArrays / ArrayInterface shenanigans going on. Various typos also causeed the same error to be thrown at different places in the tests -- those are fixed now.

gaurav-arya commented 1 year ago

@ChrisRackauckas I think this can be merged. CI was previously completely down, so this is a strict improvement, and helps unblock #232. The only thing that fails in CI is test_ad.jl (which I put at the end of runtests.jl so that we can see that everything else now passes) -- that's because of #237.

ChrisRackauckas commented 1 year ago

Bump the ArrayInterface lower bound to include the patch.