Skip to content

Conversation

jacobfulano
Copy link
Contributor

This is a draft PR for FSDP implementation in BERT

return all_encoder_layers

# Param Initialization, needed for device='meta' fast initialization
def param_init_fn(self, module):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacobfulano a few comments:

  • param_init_fn is not needed unless you plan to make your models meta initializable. For a first draft, I would remove entirely
  • fsdp_wrap_fn and activation_checkpointing_fn need to be defined on a root module underneath the ComposerModel. So they have to be defined for say, BertForMaskedLM. I would recommend moving the definition there, and I think it will work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants