utils.callbacks.qat
utils.callbacks.qat
QAT Callback for HF Causal Trainer
Classes
Name | Description |
---|---|
QATCallback | Callback to toggle fake quantization for the model. |
QATCallback
utils.callbacks.qat.QATCallback(cfg)
Callback to toggle fake quantization for the model.
Functions
Name | Description |
---|---|
toggle_fake_quant | Toggle fake quantization for any fake quantized linear or embedding layers in the model. |
toggle_fake_quant
utils.callbacks.qat.toggle_fake_quant(mod, enable)
Toggle fake quantization for any fake quantized linear or embedding layers in the model.
Parameters
Name | Type | Description | Default |
---|---|---|---|
mod | nn.Module | The module to toggle fake quantization for. | required |
enable | bool | Whether to enable or disable fake quantization. | required |