distillation — Model Optimizer 0.27.1 (original) (raw)

API for converting a model into a modelopt.torch.distill.DistillationModel to be used directly in training.

Functions

convert Main conversion function to turn a student model into a distillation-ready model.
export Export a distillation meta-model to the original student model.

convert(model, mode)

Main conversion function to turn a student model into a distillation-ready model.

Parameters:

Returns:

An instance of DistillationModel <modelopt.torch.distill.DistillationModel.

Return type:

Module

export(model)

Export a distillation meta-model to the original student model.

Parameters:

model (Module) – Model to be exported out of a distillation mode into the student only.

Returns:

The inner student model.

Return type:

Module