Intialization with the current ADVI (develop branch) seems to be difficult at times. I have a model with a Cholesky-factor correlation matrix, and while NUTS sometimes complains at the beginning, it samples eventually fine. The LBFGS optimiser similarly reports a few non-finite gradient at first, then starts to iterate.
With this model, the mean field ADVI seems to evaluate ELBO to nan quite often, then eventually crashes with
"Exception: stan::variational::normal_meanfield::set_mu: Input vector[1] is nan, but must not be nan!"
This is with init=0, which works better than random initialisation. Playing with ADVI parameters (number of gradient samples, eta) does not help much. More diagonal LKJ prior maybe helps a bit.
Gradient seems to be fine when I look at it with "diagnose init=0". At least there are no infinities or eye-popping differences between the gradient and the finite approximation. Some gradient components are zero, for missing value "parameters" of the model. (They are not zero with init=1.)
With init=2, ADVI constantly fails without reporting any iteration steps (even when eval_elbo=1).
I don't know what happens at the initialisation phase in general, but ADVI code does not seem to have any retries or checks for failed gradients? (I only took a quick look at the advi.hpp file, so could be wrong.)
(This is not critical for me in any way, just wanted to share the observation in case it helps with development.)