-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Stan Math functions should not return Eigen expressions #1643
Comments
This is a parser related issue as it looks to me. I suggest to use the "Transfer issue" feature from GitHub to move this to stanc3 repo. You should be able to use the old parser again if you want with some flags. |
Adding |
Ok, so that would mean its not a stanc3 issue, but an issue with the Math signatures. I will try and pinpoint this today, as we will have to make a patch release anyways. |
How do I can confirm whether stanc2 or stanc3 is actually used? bin/stanc --version and hpp files just say 2.22.0 |
This one is on me. I overlooked this issue, when preparing #1471. I will prepare a fix soon. Meanwhile I think you can maybe work around this by assigning problematic expression to a variable, before using it (not tested). |
I was just testing stanc3 to catch problems before there's public announcement of new release. @t4c1 great that you know how to fix this! |
Sorry for blaming stanc3... is this a bigger problem? |
STANC2 should return 2.21.0 on bin/stanc --version. After adding STANC2=true to make/local you have to run
Not really, its a problem with the PR @t4c1 mentions, the move to general function signatures that accept Eigen expressions. Tadej explained to me that basically some functions still return Eigen expressions and because we still have some functions that dont accept them, that should not be used (and that is the fix he is working on). Once all functions are able to accept Eigen expression that will work and will be the preffered behavior. We didnt catch it before because we dont have test models that would test all Stan functions in this context (without intermediate variables). Once all functions will accept Eigen expressions this wont be a problem. And using eigen expression is what we are aiming for ( I think we discussed this somewhere, I think on Discourse). |
Yes, I had run |
Ok, will try to replicate that. You used the release cmdstan-2.22.0.tar.gz file + the 804 patch right? That is certainly something that should work and needs to be addressed immediately if it doesnt. |
I used cmdstan-2.22.0.tar.gz and manually removed that one extra paren. Two other things in the patch shouldn't have effect on this. |
This one is subtle and I think should be addressed in stanc3. The exisiting parser returns "stanc version 2.22.0" and stanc3 returns "stanc v2.22.0 (Unix)" I think the latter should say "stanc3 v2.22.0 (Unix)", will open a stanc3 issue. And thanks @avehtari ! |
I could also now see this difference. |
@andrjohns Just pinging you, so that you know about this. You also introduced one case of this in #1558. |
@t4c1 Ah my mistake, sorry about that. I'll open a PR to fix that tonight. |
@andrjohns No need, I already put it in PR I opened. I just want you to know, so it does not happen again. |
Summary:
Using cmdstan-2.22.0.tar.gz, fixed stan-dev/cmdstan#804 so that make build works.
EDIT: the same problem with the latest git commit e9075d0
EDIT: by @wds15 suggestion transferred tgo stanc3 repo
Using cmdstanr (but this is clearly an issue in cmdstan or stanc3)
One model compiles and runs successfully, but other one one fails the compilation.
Description:
This Stan model compiles and runs with previous cmdstan and 2.22.0
This model compiles and runs with the previous cmdstan, but doesn't compile with 2.22.0
The start of the (very long) error message:
A smaller example with the same (similar) error
With an error (just the beginning of a very long message)
Another even smaller example with slightly different error
With an error message (again just the beginning):
Current Version:
Linux t31300-lr010 4.15.0-74-generic stan-dev/cmdstan#83~16.04.1-Ubuntu SMP Wed Dec 18 04:56:23 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
The text was updated successfully, but these errors were encountered: