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

Backporting Eigen code changes #2653

Open
andrjohns opened this issue Jan 12, 2022 · 4 comments
Open

Backporting Eigen code changes #2653

andrjohns opened this issue Jan 12, 2022 · 4 comments

Comments

@andrjohns
Copy link
Collaborator

Description

In order to fix the compile errors with multiplying/solving CWiseUnaryViews (which originally necessitated the val_op and adj_op member introductions), I've submitted patches to Eigen's code which are needed for fixing our implementations.

For reference, the Eigen PR is here: https://gitlab.com/libeigen/eigen/-/merge_requests/792
And a Math PR that shows tests passing with the code changes is here: #2604

However, I think we'll need to agree on a method on backporting these changes until they're in an Eigen release. While the simplest method would be to modify the Eigen headers included in the Math library directly, this would break compatibility with rstan, which links against Eigen headers in an external package.

To work around this, I'm proposing that we include the Eigen headers with necessary modifications in the Math library itself (I'm proposing creating a /prim/plugins folder). The existing header guards for these would prevent the source (unmodified) versions from being included when run via rstan.

I have a branch with this proposed structure and backported Eigen changes here: https://github.com/stan-dev/math/compare/develop...andrjohns:feature/backport-view-stride?expand=1

Thoughts?

Tagging @hsbadr, @bgoodri, and @SteveBronder given their involvement in the rstan and Eigen future states

Current Version:

v4.2.1

@bgoodri
Copy link
Contributor

bgoodri commented Jan 12, 2022 via email

@andrjohns
Copy link
Collaborator Author

Nice to know I'm on the right track! Any chance you could point me towards some of the rstan source where this has been implemented? That way I can make things as compatible as possible

@bgoodri
Copy link
Contributor

bgoodri commented Jan 12, 2022 via email

@andrjohns
Copy link
Collaborator Author

Perfect, thanks

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

No branches or pull requests

2 participants