Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature/eigen-34-m…
Browse files Browse the repository at this point in the history
…ulti-index
  • Loading branch information
SteveBronder committed Apr 22, 2024
2 parents cc1cf33 + 58ab01b commit 8c3451e
Show file tree
Hide file tree
Showing 112 changed files with 2,533 additions and 2,999 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Describe what you expect the output to be. Knowing the correct behavior is also
Provide any additional information here.

#### Current Version:
v2.34.0
v2.34.1
56 changes: 27 additions & 29 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pipeline {
preserveStashes(buildCount: 7)
parallelsAlwaysFailFast()
buildDiscarder(logRotator(numToKeepStr: '20', daysToKeepStr: '30'))
disableConcurrentBuilds(abortPrevious: env.BRANCH_NAME != "downstream_tests" || env.BRANCH_NAME != "downstream_hotfix")
disableConcurrentBuilds(abortPrevious: env.BRANCH_NAME != "downstream_tests" && env.BRANCH_NAME != "downstream_hotfix")
}
environment {
GCC = 'g++'
Expand Down Expand Up @@ -192,19 +192,17 @@ pipeline {
}
post {
always {

recordIssues id: "lint_doc_checks",
name: "Linting & Doc checks",
enabledForFailure: true,
aggregatingResults : true,
tools: [
cppLint(id: "cpplint", name: "Linting & Doc checks@CPPLINT")
],
blameDisabled: false,
qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]],
healthy: 10, unhealthy: 100, minimumSeverity: 'HIGH',
referenceJobName: env.BRANCH_NAME

recordIssues(
id: "lint_doc_checks",
name: "Linting & Doc checks",
enabledForFailure: true,
aggregatingResults : true,
tools: [
cppLint(id: "cpplint", name: "Linting & Doc checks@CPPLINT")
],
qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]],
healthy: 10, unhealthy: 100, minimumSeverity: 'HIGH'
)
deleteDir()
}
}
Expand Down Expand Up @@ -498,21 +496,21 @@ pipeline {
post {
always {
node("linux") {
recordIssues id: "pipeline",
name: "Entire pipeline results",
enabledForFailure: true,
aggregatingResults : false,
filters: [
excludeFile('lib/.*')
],
tools: [
gcc4(id: "pipeline_gcc4", name: "GNU C Compiler"),
clang(id: "pipeline_clang", name: "LLVM/Clang")
],
blameDisabled: false,
qualityGates: [[threshold: 30, type: 'TOTAL', unstable: true]],
healthy: 10, unhealthy: 100, minimumSeverity: 'HIGH',
referenceJobName: env.BRANCH_NAME
recordIssues(
id: "pipeline",
name: "Entire pipeline results",
enabledForFailure: true,
aggregatingResults : false,
filters: [
excludeFile('lib/.*')
],
tools: [
gcc4(id: "pipeline_gcc4", name: "GNU C Compiler"),
clang(id: "pipeline_clang", name: "LLVM/Clang")
],
qualityGates: [[threshold: 30, type: 'TOTAL', unstable: true]],
healthy: 10, unhealthy: 100, minimumSeverity: 'HIGH'
)
}
}
success {
Expand Down
6 changes: 6 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Note: these are the release notes for the stan-dev/stan repository.
Further changes may arise at the interface level (stan-dev/{rstan,
pystan, cmdstan}) and math library level (stan-dev/math).

v2.34.1 (23 January 2024)
======================================================================

- Fixed a Windows-specific issue with std::regex in JSON file validation (#3251)
- Added a missing include of `cstdint` (#3255)

v2.34.0 (16 January 2024)
======================================================================

Expand Down
2 changes: 1 addition & 1 deletion lib/stan_math
Submodule stan_math updated 21501 files
2 changes: 1 addition & 1 deletion src/doxygen/doxygen.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "Stan"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 2.34.0
PROJECT_NUMBER = 2.34.1

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
4 changes: 1 addition & 3 deletions src/stan/mcmc/chains.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#include <boost/accumulators/statistics/variance.hpp>
#include <boost/accumulators/statistics/covariance.hpp>
#include <boost/accumulators/statistics/variates/covariate.hpp>
#include <boost/random/uniform_int_distribution.hpp>
#include <boost/random/additive_combine.hpp>
#include <algorithm>
#include <cmath>
#include <iostream>
Expand Down Expand Up @@ -44,7 +42,7 @@ using Eigen::Dynamic;
*
* <p><b>Storage Order</b>: Storage is column/last-index major.
*/
template <class RNG = boost::random::ecuyer1988>
template <typename Unused = void*>
class chains {
private:
std::vector<std::string> param_names_;
Expand Down
4 changes: 2 additions & 2 deletions src/stan/mcmc/hmc/hamiltonians/base_hamiltonian.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class base_hamiltonian {
void update_potential(Point& z, callbacks::logger& logger) {
try {
z.V = -stan::model::log_prob_propto<true>(model_, z.q);
} catch (const std::exception& e) {
} catch (const std::domain_error& e) {
this->write_error_msg_(e, logger);
z.V = std::numeric_limits<double>::infinity();
}
Expand All @@ -62,7 +62,7 @@ class base_hamiltonian {
try {
stan::model::gradient(model_, z.q, z.V, z.g, logger);
z.V = -z.V;
} catch (const std::exception& e) {
} catch (const std::domain_error& e) {
this->write_error_msg_(e, logger);
z.V = std::numeric_limits<double>::infinity();
}
Expand Down
8 changes: 3 additions & 5 deletions src/stan/model/model_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <stan/math/mix.hpp>
#endif
#include <stan/model/prob_grad.hpp>
#include <boost/random/additive_combine.hpp>
#include <stan/services/util/create_rng.hpp>
#include <ostream>
#include <string>
#include <utility>
Expand Down Expand Up @@ -367,8 +367,7 @@ class model_base : public prob_grad {
* in output
* @param[in,out] msgs msgs stream to which messages are written
*/
virtual void write_array(boost::ecuyer1988& base_rng,
Eigen::VectorXd& params_r,
virtual void write_array(stan::rng_t& base_rng, Eigen::VectorXd& params_r,
Eigen::VectorXd& params_constrained_r,
bool include_tparams = true, bool include_gqs = true,
std::ostream* msgs = 0) const = 0;
Expand Down Expand Up @@ -618,8 +617,7 @@ class model_base : public prob_grad {
* in output
* @param[in,out] msgs msgs stream to which messages are written
*/
virtual void write_array(boost::ecuyer1988& base_rng,
std::vector<double>& params_r,
virtual void write_array(stan::rng_t& base_rng, std::vector<double>& params_r,
std::vector<int>& params_i,
std::vector<double>& params_r_constrained,
bool include_tparams = true, bool include_gqs = true,
Expand Down
4 changes: 2 additions & 2 deletions src/stan/model/model_base_crtp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class model_base_crtp : public stan::model::model_base {
msgs);
}

void write_array(boost::ecuyer1988& rng, Eigen::VectorXd& theta,
void write_array(stan::rng_t& rng, Eigen::VectorXd& theta,
Eigen::VectorXd& vars, bool include_tparams = true,
bool include_gqs = true,
std::ostream* msgs = 0) const override {
Expand Down Expand Up @@ -202,7 +202,7 @@ class model_base_crtp : public stan::model::model_base {
theta, theta_i, msgs);
}

void write_array(boost::ecuyer1988& rng, std::vector<double>& theta,
void write_array(stan::rng_t& rng, std::vector<double>& theta,
std::vector<int>& theta_i, std::vector<double>& vars,
bool include_tparams = true, bool include_gqs = true,
std::ostream* msgs = 0) const override {
Expand Down
3 changes: 0 additions & 3 deletions src/stan/model/model_header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
#include <stan/model/indexing.hpp>
#include <stan/services/util/create_rng.hpp>

#include <boost/random/additive_combine.hpp>
#include <boost/random/linear_congruential.hpp>

#include <cmath>
#include <cstddef>
#include <fstream>
Expand Down
4 changes: 2 additions & 2 deletions src/stan/optimization/bfgs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ class ModelAdaptor {

try {
f = -log_prob_propto<jacobian>(_model, _x, _params_i, _msgs);
} catch (const std::exception &e) {
} catch (const std::domain_error &e) {
if (_msgs)
(*_msgs) << e.what() << std::endl;
return 1;
Expand Down Expand Up @@ -341,7 +341,7 @@ class ModelAdaptor {

try {
f = -log_prob_grad<true, jacobian>(_model, _x, _params_i, _g, _msgs);
} catch (const std::exception &e) {
} catch (const std::domain_error &e) {
if (_msgs)
(*_msgs) << e.what() << std::endl;
return 1;
Expand Down
2 changes: 1 addition & 1 deletion src/stan/optimization/newton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ double newton_step(M& model, std::vector<double>& params_r,
try {
f1 = stan::model::log_prob_grad<true, jacobian>(model, new_params_r,
params_i, gradient);
} catch (std::exception& e) {
} catch (std::domain_error& e) {
// FIXME: this is not a good way to handle a general exception
f1 = -1e100;
}
Expand Down
2 changes: 1 addition & 1 deletion src/stan/services/diagnose/diagnose.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int diagnose(Model& model, const stan::io::var_context& init,
double epsilon, double error, callbacks::interrupt& interrupt,
callbacks::logger& logger, callbacks::writer& init_writer,
callbacks::writer& parameter_writer) {
boost::ecuyer1988 rng = util::create_rng(random_seed, chain);
stan::rng_t rng = util::create_rng(random_seed, chain);

std::vector<int> disc_vector;
std::vector<double> cont_vector = util::initialize(
Expand Down
14 changes: 9 additions & 5 deletions src/stan/services/experimental/advi/fullrank.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <stan/services/error_codes.hpp>
#include <stan/io/var_context.hpp>
#include <stan/variational/advi.hpp>
#include <boost/random/additive_combine.hpp>
#include <string>
#include <vector>

Expand Down Expand Up @@ -60,7 +59,7 @@ int fullrank(Model& model, const stan::io::var_context& init,
callbacks::writer& diagnostic_writer) {
util::experimental_message(logger);

boost::ecuyer1988 rng = util::create_rng(random_seed, chain);
stan::rng_t rng = util::create_rng(random_seed, chain);

std::vector<int> disc_vector;
std::vector<double> cont_vector;
Expand All @@ -84,11 +83,16 @@ int fullrank(Model& model, const stan::io::var_context& init,
= Eigen::Map<Eigen::VectorXd>(&cont_vector[0], cont_vector.size(), 1);

stan::variational::advi<Model, stan::variational::normal_fullrank,
boost::ecuyer1988>
stan::rng_t>
cmd_advi(model, cont_params, rng, grad_samples, elbo_samples, eval_elbo,
output_samples);
cmd_advi.run(eta, adapt_engaged, adapt_iterations, tol_rel_obj,
max_iterations, logger, parameter_writer, diagnostic_writer);
try {
cmd_advi.run(eta, adapt_engaged, adapt_iterations, tol_rel_obj,
max_iterations, logger, parameter_writer, diagnostic_writer);
} catch (const std::exception& e) {
logger.error(e.what());
return error_codes::SOFTWARE;
}

return stan::services::error_codes::OK;
}
Expand Down
14 changes: 9 additions & 5 deletions src/stan/services/experimental/advi/meanfield.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <stan/services/error_codes.hpp>
#include <stan/io/var_context.hpp>
#include <stan/variational/advi.hpp>
#include <boost/random/additive_combine.hpp>
#include <string>
#include <vector>

Expand Down Expand Up @@ -60,7 +59,7 @@ int meanfield(Model& model, const stan::io::var_context& init,
callbacks::writer& diagnostic_writer) {
util::experimental_message(logger);

boost::ecuyer1988 rng = util::create_rng(random_seed, chain);
stan::rng_t rng = util::create_rng(random_seed, chain);

std::vector<int> disc_vector;
std::vector<double> cont_vector;
Expand All @@ -83,11 +82,16 @@ int meanfield(Model& model, const stan::io::var_context& init,
= Eigen::Map<Eigen::VectorXd>(&cont_vector[0], cont_vector.size(), 1);

stan::variational::advi<Model, stan::variational::normal_meanfield,
boost::ecuyer1988>
stan::rng_t>
cmd_advi(model, cont_params, rng, grad_samples, elbo_samples, eval_elbo,
output_samples);
cmd_advi.run(eta, adapt_engaged, adapt_iterations, tol_rel_obj,
max_iterations, logger, parameter_writer, diagnostic_writer);
try {
cmd_advi.run(eta, adapt_engaged, adapt_iterations, tol_rel_obj,
max_iterations, logger, parameter_writer, diagnostic_writer);
} catch (const std::exception& e) {
logger.error(e.what());
return error_codes::SOFTWARE;
}

return stan::services::error_codes::OK;
}
Expand Down
Loading

0 comments on commit 8c3451e

Please sign in to comment.