-
Notifications
You must be signed in to change notification settings - Fork 75
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
Target level resource overrides not honored with clustermq #635
Comments
Hi @nviets, It looks like the targets are actually inheriting the correct resources. library(targets)
library(tarchetypes)
resources_1 <- tar_resources(
clustermq = tar_resources_clustermq(template = list(n_cores = 2, memory = 500, job_name = 'hello'))
)
resources_2 <- tar_resources(
clustermq = tar_resources_clustermq(template = list(n_cores = 2, memory = 1000, job_name = 'world'))
)
tar_option_set(
resources = resources_1
)
ll <- list(
tar_target(
mem1,
memCheck()
),
tar_target(
mem2,
memCheck(),
resources = resources_2
)
)
ll[[1]]$settings$resources
#> $clustermq
#> <tar_resources_clustermq>
#> template: list(n_cores = 2, memory = 500, job_name = "hello")
ll[[2]]$settings$resources
#> $clustermq
#> <tar_resources_clustermq>
#> template: list(n_cores = 2, memory = 1000, job_name = "world") I think this is related to how I believe this is confirmed with the following code where Lines 99 to 108 in d972f61
|
Thanks for the quick response @mattwarkentin ! Looks like the issue is related to persistent workers with clustermq. Can workers be configured with different resources? E.g. a clustermq worker assigned to a GPU slurm queue and another assigned to a normal server. |
Hmm, that's a good question. I don't believe that is currently possible. In your SLURM template file you can control the Maybe we can page @mschubert to see if he has any insights into spinning up workers with different resources. |
For your interest, there were some lengthy discussions about building out Not sure what came of these discussions. But perhaps in the future if transient workers are supported then it might make sense to start thinking about target-specific compute resources. I don't think it makes sense under the current approach (i.e. persistent workers). |
We don't support heterogeneous workers in clustermq yet, unfortunately. It's on the roadmap (tracked here mschubert/clustermq#145), but I don't have an ETA. |
Thanks @mattwarkentin and @mschubert - the context is helpful! Is support for transient workers naturally something that falls within the clustermq package rather than targets? I am not familiar with the internal mechanics of targets when it farms out jobs to clustermq. Is there no way to make independent calls to clustermq with different worker configurations? As a user, it would seem the interface to support this already exists via tar_target(..., resources = configX) |
Targets supports several resource backends, I think In the future, if There is a computational cost to starting up/shutting down workers, starting |
Thanks for the discussion. Indeed, this is a limitation with the current |
In targets 0.7.0.9000, target level resource overrides inherit resource settings from the parent session options, instead of applying those defined in "resources" of tar_target.
Result:
The text was updated successfully, but these errors were encountered: