jansel / opentuner

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

Search algorithm setting #153

Closed ningmengwei-ata closed 2 years ago

ningmengwei-ata commented 2 years ago

Can I ask how to set the specific search algorithm when I'm using opentuner to optimize a C program? Thanks!

jansel commented 2 years ago

--technique=... on the command line. See also --list-techniques and opentuner.search.technique.register()

https://github.com/jansel/opentuner/blob/master/opentuner/search/technique.py#L26

ningmengwei-ata commented 2 years ago

Thanks very much! Can I ask how to implement grid search in this opentuner, how to traverse the parameters? I have understood the way to use a search technique but I don't know how to implement the grid search in opentuner.

jansel commented 2 years ago

Grid search is rather similar to PatternSearch found here: https://github.com/jansel/opentuner/blob/master/opentuner/search/patternsearch.py -- so you could use that as a starting point for adding grid search.

Once you implement a new technique call opentuner.search.technique.register(YourSearchAlgoritm(name="foo")) to register it then pass --technique=foo to use it.