paul-buerkner / brms

brms R package for Bayesian generalized multivariate non-linear multilevel models using Stan
https://paul-buerkner.github.io/brms/
GNU General Public License v2.0
1.28k stars 186 forks source link

Within-chain parallelization in Ubuntu (WSL) not working. #1613

Closed qymera0 closed 8 months ago

qymera0 commented 8 months ago

I have tried to fit a model with Within-chain parallelization using Ubuntu (through WSL) and am getting an error. The model normally works if I comment on the 'threads' argument. The model also works normally on Windows 10 (normally). Here is the model:

ccCicv <- brm( data = py$dfClean, family = student, cc ~ 1, prior = c( prior(normal(mean_y, sd_y * 5), class = Intercept), prior(cauchy(0, sd_y), class = sigma), prior(exponential(one_over_twentynine), class = nu) ), stanvars = ccVars, iter = 200000, warmup = 4000, chains = 4, cores = 4, seed = 123456, thin = 100,

control = list(adapt_delta = .90, max_treedepth = 15),

backend = "cmdstanr", 
threads = threading(6)

)

Here is the error:

Error: Syntax error found! See the message above for more information. 7. stop("Syntax error found! See the message above for more information.", call. = FALSE) 6. cmdstan_mod$format(canonicalize = list("deprecations", "braces", "parentheses"), overwrite_file = overwrite_file, backup = FALSE) 5. withVisible(...elt(i)) 4. utils::capture.output(cmdstan_mod$format(canonicalize = list("deprecations", "braces", "parentheses"), overwrite_file = overwrite_file, backup = FALSE)) 3. .canonicalize_stan_model(tmp_file, overwrite_file = FALSE) 2. .make_stancode(bterms, data = data, prior = prior, stanvars = stanvars, save_model = save_model, backend = backend, threads = threads, opencl = opencl, normalize = normalize) 1. brm(data = py$dfClean, family = student, cc ~ 1, prior = c(prior(normal(mean_y, sd_y * 5), class = Intercept), prior(cauchy(0, sd_y), class = sigma), prior(exponential(one_over_twentynine), class = nu)), stanvars = ccVars, iter = 200000, warmup = 4000, chains = 4, seed = 123456, ...

BRMS version: 2.20.4 CMDSTANR version: 0.7.1 rstan version: 2.32.6 stanheaders version: 2.32.6

What I just did:

paul-buerkner commented 8 months ago

this is unlikely a brms issue. I recommend you asking on Stan discourse

Samuel B Baco @.***> schrieb am Do., 7. März 2024, 17:35:

I have tried to fit a model with Within-chain parallelization using Ubuntu (through WSL) and am getting an error. The model normally works if I comment on the 'threads' argument. The model also works normally on Windows 10 (normally). Here is the model:

ccCicv <- brm( data = py$dfClean, family = student, cc ~ 1, prior = c( prior(normal(mean_y, sd_y * 5), class = Intercept), prior(cauchy(0, sd_y), class = sigma), prior(exponential(one_over_twentynine), class = nu) ), stanvars = ccVars, iter = 200000, warmup = 4000, chains = 4, cores = 4, seed = 123456, thin = 100,

control = list(adapt_delta = .90, max_treedepth = 15),

backend = "cmdstanr", threads = threading(6) )

Here is the error:

Error: Syntax error found! See the message above for more information. 7. stop("Syntax error found! See the message above for more information.", call. = FALSE) 6. cmdstan_mod$format(canonicalize = list("deprecations", "braces", "parentheses"), overwrite_file = overwrite_file, backup = FALSE) 5. withVisible(...elt(i)) 4. utils::capture.output(cmdstan_mod$format(canonicalize = list("deprecations", "braces", "parentheses"), overwrite_file = overwrite_file, backup = FALSE)) 3. .canonicalize_stan_model(tmp_file, overwrite_file = FALSE) 2. .make_stancode(bterms, data = data, prior = prior, stanvars = stanvars, save_model = save_model, backend = backend, threads = threads, opencl = opencl, normalize = normalize) 1. brm(data = py$dfClean, family = student, cc ~ 1, prior = c(prior(normal(mean_y, sd_y * 5), class = Intercept), prior(cauchy(0, sd_y), class = sigma), prior(exponential(one_over_twentynine), class = nu)), stanvars = ccVars, iter = 200000, warmup = 4000, chains = 4, seed = 123456, ...

BRMS version: 2.20.4 CMDSTANR version: 0.7.1 rstan version: 2.32.6 stanheaders version: 2.32.6

What I just did:

  • Updated the Linux;
  • Updated all packages from CRAN;
  • Installed RccpParallel from git-hub (current version: 5.1.7-9001);
  • Re-compiled the constant locally.

— Reply to this email directly, view it on GitHub https://github.com/paul-buerkner/brms/issues/1613, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADCW2AHEHOUEN5UGO2N64CTYXCJL7AVCNFSM6AAAAABELKRPEWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE3TIMRYGIZTMNY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

qymera0 commented 8 months ago

Tks Paul! I love your software and work! I will the stan question! You can close the issue!