-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add optims to detect when SoA matrices can be used #955
Add optims to detect when SoA matrices can be used #955
Conversation
…tions expressions of a UDF
test/integration/cli-args/stanc.t
Outdated
@@ -22,6 +22,7 @@ Show help | |||
--version Display stanc version number | |||
--name Take a string to set the model name (default = "$model_filename_model") | |||
--O Allow the compiler to apply all optimizations to the Stan code. | |||
-fno-soa Turn off the Struct of Arrays memory optimization. |
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.
We never really had a good plan for these stanc3 flags, so we are a bit all over the place with them.
I am not sure I have a better idea, but the -fno-X
seems like a C++ compiler flag or is this style also common in other areas?
@WardBrian already brought up the idea of enabling individual optimization flags. Do we maybe want to have the optimization levels but then a flag to disable individual optimizatons?
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.
We can also merge this without discussing this, there is plenty of time before the release.
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.
Yes so I think what we want to do is
- Merge update ad-level so it uses a circular flowgraph #1079 which has some of the code in the PR that fixes something in the monotone framework
- Merge [WIP] Optimization level interface #549 so we have an O1
- Merge this and turn it on at O1
Personally I'd prefer if we merged this immediately after the latest release. While I'm confident in it, I'd rather have a release cycle on dev just to make sure try to find any weird quirks
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.
Cool with that yeah, although if its hidden behind O1, its less of a problem.
The tests are now failing with:
|
Oh whoops yes lkj is not supported by the new matrix type yet |
@rybern alright I think this is good to go! I currently have things set to have this turned on by default at Does that work for you? |
I like the idea of this / #1029 to be on in O1, but make O1 the default after the next release. I think O0 staying as a 'do absolutely nothing' option is valuable |
That scheme sounds good to me @SteveBronder. +1 for @WardBrian's comment about keeping The last thing I want to double check on is https://github.com/stan-dev/stanc3/pull/955/files#r713252249, because that'd potentially give correctness issues |
Alrighty @rybern I just added the above tests, if everything compiles correctly on Jenkins then I'm going to remove soa from |
…d values in assignments
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.
We figured out https://github.com/stan-dev/stanc3/pull/955/files#r781792609 so LGTM!
D-O-N-E!!! |
Thanks all for sticking through this! The |
WHOW!!! Can I use it now? How?? I wanna test!! Seriously... is there a simple way to make a test drive with my favourite model? Just do -O1 as argument to the parser and that's it? I am really looking forward to this! |
Just O1 should do it! |
Ignore for now, I'm debugging a few things and will ping @rybern and @rok-cesnovar when this is ready for review / will fill out the top level comment describing the scheme and changes here.
Submission Checklist
Release notes
Allows
log_prob_impl
to use Struct of Arrays type for reverse mode autodiffCopyright 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)