modelopt.torch.distill.bypass#
- bypass(student, teacher, train_dataloader, config=None, *, validation_dataloader=None)#
Optimize IQ native scales on streamed frozen teacher boundary inputs.
Finalization commits boundaries in order, so a failure there may leave earlier boundaries committed. Caller modes and teacher gradient flags are restored on every exit.
- 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. Dict batches may carry a boolean/integer
valid_mask,loss_maskor 2Dattention_mask; nonzero marks a valid token.config – A
BypassConfig, a dict, or None for the defaults.validation_dataloader – Optional held-out batches for finalized-student valid-token MSE.
- Returns:
The supplied student, finalized for ordinary ModelOpt save/export.
- Return type:
Module