jansel / opentuner

An extensible framework for program autotuning
http://opentuner.org/
MIT License
382 stars 112 forks source link

Question to define the parameters with relationships #157

Closed leslie-fang-intel closed 2 years ago

leslie-fang-intel commented 2 years ago

Hi @jansel, I have a question to define parameters for my tuning case. I have 3 parameters to tune:

Could you kindly help to take a look how can I define these parameters in openTuner to tune?

jansel commented 2 years ago

There are a few options. One way would be to override Parameter.normalize() to map invalid configs to the "closest" valid config. Or implement a custom Parameter subclass to encode your constraints.

Another option, that might be easier, would be to rewrite your search space in a way where all points are valid. For your example, you could reframe your problem in terms of more primitive parameters:

p1 = a
p2 = a * b
p3 = floor(c*(p2//p1))

a would be the same enum. b would be an integer. c would be a float from 0 to 1.

This mapping encodes your constraints as a projection in configuration space.

leslie-fang-intel commented 2 years ago

Thanks for the reply, I will take a try.