Lightning-AI / Lightning-AI/litgpt

How to use fabric.clip_gradients in 16-mixed?

Open
#2,042 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

hi, I'd like to know how to use fabric.clip_gradients in 16-mixed? I got this error in pretrain.py:

Gradient clipping is not implemented for optimizers handling the unscaling.

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

Read the gradient-clipping call in pretrain.py and the fabric.clip_gradients entry point, then reproduce the reported 16-mixed error. Done means the supported usage or required change is clearly documented and the error path has a confirmed resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.