How to Customize a Pass Parameters#
This document describes how to configure an Olive Pass.
When configuring a Pass, the user can chose to set the values of parameters to their default value (no search), pre-defined search space (search for the best value from the possible options) or a combination of the two (fix some parameters to a certain value, default or user provided, and/or search for other parameters).
To fully configure a Pass, we require three things: type, disable_search, and config.
type: This is the type of the Pass. Check out :ref:passesfor the full list of supported Passes.disable_search: This decides whether to use the default value (disable_search=True) or the default searchable values, if any, (disable_search=False) for the optional parameters. This is :code:Falseby default.config: This is a dictionary of the config parameters and values. It must contain all required parameters. For optional parameters the default value or default searchable values (depending on whetherdisable_searchisTrueorFalse) can be overridden by providing user defined values. You can also assign the value for a specific parameter asDEFAULT_VALUEto use the default value orSEARCHABLE_VALUESto use the default searchable values (if available).
Here is an example of how to configure the OnnxQuantization Pass:
{
    "type": "OnnxQuantization",
    "disable_search": false,
    "data_config": "calib_data_config",
    // set per_channel to "DEFAULT_VALUE"
    "per_channel": "DEFAULT_VALUE",
    // set reduce_range to "SEARCHABLE_VALUES" value
    // redundant since disable_search is false
    "reduce_range": "SEARCHABLE_VALUES",
    // user defined value for precision
    "precision": "uint8"
}
Note
type is case insensitive.