-
Notifications
You must be signed in to change notification settings - Fork 5
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
CI failing on mac #504
Comments
it looks like this may have been introduced with the cohort model as I can't find an example from |
To investigate this I have cleared the cache and changed the install cmdstan action to pull from the latest version (this functionality was the default but was turned off due to stability concerns - these have now been resolved upstream). |
This had no impact |
I see that the naive model works as expected with both rstan and cmdstanr |
All CI for |
This comment has been minimized.
This comment has been minimized.
I have tested this locally with both intel and mac silicon macs and found no issues. Based on this I think this is strictly a CI issue with the most likely issues being caching of the cmdstan install or the paths used to store included functions (there are general issues with very long paths or paths with spaces in them). |
We are also seeing some CI issues in epiforecasts/EpiNow2#938 but those are explicitly cache related (which I have already checked). Still it is likely findings from that should help here. |
The latent model also works so the issue is specific to the marginal model. |
In case it helps I see this in my local install. |
ah interesting that does help. Is it just the marginal model for you and any other details? |
Do you also have a problem with anything in primarycensored? |
This is the error - possibly related to boost/BH? Compilation ERROR, function(s)/method(s) not created!
Error in compileCode(f, code, language = language, verbose = verbose) :
cialization 'rstan::(anonymous namespace)::command<model96539299c7b__namespace::model96539299c7b_, boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014, 0, 2147483563>, boost::random::linear_congruential_engine<unsigned int, 40692, 0, 2147483399>>>' requested here
1215 | ret = command(args, model_, holder, names_oi_tidx_,
| ^
file9655ae06c8e.cpp:2392:68: note: in instantiation of member function 'rstan::stan_fit<model96539299c7b__namespace::model96539299c7b_, boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014, 0, 2147483563>, boost::random::linear_congruential_engine<unsigned int, 40692, 0, 2147483399>>>::call_sampler' requested here
2392 | &rstan::stan_fit<stan_model, boost::random::ecuyer1988>::call_sampler)
| ^
14 warnings and 4 errors generated. The latent model gives Error in compileCode(f, code, language = language, verbose = verbose) :
signed int, 40014, 0, 2147483563>, linear_congruential_engine<unsigned int, 40692, 0, 2147483399>> &&' for 1st argument
50 | class additive_combine_engine
| ^~~~~~~~~~~~~~~~~~~~~~~
/Users/eidesfun/Library/R/arm64/4.4/library/BH/include/boost/random/additive_combine.hpp:79:48: note: explicit constructor is not a candidate
79 | BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(additive_combine_engine,
| ^
/Users/eidesfun/Library/R/arm64/4.4/library/BH/include/boost/random/additive_combine.hpp:97:46: note: explicit constructor is not a candidate
97 | BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(additive_combine_engine,
| ^
file9651b34186e.cpp:521:11: warning: variable 'pos__' set but not used [-Wunused-but-set-variable]
521 | int pos__ = std::numeric_limits<int>::min();
| ^
12 warnings and 1 error generated. |
Hm okay I wonder if this is the same problem then as the latent model works in the CI. |
where do you see this? I could try the exact same check. The error I get in the vignette is the same as in CI so I think it must be the same |
Here #502 When you switch that vignette over to the latent model the error moves to the first time the marginal model is compiled |
The latent model does work - I think I may have had a knitr cache issue above. The error only occurs in rstan (2.32.6 and 2.36.0.9000), dev version cmdstanr |
If you don't see this locally it must be traceable to some package version? |
or potentially some compiler settings we dont share but mine is all just the default |
same |
downgrade of BH to 1.84 didn't fix it for me. |
Does the stan vignette in primarycensored work for you? That is all the same stan code as in the marginal model apart from the interface code in brms so it localises it to that |
No, and actually ypon looking more closely epidist with cmdstanr doesn't work either with the marginal model. Same error: . + Compiling Stan program...
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:736:47: error: non-constant-expression cannot be narrowed from type 'int64_t' (aka 'long long') to 'int' in initializer list [-Wc++11-narrowing]
736 | std::vector<int>{dist_id, primary_id, stan:
:math::size(params),
| ^~~~~~~~~~~~~~~~~~~~~~~~
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:822:18: note: in instantiation of function template specialization 'primarycensored_lognormal_model_namespace::primarycensored_cdf<int, std::vector<double>, int, std::vector<double>, nullptr>' requested here
822 | primarycensored_cdf(d, dist_id, params, pwindow,
| ^
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:906:21: note: in instantiation of function template specialization 'primarycensored_lognormal_model_namespace::primarycensored_lcdf<int, std::vector<double>, int, std::vector<double>, nullptr>' requested here
906 | log_cdf_upper = primarycensored_lcdf(d_upper, dist_id, params, pwindow,
| ^
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:2321:13: note: in instantiation of function template specialization 'primarycensored_lognormal_model_namespace::primarycensored_lpmf<false, int, std::vector<double>, int, std::vector<double>, nullptr>' requested here
2321 | primarycensored_lpmf<false>(
| ^
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:2593:12: note: in instantiation of function template specialization 'primarycensored_lognormal_model_namespace::primarycensored_lognormal_model::log_prob_impl<false, false, Eigen::Matrix<double, -1, 1>, Eigen::Matrix<int, -1, 1>, nullptr, nullptr, nullptr>' requested here
2593 | return log_prob_impl<propto__, jacobian__>(params_r, params_i, pstream);
| ^
/Users/eidesfun/.cmdstan/cmdstan-2.36.0/stan/src/stan/model/model_base_crtp.hpp:93:50: note: in instantiation of function template specialization 'primarycensored_lognormal_model_namespace::primarycensored_lognormal_model::log_prob<false, false, double>' requested here
93 | return static_cast<const M*>(this)->template log_prob<false, false, double>(
| ^
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:2188:3: note: in instantiation of member function 'stan::model::model_base_crtp<primarycensored_lognormal_model_namespace::primarycensored_lognormal_model>::log_prob' requested here
2188 | ~primarycensored_lognormal_model() {}
| ^
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:736:47: note: insert an explicit cast to silence this issue
736 | std::vector<int>{dist_id, primary_id, stan::math::size(params),
| ^~~~~~~~~~~~~~~~~~~~~~~~
| static_cast<int>( )
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:737:11: error: non-constant-expression cannot be narrowed from type 'int64_t' (aka 'long long') to 'int' in initializer list [-Wc++11-narrowing]
737 | stan::math::size(primary_params)}, "assigning variable ids");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:737:11: note: insert an explicit cast to silence this issue
737 | stan::math::size(primary_params)}, "assigning variable ids");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| static_cast<int>( )
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:736:47: error: non-constant-expression cannot be narrowed from type 'int64_t' (aka 'long long') to 'int' in initializer list [-Wc++11-narrowing]
736 | std::vector<int>{dist_id, primary_id, stan::math::size(params),
| ^~~~~~~~~~~~~~~~~~~~~~~~
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:822:18: note: in instantiation of function template specialization 'primarycensored_lognormal_model_namespace::primarycensored_cdf<int, std::vector<stan::math::var_value<double>>, int, std::vector<double>, nullptr>' requested here
822 | primarycensored_cdf(d, dist_id, params, pwindow,
| ^
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:906:21: note: in instantiation of function template specialization 'primarycensored_lognormal_model_namespace::primarycensored_lcdf<int, std::vector<stan::math::var_value<double>>, int, std::vector<double>, nullptr>' requested here
906 | log_cdf_upper = primarycensored_lcdf(d_upper, dist_id, params, pwindow,
| ^
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:2381:13: note: in instantiation of function template specialization 'primarycensored_lognormal_model_namespace::primarycensored_lpmf<false, int, std::vector<stan::math::var_value<double>>, int, std::vector<double>, nullptr>' requested here
2381 | primarycensored_lpmf<false>(
| ^
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:2593:12: note: in instantiation of function template specialization 'primarycensored_lognormal_model_namespace::primarycensored_lognormal_model::log_prob_impl<false, false, Eigen::Matrix<stan::math::var_value<double>, -1, 1>, Eigen::Matrix<int, -1, 1>, nullptr, nullptr, nullptr>' requested here
2593 | return log_prob_impl<propto__, jacobian__>(params_r, params_i, pstream);
| ^
/Users/eidesfun/.cmdstan/cmdstan-2.36.0/stan/src/stan/model/model_base_crtp.hpp:98:50: note: in instantiation of function template specialization 'primarycensored_lognormal_model_namespace::primarycensored_lognormal_model::log_prob<false, false, stan::math::var_value<double>>' requested here
98 | return static_cast<const M*>(this)->template log_prob<false, false>(theta,
| ^
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:2188:3: note: in instantiation of member function 'stan::model::model_base_crtp<primarycensored_lognormal_model_namespace::primarycensored_lognormal_model>::log_prob' requested here
2188 | ~primarycensored_lognormal_model() {}
| ^
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:736:47: note: insert an explicit cast to silence this issue
736 | std::vector<int>{dist_id, primary_id, stan::math::size(params),
| ^~~~~~~~~~~~~~~~~~~~~~~~
| static_cast<int>( )
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:737:11: error: non-constant-expression cannot be narrowed from type 'int64_t' (aka 'long long') to 'int' in initializer list [-Wc++11-narrowing]
737 | stan::math::size(primary_params)}, "assigning variable ids");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/folders/n9/h_419gjj2mg3d208nplgvbg40000gp/T/RtmpeMkxGX/model-8dc17775757.hpp:737:11: note: insert an explicit cast to silence this issue
737 | stan::math::size(primary_params)}, "assigning variable ids");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| static_cast<int>( )
4 errors generated. |
You know what, we had this before. Replace |
Ah nice. I will update. Was there an interaction in EpiNow2 between cmdstanr and rstan? I assume that must be why the primarycensored CI doesn't see this. |
Testing: #524 |
I need to stop using size.. |
Amazing this looks like it works. Phew. Just doing the PR over in |
Can you check with dev version rstan, too? In previous exploration we found that an upstream fix broke things. |
I just checked and that is what I have locally so it looks like it works |
The mac CI is failing for it appears both cmdstan and rstan models. Using a mac locally I see no issues and there are no reported mac issues either here or upstream in rstan or brms suggesting a CI issue.
The text was updated successfully, but these errors were encountered: