Is
@ray.remote
def run_experiment(...):
(...)
if __name__ == '__main__':
ray.init()
exp_config = sys.argv[1]
params_tuples, num_cpus, num_gpus = load_exp_config(exp_config)
ray.get([run_experiment.options(num_cpus=num_cpus,
num_gpus=num_gpus).remote(*args) for args in params_tuples])
perfectly equivalent to :
@ray.remote(num_cpus=num_cpus, num_gpus=num_gpus)
def run_experiment(...):
(...)
if __name__ == '__main__':
ray.init()
exp_config = sys.argv[1]
params_tuples, _, _ = load_exp_config(exp_config)
ray.get([run_experiment.remote(*args) for args in params_tuples])
when it comes to ray resources configuration ? Just in case for context : this is run on a Slurm cluster node (typically to take advantage of large GPUs to run parallel "small" experiments on a single node).
.options()simply overrides what you gave in the decorator, so yes, using one or the other should do the same thing. Did you give it a try? What results did you get? Were there any errors or unexpected results?