[FSDP] Register state_dict hooks for FlatParamsWrapper even if params_list is empty (#74860)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74860
These pre/post hooks must be registered even if the FlatParamsWrapper does not flatten any parameters; any submodule inside FlatParamsWrapper should be pre/post processed by the hooks.
ghstack-source-id: 152594052
Test Plan: CI
Reviewed By: rohan-varma
Differential Revision: D35194483
fbshipit-source-id: c25d7846f317c7ce78d77d335d041fed8db8f3a1
(cherry picked from commit db2cc311714e579362f5201922be715a626d48df)