opentuner icon indicating copy to clipboard operation
opentuner copied to clipboard

how to change optimization parameter

Open aatiranum opened this issue 7 years ago • 7 comments

How to change the optimization parameters to other parameters other than time? In gcc_minimal.py, I am changing the line return Result(time=run_result['time']) to return Result(time=run_result['size]) but it is giving an error screenshot from 2018-04-09 05-27-24

aatiranum avatar Apr 09 '18 12:04 aatiranum

You need to measure the size of the program, something like: Result(time=os.stat(output_dir).st_size)

There is also more complex objectives. See the petabricks example for ThresholdAccuracyMinimizeTime

jansel avatar Apr 09 '18 17:04 jansel

Thank you so much for your response. I do not understand how to use complex objectives from petabricks example. Can you give me a simple example (as of gcc) such that I want the result of MinimumSizeMinimizeTime.

aatiranum avatar Apr 10 '18 10:04 aatiranum

Multiple objectives allows you to do things like "find the fastest program under 1MB in size". You can define a custom objective to optimize the criteria you care about.

jansel avatar Apr 10 '18 18:04 jansel

How to define a custom objective? What files need to be changed? Can you provide with a code example? Thanks.

aatiranum avatar Apr 12 '18 12:04 aatiranum

I want to look for a gcc flags which has minimum size and best performance. How to define this objective and how to use this in code. Can u please provide me with a complete code?

aatiranum avatar Apr 12 '18 13:04 aatiranum

i am sorry for interfering but i just saw a recent report with shared code mentioning gcc/clang flags tuning for minimum size and best performance: https://arxiv.org/abs/1801.08024 ; it is probably based on opentuner (I did not yet dig inside) - in such case you can probably find sample code there?

schrobk71 avatar Apr 12 '18 15:04 schrobk71

Examples of custom objectives are here: https://github.com/jansel/opentuner/blob/master/opentuner/search/objective.py#L212

That paper uses http://ctuning.org/

jansel avatar Apr 12 '18 19:04 jansel