Skip to content
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

SparseInverseSubset.jl dependency causes issues on non-GPL Julia builds #763

Closed
ElOceanografo opened this issue Dec 20, 2023 · 1 comment · Fixed by #776
Closed

SparseInverseSubset.jl dependency causes issues on non-GPL Julia builds #763

ElOceanografo opened this issue Dec 20, 2023 · 1 comment · Fixed by #776
Labels
bug Something isn't working

Comments

@ElOceanografo
Copy link
Contributor

ChainRules depends on SparseInverseSubset.jl to be able to differentiate through determinants of sparse matrices. However, this requires the CHOLMOD type for sparse Cholesky decompositions from SuiteSparse.jl, which is unavailable on non-GPL Julia builds, causing errors. See here and here.

I think the cleanest way to handle this would be to add conditional statements for importing SparseInverseSubset.jl, and for the rrules for logdet and logabsdet of sparse matrices so that these are omitted if Base.USE_GPL_LIBS == false. If that sound like the right approach I will make a PR.

@oxinabox
Copy link
Member

I think that does indeed sound right
wrap it in top level

if Base.USE_GPL_LIBS  # don't define these if we don't have CHOLMOD from SuiteSparse.jl
    using SparseInveserSubset
    function rrule(...)
    ...
end

that way we will get the usual behavours as if the rrule had not being defined -- because it wouldn't have been defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants