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

No CUDA when combining with_resources and with_parameters #30418

Closed
ju2ez opened this issue Nov 17, 2022 · 1 comment
Closed

No CUDA when combining with_resources and with_parameters #30418

ju2ez opened this issue Nov 17, 2022 · 1 comment
Labels
bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component)

Comments

@ju2ez
Copy link
Contributor

ju2ez commented Nov 17, 2022

What happened + What you expected to happen

When passing multiple objects to tune.with_parameters CUDA is not recognized anymore in the trainable process.

What I did:

The adding of a parameters next to the trainable in the with_parameters function leads to tune not detecting the GPU anymore.

Any thoughts?

Versions / Dependencies

Ray Version 2.1.0

Reproduction script

def trainable(cfg, test):
    print(torch.cuda.is_available())

tune.Tuner(tune.with_parameters(trainable=tune.with_resources(trainable, {"gpu:1"}), 
test={"1": 2} ))
tuner.fit()

Issue Severity

Medium: It is a significant difficulty but I can work around it.

@ju2ez ju2ez added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Nov 17, 2022
@justinvyu
Copy link
Contributor

This has been resolved by #29740 - this is an issue with nesting these wrappers, and a quick workaround for now is to switch the order: tune.with_resources(tune.with_parameters(...), ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component)
Projects
None yet
Development

No branches or pull requests

2 participants