fix keep_module_on_host (#7112)
Reapply https://github.com/deepspeedai/DeepSpeed/pull/6846.
FYI @oelayan7
---------
Signed-off-by: inkcherry <mingzhi.liu@intel.com>
Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.com>
Signed-off-by: Logan Adams <loadams@microsoft.com>