Replies: 3 comments 3 replies
-
Thanks for reporting this. library(future)
library(furrr)
plan(sequential)
future_map_dfr(
.x = seq_len(2L),
.f = function(seed) {
set.seed(seed)
tibble::tibble(user_seed = seed, rng_state = digest::digest(.Random.seed))
},
.options = furrr::furrr_options(seed = NULL)
)
#> # A tibble: 2 × 2
#> user_seed rng_state
#> <int> <chr>
#> 1 1 f659f2cdd57f16488358b216b60e824a
#> 2 2 f659f2cdd57f16488358b216b60e824a Even stranger, the problem goes away when I run this example inside |
Beta Was this translation helpful? Give feedback.
-
In 0a112b5, I switched from |
Beta Was this translation helpful? Give feedback.
-
@wlandau, does this mean that we should avoid using furrr to parallelize within a target? |
Beta Was this translation helpful? Give feedback.
-
Help
Description
In the following reproducible example I use
tar_map_rep()
to simulate many data sets (usingrnorm()
) for several combination of scenarios. When I don't userep_workers
I get the expected result: each data set (uniquely defined bytar_group
,tar_batch
andtar_rep
) has different random variables.However when I use the
rep_workers
intar_map_rep()
some replicated data sets contain the same random vectors (even though the seed seems to be different).Is this the expected behavior of
rep_workers
?This issue was hard to debug because even when I removed the
rep_workers
argument fromtar_map_rep()
, the pipeline was skipping the target since it was using the samebatches * reps
. It was only until I looked at the data that I found the problem.Beta Was this translation helpful? Give feedback.
All reactions