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

Fix cholesky_decompose not updating adjoints correct (2.26) #2365

Merged
merged 2 commits into from
Feb 11, 2021

Conversation

bbbales2
Copy link
Member

Summary

Fixes #2364 . The problem was cholesky_decompose not updating the input adjoints correctly (but doing it in a way that it would pass generic autodiff tests).

Tests

Added one!

Release notes

  • Fixed issue with cholesky_decompose not propagating derivatives correctly

Checklist

@bbbales2 bbbales2 changed the title Fix Fix cholesky_decompose not updating adjoints correct (2.26) Feb 10, 2021
@bbbales2
Copy link
Member Author

Will this test run correctly for opencl when opencl is turned on? I guess, did opencl have this problem?

@rok-cesnovar
Copy link
Member

Based on https://github.com/stan-dev/math/blob/develop/stan/math/opencl/rev/cholesky_decompose.hpp#L72 I would say no? But I am going to push the same test to the OpenCL variant as well.

@@ -87,7 +89,7 @@ inline auto cholesky_lambda(T1& L_A, T2& L, T3& A) {
using Eigen::Lower;
using Eigen::StrictlyUpper;
using Eigen::Upper;
Eigen::MatrixXd L_adj(L.rows(), L.cols());
Eigen::MatrixXd L_adj = Eigen::MatrixXd::Zero(L.rows(), L.cols());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh interesting, was the issue here that the upper triangular part of the matrix was not being set?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually I meant to leave a comment there. That one change I just did cause it looked scary and was too lazy to check the Eigen docs or carefully read the code.

Copy link
Member Author

Choose a reason for hiding this comment

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

That one can def. be reverted but I just saw it and got nervous.

@SteveBronder
Copy link
Collaborator

Looks like it failed on the upstream?

https://jenkins.mc-stan.org/blue/organizations/jenkins/Stan/detail/downstream_hotfix/7/pipeline/

@rok-cesnovar
Copy link
Member

Yeah, I dont get that error "You are not currently on a branch.". @serban-nicusor-toptal will know for sure :)

@serban-nicusor-toptal
Copy link
Contributor

I'm on it, checking to see what's wrong.

@rok-cesnovar
Copy link
Member

Thanks! Seems like the issue on the Stan repo was fixed but now the same one popped up in CmdStan.

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 3.49 3.48 1.0 0.4% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.96 -4.03% slower
eight_schools/eight_schools.stan 0.11 0.11 1.02 1.89% faster
gp_regr/gp_regr.stan 0.15 0.16 0.99 -0.85% slower
irt_2pl/irt_2pl.stan 5.26 5.23 1.01 0.64% faster
performance.compilation 89.68 93.12 0.96 -3.84% slower
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 7.79 8.72 0.89 -11.93% slower
pkpd/one_comp_mm_elim_abs.stan 30.65 28.22 1.09 7.92% faster
sir/sir.stan 128.36 132.69 0.97 -3.37% slower
gp_regr/gen_gp_data.stan 0.04 0.04 0.99 -0.7% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.05 3.04 1.0 0.34% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.38 0.38 1.0 0.16% faster
arK/arK.stan 2.48 1.82 1.36 26.34% faster
arma/arma.stan 0.69 0.6 1.16 13.79% faster
garch/garch.stan 0.65 0.6 1.09 8.46% faster
Mean result: 1.03336790161

Jenkins Console Log
Blue Ocean
Commit hash: v2.26.0


Machine information ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010

CPU:
Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz

G++:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Clang:
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

@serban-nicusor-toptal
Copy link
Contributor

Hey it looks all fixed now. downstream_hotfix was badly configured, fixed it and it shouldn't happen again.
Sorry for the inconvenience caused.

@rok-cesnovar
Copy link
Member

@bbbales2 merge?

@bbbales2
Copy link
Member Author

Can I press the button?

@bbbales2 bbbales2 merged commit 8f2189f into master Feb 11, 2021
@rok-cesnovar rok-cesnovar deleted the bugfix/2364-cholesky-decompose2 branch February 11, 2021 14:06
@wds15
Copy link
Contributor

wds15 commented Feb 11, 2021

How about we align on discourse about 2.26.1 ?

rok-cesnovar pushed a commit that referenced this pull request Feb 17, 2021
Fix `cholesky_decompose` not updating adjoints correct (2.26)
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.

6 participants