-
Notifications
You must be signed in to change notification settings - Fork 524
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds an 8-bit version of the LION optimizer. Also features 1 byte of (optional) auxiliary error correction state for each parameter to make pure bf16 training work. Code changes: * Adds `lion8b.py` to `llm-foundry/optim` * Adds `DecoupledLionW_8bit` to `llm-foundry/optim/__init__.py` * Adds `lion8b` as an option in `llm-foundry/optim/builders.py` * Adds `test_lion8b.py` to the tests. * Adds `mosaicml-turbo` to the GPU dependencies in `setup.py`. This is the repo that currently holds all the CUDA kernels. These are in a separate repo for now to avoid complicating LLM foundry {install, deps, source code}. * Adds an optional `master_weight_dtype` field in `train.py`. If set to bf16 or fp16, the script does `model.to(dtype=<that dtype>)` before training. This works when we have error correction turned on. * Tweaks `config_utils.py` to set FSDP's param_dtype to None if the master weights are already fp16/bf16.
- Loading branch information
Showing
7 changed files
with
1,011 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,7 @@ | |
|
||
extra_deps['gpu'] = [ | ||
'flash-attn==v1.0.3.post0', | ||
'mosaicml-turbo>=0.0.2,<0.1', | ||
# PyPI does not support direct dependencies, so we remove this line before uploading from PyPI | ||
'xentropy-cuda-lib@git+https://github.com/HazyResearch/[email protected]#subdirectory=csrc/xentropy', | ||
] | ||
|
Oops, something went wrong.