Objective

August 29, 2023 ยท View on GitHub

  1. Introduction

  2. Supported Objectives Matrix

  3. Examples

Introduction

In terms of evaluating the status of a specific model during tuning, we should have general objectives to measure the status of different models.

Intel Extension for Transformers supports optimized low-precision recipes for deep learning models to achieve optimal product objectives like inference performance and memory usage with expected accuracy criteria.

Supported Objectives Matrix:

ArgumentTypeDescriptionDefault value
namestringa objective name in Intel Neural Compressor. Like "performance", "modelsize",......and so on/
greater_is_betterboolused to describe the usage of the objective, like: greater is better for performance, but lower is better for modelsizeTrue
weight_ratiofloatused when there are multiple objective.
for example: different weight proportion on performance and modelsize.
None

Examples:

There are two built-in objective instances: performance, modelsize. Users can also build their own objective as below:

from intel_extension_for_transformers.objectives import performance, modelsize

or

from intel_extension_for_transformers.transformers import objectives
performance = objectives.Objective(name="performance", greater_is_better=True, weight_ratio=None)