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

Add dtype support #86

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

younesbelkada
Copy link

@younesbelkada younesbelkada commented Aug 5, 2022

Motivation

People may want to use minGPT in different precisions (fp16, fp32, bf16). This PR integrates this feature to add this possibility to the library. Only floating point precisions are supported here.
Users can:

  • Create a model with a different precision than fp32

Added features

  • memory footprint tracking of minGPT models
  • Added a new test for checking the memory footprint of casted models

Other

Not sure if a pretrained model can be loaded in the desired dtype (needs to add kwargs on from_pretrained method probably)

@karpathy

mingpt/model.py Outdated Show resolved Hide resolved
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.

1 participant