numbbo / coco

Numerical Black-Box Optimization Benchmarking Framework
https://numbbo.github.io/coco
Other
254 stars 85 forks source link

[Feature request] Smoother parallelisation of experiments (needed for RL and recommendations) #2276

Closed CIGbalance closed 2 months ago

CIGbalance commented 2 months ago

This is based on a conversation I had with @olafmersmann in Leiden last week and I was tasked with writing an issue. Olaf, please correct me if I'm misrepresenting.

Currently, it is not possible to have two instances of the same function at the same time. You can parallelise experiments by running them in different processes and skipping some functions (the batches in the example). However:

A related feature is being able to grab a specific function instance without having to iterate through the whole suite, but Olaf said he is already working on that.

nikohansen commented 2 months ago

A related feature is being able to grab a specific function instance without having to iterate through the whole suite, but Olaf said he is already working on that.

Like this?

import cocoex

suite = cocoex.Suite('bbob', '', '')
fun = suite.get_problem_by_function_dimension_instance(1, 10, 2)
fun.id
'bbob_f001_i02_d10'
nikohansen commented 2 months ago

Currently, it is not possible to have two instances of the same function at the same time.

Maybe I misunderstand the request, but it seems possible to me:

import cocoex

suite = cocoex.Suite('bbob', '', '')
fun1 = suite.get_problem_by_function_dimension_instance(1, 10, 2)
fun2 = suite.get_problem_by_function_dimension_instance(1, 10, 2)
fun1 == fun2, fun1.id, fun2.id, 
(False, 'bbob_f001_i02_d10', 'bbob_f001_i02_d10')

If we wrap these functions with an Observer, it's ~probably a good idea~ necessary to create two observer instances with different output locations too.

CIGbalance commented 2 months ago

Huh, maybe my information was outdated then. This looks like it would solve my current issue at least. I'm not sure if Olaf was talking about something else or not, but I can at least try this out for my setup. Thanks :)

I think we can close for now?

nikohansen commented 2 months ago

I'm not sure if Olaf was talking about something else or not

Maybe it was related to getting a function instance in a dimension that is not available in the suite.