Ray Tune Search Space validation before trial execution

Is there a way to invalidate a search space that was generated by an optimizer before executing the trial?

Instead of determining if the hyperparameters suggested by the optimizer are valid or invalid after the trial has started execution, I would like to do this before the trial is ran. So, with an invalid search space as determined by some function, I would like the optimizer to keep suggesting new search spaces until a “valid” one is found as allowed by some validation function.

I think this would make my program execution much faster, so hopefully there’s some way to do this. I read about the conditional search spaces and looked at some of the examples too, but it wasn’t clear to me how to validate or invalidate the entire config through some function.

What I want to do (in the case where I do not reuse actors) is for a new process to not be created if the search space is invalid by my definition. In the case I do reuse actors, I think being able to do this search space invalidation would help my search be faster.

As a concrete example, let’s my search space consists of three parameters, “a”, “b”, and “c”, and each of those maps to a float. My (hypothetical and weird) validation function might be that the sum of these three parameter values must equal 10.00 and the value of parameter “c” must be an odd integer. I do not want to run any trials where this is not the case by invalidating the search space before spinning up a new trial or process.

Thanks for any help!