mode

Module implementing and describing modes that can be used during the NAS convert process.

Check out mtp.prune to learn more about modes.

Classes

FastNASModeDescriptor

Class to describe the "fastnas" mode.

GradNASModeDescriptor

Class to describe the "gradnas" mode.

MCoreGPTMinitronModeDescriptor

Class to describe the "mcore_gpt_minitron" mode.

class FastNASModeDescriptor

Bases: _ModeDescriptor

Class to describe the "fastnas" mode.

The properties of this mode can be inspected via the source code.

property config_class: Type[ModeloptBaseConfig]

Specifies the config class for the mode.

property convert: Callable[[Module, ModeloptBaseConfig], Tuple[Module, Dict[str, Any]]]

The mode’s entrypoint for converting a model.

property export_mode: str | None

The mode that corresponds to the export mode of this mode.

property name: str

Returns the value (str representation) of the mode.

property next_modes: Set[str] | None

Modes that must immediately follow this mode.

property restore: Callable[[Module, ModeloptBaseConfig, Dict[str, Any]], Module]

The mode’s entrypoint for restoring a model.

property search_algorithm: Type[BaseSearcher]

Specifies the search algorithm to use for this mode (if any).

property update_for_new_mode: Callable[[Module, ModeloptBaseConfig, Dict[str, Any]], None]

The mode’s entrypoint for updating the models state before new mode.

property update_for_save: Callable[[Module, ModeloptBaseConfig, Dict[str, Any]], None]

The mode’s entrypoint for updating the models state before saving.

class GradNASModeDescriptor

Bases: FastNASModeDescriptor

Class to describe the "gradnas" mode.

The properties of this mode can be inspected via the source code.

property config_class: Type[ModeloptBaseConfig]

Specifies the config class for the mode.

property name: str

Returns the value (str representation) of the mode.

property search_algorithm: Type[BaseSearcher]

Specifies the search algorithm to use for this mode (if any).

class MCoreGPTMinitronModeDescriptor

Bases: FastNASModeDescriptor

Class to describe the "mcore_gpt_minitron" mode.

The properties of this mode can be inspected via the source code.

property config_class: Type[ModeloptBaseConfig]

Specifies the config class for the mode.

property name: str

Returns the value (str representation) of the mode.

property search_algorithm: Type[BaseSearcher]

Specifies the search algorithm to use for this mode (if any).