Skip to content

ciflow/trunk/21031

@psiddh psiddh tagged this 18 Jul 06:07
Summary:

Follow-up to D112514521. That diff (a diff-train import of the Practical-RIFE
PTQ/QAT accuracy flow) tripped the `missing_for_each_optimizer` CITRINE
static-analysis lint at `qat_loop.py:689`: the QAT training loop constructed
`torch.optim.SGD` without the foreach multi-tensor implementation.

Add `foreach=True` to the `torch.optim.SGD` constructor in `build_qat_model`
so the optimizer uses the multi-tensor path (estimated ~3.3% training speedup
per the lint guidance). Applied to both the `fbcode` and `xplat` copies.

Reviewed By: rascani

Differential Revision: D112638593
Assets 2
Loading