FSDP: _optimizer_has_flat_params
only checks first parameter group
#17817
Labels
Milestone
_optimizer_has_flat_params
only checks first parameter group
#17817
Bug description
The function
_optimizer_has_flat_params
only checks the first parameter group forfsdp_flattened
parameters. There is an edge case where the first parameter group has nofsdp_flattened
parameters but subesquent groups do. It would be a small change to this function to simply check all groups inoptimizer.param_groups
:What version are you seeing the problem on?
v2.0
How to reproduce the bug
No response
Error messages and logs
No response
Environment
Current environment
More info
No response
cc @awaelchli @carmocca
The text was updated successfully, but these errors were encountered: