Skip to content
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

plan(multisession) errors with parallel_over = "everything" #888

Closed
rfsaldanha opened this issue Apr 10, 2024 · 4 comments · Fixed by #889
Closed

plan(multisession) errors with parallel_over = "everything" #888

rfsaldanha opened this issue Apr 10, 2024 · 4 comments · Fixed by #889
Labels
bug an unexpected problem or unintended behavior

Comments

@rfsaldanha
Copy link

When tuning with tune_race_anova with parallelism using future::plan(multisession), I get Error: object 'iteration' not found.

library(tidymodels)
library(finetune)
library(discrim)
#> 
#> Attaching package: 'discrim'
#> The following object is masked from 'package:dials':
#> 
#>     smoothness
library(future)

data(two_class_dat, package = "modeldata")

set.seed(1)
rs <- bootstraps(two_class_dat, times = 10)

rda_spec <-
  discrim_regularized(frac_common_cov = tune(), frac_identity = tune()) %>%
  set_engine("klaR")

grid <-
  rda_spec %>%
  extract_parameter_set_dials() %>%
  grid_max_entropy(size = 20)

ctrl <- control_race(verbose_elim = TRUE)

set.seed(4)

plan(multisession)

grid_anova <- 
  rda_spec %>% 
  tune_race_anova(Class ~ ., resamples = rs, grid = grid, control = ctrl)
#> ℹ Evaluating against the initial 3 burn-in resamples.
#> Error: object 'iteration' not found

Created on 2024-04-10 with reprex v2.1.0

With plan(sequential) I get no errors.

@simonpcouch
Copy link
Contributor

Thank you for the reprex—I can reproduce!

@simonpcouch simonpcouch added the bug an unexpected problem or unintended behavior label Apr 10, 2024
@simonpcouch

This comment was marked as outdated.

@simonpcouch
Copy link
Contributor

simonpcouch commented Apr 17, 2024

Ah, looks like parallel_over = "everything" is the real kicker here:

library(tidymodels)
library(future)

plan(multisession)

set.seed(1)
grid_res <- 
  tune_grid(
    logistic(engine = "glmnet", penalty = tune()), 
    Class ~ ., 
    resamples = bootstraps(two_class_dat, times = 10), 
    control = control_grid(parallel_over = "everything")
  )
#> Error: object 'iteration' not found

Created on 2024-04-17 with reprex v2.1.0

Since I can replicate with tune only, will go ahead and transfer there.

@simonpcouch simonpcouch transferred this issue from tidymodels/finetune Apr 17, 2024
@simonpcouch simonpcouch changed the title tune_race_anova returns an error with plan(multisession) plan(multisession) errors with parallel_over = "everything" Apr 17, 2024
Copy link

github-actions bot commented May 3, 2024

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators May 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants