Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LM head module #19

Merged
merged 7 commits into from
Jul 12, 2022
Merged

LM head module #19

merged 7 commits into from
Jul 12, 2022

Conversation

dbaranchuk
Copy link
Collaborator

@dbaranchuk dbaranchuk commented Jul 10, 2022

  • BloomForCausalLM == BloomForCausalLM from HF transformers;
  • Added LMHead module that doesn't duplicate word embeddings;
  • This module also allows for efficient chunked forward when embeddings are in half-precision on CPU. The chunk size can be set in DistributedBloomConfig (default: 10000). Default chunk_size provides reasonable performance and consumes extra ~0.6Gb memory instead of ~7.2Gb for the 176B model;
  • Moved 'set_requires_grad' from BloomModel to DistributedBloomModel to make BloomModel == BloomModel from HF transformers.

Copy link
Collaborator

@justheuristic justheuristic left a comment

Choose a reason for hiding this comment

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

LGTM, let's merge

@dbaranchuk dbaranchuk merged commit ac7df18 into main Jul 12, 2022
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.

None yet

2 participants