Skip to content

nightly-bisect/a

@hwchen2017 hwchen2017 tagged this 11 Oct 15:21
Fix CPUAdagrad to use the weight-decay-adjusted gradient in both the
accumulator and parameter update, matching  `torch.optim.Adagrad` .
Previously, the update numerator incorrectly used the original gradient.
Covers scalar and SIMD implementations, including the XPU copies. Adds
regression tests for zero/nonzero weight decay, multiple tensor sizes,
and repeated updates.

Validation: On Intel Xeon Platinum 8480C with PyTorch 2.12, the
unit-test file passed separately under scalar, AVX2, and AVX512 builds—8
passed, 1 GPU-only test skipped per build. CPU training comparisons and
pre-commit checks also passed. XPU host arithmetic was checked; the full
XPU/SYCL build was not tested.

---------

Signed-off-by: Hongwei Chen <hongweichen@microsoft.com>
Signed-off-by: Hongwei Chen <hongweichenmail@gmail.com>
Assets 2
Loading