-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Zombie fix attempts #1704
Zombie fix attempts #1704
Conversation
Edit: I don't get zombies on my ubuntu machine with the current master branch.
|
Using the github master I didn't get zombies with the minimal example, but after running at least 333 lines of brms_demo.R I get zombies when calling |
thanks! is any of the code executed in parallel? and where can I found the
brms_demo.R?
Aki Vehtari ***@***.***> schrieb am Mi., 13. Nov. 2024, 18:45:
… Using the github master I didn't get zombies with the minimal example, but
after running at least 333 lines of brms_demo.R I get zombies when calling
brms::log_lik() also with this PR
—
Reply to this email directly, view it on GitHub
<#1704 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADCW2AGQTDBBIX7OFQ6KSFD2AOF3DAVCNFSM6AAAAABRWYXL4SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZUGMZDCNJWGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
A new minimal example in the issue |
Thanks. Okay, here is my next try. It contains two changes. First, log_lik will no longer automatically use the library(brms)
options(brms.backend = "cmdstanr", mc.cores = 2)
m0 <- brms::brm(yield ~ 0, npk, refresh=0)
ll<-brms::log_lik(m0) # no zombies
m1 <- brms::brm(yield ~ 1, npk, refresh=0)
ll<-brms::log_lik(m1) # yes zombies will now almost surely not created zombies anymore simply because parallel execution of However, library(brms)
options(brms.backend = "cmdstanr", mc.cores = 2)
m0 <- brms::brm(yield ~ 0, npk, refresh=0, cores = 2)
ll<-brms::log_lik(m0) # no zombies
m1 <- brms::brm(yield ~ 1, npk, refresh=0, cores = 2)
ll<-brms::log_lik(m1) # yes zombies may still created zombies. In an attempt to "solve" this as well, I now force the user of PSOCK clusters in |
I confirm that with master and previous fix, @avehtari's new minimal example was producing zombies. |
Edit: Aside note, I accidentally passed the devtools::load_all()
options(brms.backend = "rstan")
m0 <- brms::brm(yield ~ 0, npk, refresh = 0)
ll<-brms::log_lik(m0) # no zombies
m1 <- brms::brm(yield ~ 1, npk, refresh = 0, mc.cores = 4, cores = 4) # here mc.cores is not an accepted arg
#> Error in x@mode :
#> no applicable method for `@` applied to an object of class "try-error"
#> In addition: Warning message:
#> In parallel::mclapply(1:chains, FUN = callFun, mc.preschedule = FALSE, :
#> 4 function calls resulted in an error |
you seem to be passing cores twice
Noa Kallioinen ***@***.***> schrieb am Do., 14. Nov. 2024,
08:15:
… Using cores argument seems to cause an error with the rstan backend
though:
devtools::load_all()
options(brms.backend = "rstan")
m0 <- brms::brm(yield ~ 0, npk, refresh = 0)ll<-brms::log_lik(m0) # no zombies
m1 <- brms::brm(yield ~ 1, npk, refresh = 0, mc.cores = 4, cores = 4)#> Error in ***@***.*** :#> no applicable method for `@` applied to an object of class "try-error"#> In addition: Warning message:#> In parallel::mclapply(1:chains, FUN = callFun, mc.preschedule = FALSE, :#> 4 function calls resulted in an error
—
Reply to this email directly, view it on GitHub
<#1704 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADCW2ABAHZBFMDKDCKXQ5FT2AREYDAVCNFSM6AAAAABRWYXL4SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZVGU4DMMJZGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
No more zombies (cmdstanr/rstan) with
I can also see 4 cores being used. Also brms_demo.R does not produce zombies, but I guess it is now using just one core for log_lik computations inside powerscaling |
Lovely, thank you both! I will clean up the PR and then merge :-) |
Merged now :-) |
In this PR, I will try several things to fix #1658. @avehtari or @n-kall I would be gratefull if you could check it out on your systems because I currently don't have access to Ubuntu.
List of things tried out in this PR so far:
plapply
code directly intolog_lik
(don't callplapply
itself anymore)