-
-
Notifications
You must be signed in to change notification settings - Fork 195
Ternary Vectorisation Framework #2642
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
Ternary Vectorisation Framework #2642
Conversation
…4.1 (tags/RELEASE_600/final)
@t4c1 There's an odd failure of the expression tests here:
Any idea what this could be about? |
Ah sorry for the ping, figured it out |
Now I'm curious. I'm guessing the test uses more precision than the print. If that's the case, maybe we could change the way it prints by default so this isn't so confusing. |
Yep, there was a numerical difference because one of the captured scalars was falling out scope, but this wasn't shown by the print |
Jenkins Console Log Machine informationProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010CPU: G++: Clang: |
Closing for now to clear PR backlog, will re-open once ready for review |
@serban-nicusor-toptal There's an odd Git failure on the Jenkins run, any chance you've seen something like this before> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks great! Nice to see the expression updated with make_holder
.
One question I have just to know.
- How come we don't need a template for the binary in
eigen_plugins.h
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple Qs but overall good!
@SteveBronder this is ready for another look. I ended up adding |
@SteveBronder sorry to double-ping, but I'm hoping to introduce an arbitrary vectorisation framework once this is in. Any chance you'd have time for another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few small changes and Qs but overall looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asking for some clarification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@andrjohns, thanks! I'm glad we could pull out the additional Eigen plug-in! That simplifies the logic and the burden on developers is significantly lower. I think it'll be worth it in the long run. There's some additional tech debt added from this PR. It was merged with British spelling of "specialization." I'll put up a PR to address it. (Yes, choice of American vs British English as the default is arbitrary and wasn't really up for debate, but at this point it's better to be consistent rather than mixed.) |
Summary
This PR adds a framework for vectorising ternary functions, analogous to that of
apply_scalar_binary
. It is compatible with all scalar/container combinations, as well as arbitrarily nested containers.The
inc_beta
function has been vectorised as an example functionTests
Testing frameworks for both
prim
andmix
have been added to ensure that both values and gradients are correct when using the vectorisation frameworkSide Effects
N/A
Release notes
Added framework for vectorising ternary functions
Checklist
Math issue Vectorise ternary functions #2638
Copyright holder: Andrew Johnson
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
the basic tests are passing
./runTests.py test/unit
)make test-headers
)make test-math-dependencies
)make doxygen
)make cpplint
)the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested