-
Notifications
You must be signed in to change notification settings - Fork 12
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
Bridgestan failure with Hessian AD enabled #237
Comments
I can reproduce the failure by compiling a cmdstan model with |
stan-dev/math#2535 seems related |
It appears this was an include-order issue in stan-dev/stan |
Thanks, @WardBrian for the diagnosis and the fix! In the meantime, is there a workaround? e.g. if I replace |
It’s hard to say what other functions would be affected - luckily, they would all manifest in compiler errors, so if they compile you can assume it didn’t run into this problem. If you run into others, a valid workaround for now is probably just applying the patch I submitted to Stan to your local bridgestan copy - it’s only a few lines changed |
Hi @WardBrian, I hit a perhaps unrelated issue that only shows up when compiling for Hessian AD if the target is incremented by a constant in the
data {
int<lower=1> N;
}
parameters {
vector[N] y;
}
model {
target += 0;
} Running the same command as in #237 (comment) we get the error:
If it's incremented by a non-constant in an functions {
vector foo_lp(vector y) {
target += sum(y);
return y;
}
}
data {
int<lower=1> N;
}
parameters {
vector[N] y;
}
transformed parameters {
vector[N] x = foo_lp(y);
}
model {
target += 1;
} This probably also is not a bridgestan issue, but I'm not sure where to report it. |
This is odd -- can you check in the bridgestan folder if |
Yes, it's there. If I just increment by Weirdly, I deleted |
Since stanc is downloaded from github on first use, maybe something was rate-limiting/blocking you, or perhaps github's servers hiccuped? |
Perhaps, though it still seems to be an issue. Is there a way to manually trigger the download of stanc other than compiling a dummy model? I'm wondering if there's somehow an issue with doing this while running pytest. |
|
I'm not certain if this is an issue with bridgestan or coming from somewhere else in the toolchain, but if I install gxx from conda-forge, install bridgestan from pypi, and then compile a model requesting
BRIDGESTAN_AD_HESSIAN=true
, then it errors if I have an expression liketarget += y
for a vectory
. It doesn't fail if I usetarget += sum(y)
, and it also doesn't fail if I don't setBRIDGESTAN_AD_HESSIAN=true
.Here's a reproducible example:
test.stan
:Script:
Error:
The text was updated successfully, but these errors were encountered: