Write CPU optimizer results back to non-contiguous params (#8714)
`DeepSpeedCPUAdam`, `DeepSpeedCPUAdagrad` and `DeepSpeedCPULion`
silently skip the update for non-contiguous params, such as a
`channels_last` conv weight or a transposed weight. The param never
moves and nothing raises.
The C++ step wrappers call `.contiguous()` on the param and state
tensors and run the kernel on the result. For a non-contiguous tensor
that is a copy, so the new values are dropped. The fix copies them back
when a copy was made, including in the XPU Adagrad wrapper. Contiguous
tensors, like ZeRO-Offload flat buffers, are unchanged.
Test: new non-contiguous tests for all three optimizers, checked against
the torch or paper update. They fail on master and pass with the fix.
Existing CPU Adam and Adagrad tests still pass.
Signed-off-by: Vineeth Sai <vineethsai4444@gmail.com>