model_calib

Calibration utilities.

Functions

max_calibrate

Calibrate the model using max.

real_quantize

Calibrate the model if given additonal_algorithm and then apply real quantization.

awq

Apply AWQ to the model.

smoothquant

Smooth-Quant variant with per-channel weight scaling.

awq(model, algorithm='awq_lite', forward_loop=None, **kwargs)

Apply AWQ to the model.

Parameters:
  • model (Module) –

  • algorithm (str) –

  • forward_loop (Callable[[Module], None] | None) –

max_calibrate(model, forward_loop=None)

Calibrate the model using max.

Parameters:
  • model (Module) –

  • forward_loop (Callable[[Module], None] | None) –

real_quantize(model, forward_loop=None, **kwargs)

Calibrate the model if given additonal_algorithm and then apply real quantization.

Parameters:
  • model (Module) –

  • forward_loop (Callable[[Module], None] | None) –

smoothquant(model, forward_loop=None, alpha=1.0)

Smooth-Quant variant with per-channel weight scaling.

The parameters are as described in SmoothQuantCalibConfig.

Parameters:
  • model (Module) –

  • forward_loop (Callable[[Module], None] | None) –