1

I'm using the skopt (scikit-optimize) package, using the ask-tell syntax. I'm using python 3.7, on a windows machine The ask function call takes a long time (first call ~1 minute, then increases 1 minute for each iteration, so ultimately as much as 20 minutes). Is there a way to parallelize this call (not the cost function evaluation, which I've already parallelized, but the ask function)? I have a 40 core machine, and also a good GPU, could use either.

thanks Mark

Reply to Jerome: Thanks for taking a look, sorry it wasn't clear. I realize that CPU code cannot be run on a GPU, but if there is a method to do either, that would be an option. I'm doing a pretty straightforward optimization (currently using GP, but would also like to use RF and GBRF). I'm using the ask-tell syntax. Basic code is:

    from skopt import Optimizer
    opt = Optimizer(20,n_jobs = 5, base_estimator='GP')
    # the ask step below is what I'd like to parallelize, 
    # if possible, I tried setting n_jobs above, didn't help
    suggested = opt.ask(n_points = 20)
    # calculate fitness - this part is parallelized, works nicely
    fitnesses = calc_fitness(suggested)
    # the tell step is fast, no need to parallelize
    res = opt.tell( suggested, fitnesses)

Any suggestions would be appreciated. thanks

Mark Sale
  • 65
  • 5
  • The question is very unclear to me. It seems you try to parallelize a code already parallelized. Besides this GPU are not like CPU. You cannot run a CPU code on the GPU. GPU are based on a completely different programming model that often required completely different algorithms although high-level libraries try to hide this (but this does not fully solve the problem). Additionally, parallelism adds overheads and thus it is not always a good idea to use it but this is impossible to know if this is a good idea here due to the lack of informations. Please provide a minimal working example. – Jérôme Richard Feb 26 '22 at 10:49
  • original post revised/expanded with example code. It is the ask function that I want to parallelize, not the calculation of the reward/fitness - that is already done. Thanks – Mark Sale Feb 26 '22 at 20:04

0 Answers0