modelopt.torch.distill.bypass#

bypass(student, teacher, train_dataloader, config=None, *, validation_dataloader=None, device_mesh=None)#

Optimize IQ native scales on streamed frozen teacher boundary inputs.

Parameters:
  • student (Module) – Existing ModelOpt IQ PTQ model; frozen formats may coexist.

  • teacher (Module) – Separate original-weight callable with matching boundary paths.

  • train_dataloader – Unique sample batches that exactly fill each global update.

  • config – A BypassConfig, a dict, or None for the established defaults.

  • validation_dataloader – Optional held-out batches for final valid-token MSE.

  • device_mesh – Caller-owned placement mesh, adopted by supported integrations.

Returns:

The supplied student, finalized for ordinary ModelOpt save/export. Temporary fields, hooks, modes and gradient flags are restored on every exit.

Return type:

Module