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

Disable inlining for transformed data #1218

Merged
merged 3 commits into from
Jun 23, 2022
Merged

Conversation

WardBrian
Copy link
Member

This is related to #1097. The 0-size objects created by the function inliner fail in transformed data at runtime. The error looks like:

 stan/lib/stan_math/lib/eigen_3.3.9/Eigen/src/Core/DenseBase.h:256: void Eigen::DenseBase<Derived>::resize(Eigen::Index, Eigen::Index) [with Derived = Eigen::Map<Eigen::Matrix<double, -1, -1> >; Eigen::Index = long int]: Assertion `rows == this->rows() && cols == this->cols() && "DenseBase::resize() does not actually allow to resize."' failed.
Aborted (core dumped)

For now this PR simply disables the function inliner in the prepare_data section. @SteveBronder might have a more clever fix, but this is low priority since optimizing transformed data is less useful than most of the rest of the model which gets called repeatedly.

I added a test test/integration/good/compiler-optimizations/inline-tdata.stan, but since the failure is at runtime we should really put this in something used by performance-tests-cmdstan (@rok-cesnovar). I've confirmed locally that the model fails against master but works after this PR.

Submission Checklist

  • Run unit tests
  • Documentation
    • OR, no user-facing changes were made

Release notes

Function in-lining fails at runtime in transformed data and has been disabled in that block for now.

Copyright and Licensing

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)

@WardBrian WardBrian added bug Something isn't working optimization labels Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working optimization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants