Lightning-AI / Lightning-AI/litgpt

Decide what to do about 16bit weights trained with mixed precision

Open
#1,252 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
13.7k
Forks
1.5k
Avg merge
15h 37m
Merged PRs (30d)
1

Description

Our training scripts select mixed precision by default (16-mixed or bf16-mixed).
Many of the HF pretrained weights come in 16bit (float16 or bfloat16).

Since the weights are already in this dtype, it's not useful to do mixed precision training. We can do one of two things about it:

a) Cast the weights to fp32 in this case so that mixed precision training does something useful
b) Raise an exception saying that this configuration is not useful.

Note that this change needs to be done in PyTorch Lightning and Fabric, but I'm opening the issue here because this is a common problem in LitGPT and because we would need to add code to LitGPT to avoid b) if we choose it

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No specific files or tests are named. Start with the training scripts' mixed-precision setup and review how PyTorch Lightning and Fabric handle 16-bit weights; done requires choosing a policy, implementing it across the affected projects, and ensuring LitGPT remains compatible.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.