0

我的机器上有 1 个 GPU 和 32 个 CPU。在 Ray 中是否可以单独使用它们?例如,一个任务分配有 1 个 CPU,而另一个任务分配有 1 个 GPU?如果我使用

    tune.run(trainer_fn, 
             num_samples=32,
             resources_per_trial={"GPU": 1, "CPU": 1},
             ...

这只运行一列火车,因为只有一个 GPU 可用。我知道我可以使用 0.1 GPU 之类的东西,它可以运行多列火车,但我无法知道哪个应该使用 CPU,哪个应该使用 GPU。

4

1 回答 1

0

The best way to do this is to use the Ray Tune experiment API and then tune.run_experiments: https://docs.ray.io/en/latest/tune/api_docs/execution.html#tune-run-experiments

于 2021-12-04T08:03:25.727 回答