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
Feature/2431 lang tuples step1 #2498
Conversation
any idea why this would fail and not be picked up?
https://travis-ci.org/stan-dev/stan/jobs/405140359#L670
Either way, we're probably touching on a compiler bug. Meaning we'll need
to be able to run that exact compiler in order to hunt this one down.
…On Wed, Jul 18, 2018 at 9:20 AM Mitzi Morris ***@***.***> wrote:
works fine on my machine, and works on travis except for 2 compilers
https://travis-ci.org/stan-dev/stan/builds/405140355?utm_source=github_status&utm_medium=notification
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2498 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAZ_F8k1-HVCxaiC_e7QpkrHahRMAZBDks5uHzUKgaJpZM4S6eCd>
.
|
I take it back. I just started clean from your branch and I see a failure:
$ ./runTests.py
src/test/unit/variational/advi_multivar_no_constraint_test.cpp
... (lots of compilation herre)
------------------------------------------------------------
test/unit/variational/advi_multivar_no_constraint
--gtest_output="xml:test/unit/variational/advi_multivar_no_constraint.xml"
Running main() from gtest_main.cc
[==========] Running 2 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 2 tests from advi_test
[ RUN ] advi_test.multivar_no_constraint_fullrank
unknown file: Failure
C++ exception with description "Exception: vector[uni] assign range:
accessing element out of range. index 1 out of range; expecting index to be
between 1 and 0 (in
'src/test/test-models/good/variational/multivariate_no_constraint.stan' at
line 6)
" thrown in the test body.
[ FAILED ] advi_test.multivar_no_constraint_fullrank (0 ms)
[ RUN ] advi_test.multivar_no_constraint_meanfield
unknown file: Failure
C++ exception with description "Exception: vector[uni] assign range:
accessing element out of range. index 1 out of range; expecting index to be
between 1 and 0 (in
'src/test/test-models/good/variational/multivariate_no_constraint.stan' at
line 6)
" thrown in the test body.
[ FAILED ] advi_test.multivar_no_constraint_meanfield (0 ms)
[----------] 2 tests from advi_test (0 ms total)
[----------] Global test environment tear-down
[==========] 2 tests from 1 test case ran. (0 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 2 tests, listed below:
[ FAILED ] advi_test.multivar_no_constraint_fullrank
[ FAILED ] advi_test.multivar_no_constraint_meanfield
2 FAILED TESTS
test/unit/variational/advi_multivar_no_constraint
--gtest_output="xml:test/unit/variational/advi_multivar_no_constraint.xml"
failed
exit now (07/18/18 09:32:55 EDT)
…On Wed, Jul 18, 2018 at 9:23 AM Daniel Lee ***@***.***> wrote:
any idea why this would fail and not be picked up?
https://travis-ci.org/stan-dev/stan/jobs/405140359#L670
Either way, we're probably touching on a compiler bug. Meaning we'll need
to be able to run that exact compiler in order to hunt this one down.
On Wed, Jul 18, 2018 at 9:20 AM Mitzi Morris ***@***.***>
wrote:
> works fine on my machine, and works on travis except for 2 compilers
>
>
> https://travis-ci.org/stan-dev/stan/builds/405140355?utm_source=github_status&utm_medium=notification
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#2498 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AAZ_F8k1-HVCxaiC_e7QpkrHahRMAZBDks5uHzUKgaJpZM4S6eCd>
> .
>
|
that could be a missing dependency in the make/tests makefile - I'll check. |
It's a red herring.
The model in the advi test is failing to run. I think it's a bug. Look at
this Stan
program: src/test/test-models/good/variational/multivariate_no_constraint.stan
If you copy that into CmdStan with this branch, it doesn't run.
$ ./multivariate_no_constraint sample
method = sample (Default)
sample
num_samples = 1000 (Default)
num_warmup = 1000 (Default)
save_warmup = 0 (Default)
thin = 1 (Default)
adapt
engaged = 1 (Default)
gamma = 0.050000000000000003 (Default)
delta = 0.80000000000000004 (Default)
kappa = 0.75 (Default)
t0 = 10 (Default)
init_buffer = 75 (Default)
term_buffer = 50 (Default)
window = 25 (Default)
algorithm = hmc (Default)
hmc
engine = nuts (Default)
nuts
max_depth = 10 (Default)
metric = diag_e (Default)
metric_file = (Default)
stepsize = 1 (Default)
stepsize_jitter = 0 (Default)
id = 0 (Default)
data
file = (Default)
init = 2 (Default)
random
seed = 3033418282
output
file = output.csv (Default)
diagnostic_file = (Default)
refresh = 100 (Default)
Exception: vector[uni] assign range: accessing element out of range. index
1 out of range; expecting index to be between 1 and 0 (in
'multivariate_no_constraint.stan' at line 6)
…On Wed, Jul 18, 2018 at 9:42 AM Mitzi Morris ***@***.***> wrote:
src/test/unit/services/util/generate_transitions_test.cpp:7:10: fatal
error: 'test/test-models/good/optimization/rosenbrock.hpp' file not found
that could be a missing dependency in the make/tests makefile - I'll check.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2498 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAZ_FzTw96g6IQy2K83Pl21Fn9dyvt3pks5uHzsWgaJpZM4S6eCd>
.
|
right - that is the error. but regarding the other, it does seem that file
|
well... the big issue is that this is actually a problem and it can be
reproduced using the Apple XCode clang++. Is that enough info to track it
down?
…On Wed, Jul 18, 2018 at 9:48 AM Mitzi Morris ***@***.***> wrote:
right - that is the error.
but regarding the other, it does seem that file make/tests needs a fix as
well -
src/test/unit/services/util/generate_transitions_test.cpp:
src/test/test-models/good/services/test_lp.hpp
src/test/test-models/good/optimization/rosenbrock.hpp
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2498 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAZ_F3PTm_dZrYoDtsn0QoDN4N_wewM_ks5uHzySgaJpZM4S6eCd>
.
|
thanks @syclik - that's a legit error - investigating |
…re/2431-lang-tuples-step1
Hey, this broke existing models and literally doesn't return all of the parameters for the SIR model. I thought this was a Math issue first, see stan-dev/math#972 Should we revert while this undergoes more testing? |
yes, absolutely. |
@seantalts which models besides SIR model are problematic? |
Where are the tests that uncovered this?
|
I don't know the full extent of models that have issues because my test program is currently stopping at the first error like this it encounters (I'm trying to fix that but I'm tied up all day with Rok and Erik). The tests run here: http://d1m1s1b1.stat.columbia.edu:8080/blue/organizations/jenkins/CmdStan%20Performance%20Tests/detail/master/214/pipeline/ The repo (with instructions) is here: https://github.com/stan-dev/performance-tests-cmdstan |
there's an error with the indexing logic - for the SIR model, list of parameters looks like:
where it should be
the underlying problem is that we need more tests on generator - the Stan test suite currently doesn't do much end-to-end testing, other than tests for advi. |
Nice find. Just to copy slightly relevant info from the other thread: |
I've made a lot of mistakes in doing this PR. I should have had the discipline to leave the generated .hpp code exactly as is and not change the output to be more readable and save that for a second PR. mea culpa. As a way forward, I'm writing a test plan. The specific bug that the benchmarks test uncovered is that the new generator code is getting mixed up on the order of array indexes. This isn't surprising - the whole point of this PR is to refactor the way that dimensions on container types are represented in the AST. Here is what I have so far w/r/t a test plan for current bug: Multi-dimensional block-level variables in Stan programs. Block variables can have constraints/specialized types; Example: Verify that refactor contains tests for all AST variable decl nodes and type:
Multi-dimensional local variables in Stan programs. Local variables are declared with sizes.
Verify that refactor contains tests for all AST variable decl nodes and type:
Multi-dimensional bare variables in Stan programs Bare type array variables are declared with number of dimensions.
Program 1: data block only, single variable decl:
Parser tests: AST for entire program as expected Generator tests: check .hpp file for:
program end-to-end test:
Program 2: transformed data block only, single variable decl:
check .hpp file for:
program end-to-end test:
Programs 3,4,5 : parameters / transformed parameters /generated quantities block only:
check .hpp file for:
program end-to-end test:
is there a GitHub way to add test plans to PRs? |
filed issue #2604 - fixing on branch bugfix/2406-generator-multidim-params |
Submission Checklist
./runTests.py src/test/unit
make cpplint
Summary
Refactor of stan/lang AST needed in order to extend Stan language to tuples. See issue #2431 for details.
Intended Effect
Everything should work exactly as before.
How to Verify
Run all unit tests.
Side Effects
Changes to the AST nodes required changes to the generator code. Previously the AST contained a set of variant types for variable declarations, with the result that the generator code required many vistor classes to generate the series of c++ statements which correspond to a single Stan language variable declaration or compound declaration-definition. In rewriting the generator methods, I changed the generated code itself in order to remove duplicate checks on container sizes and improve overall readability. Significant changes to the generated code:
Previously first all variable dimensions were validated, then variables were initialized. Now validation is followed directly by initialization, which means that some failing programs may fail differently.
Double literal variables now store the actual string value from the program. Previously, generated c++ code used the stored double value, e.g. double literal "5.1" would be initialized to not exactly 5.1, depending on the compiler. Now the string value "5.1" is generated.
spaces after commas in args, to improve readibility.
Documentation
N/A.
Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Columbia University
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses: