Skip to content

Metrics and Objective Functions

Andrew Johnson edited this page Jan 29, 2024 · 13 revisions

The compiler chooses from among equivalent candidate functions and data to minimize the final objective metric.

What is a Metric?

Metrics are integer tuples. Zero is the perfect score.

0 < 1 < (1 1) < (1 (0 2))

One Expression, Multiple Metrics

A single expression may yield multiple metrics such as memory pressure or cpu pressure.

cpu( e ) = (2,34,(5,67))
memory( e ) = (8,(9,1011))

Objectives are Goals to be Minimized

Objective functions are optimization goals that can be tweaked and weighted.

Goal: min( 0.8 * cpu(program) + 0.2 * memory(program) )

Clone this wiki locally