Update 8-bit optimizer docs (#15155)
This commit is contained in:
parent
5dd7b6a478
commit
7b185c7fc9
|
@ -143,5 +143,13 @@ It is also possible to use BFloat16 mixed precision on the CPU, relying on MKLDN
|
|||
8-bit Optimizer
|
||||
***************
|
||||
|
||||
It is possible to further reduce the precision using third-party libraries like `bitsandbytes <https://github.com/facebookresearch/bitsandbytes>`_. Although,
|
||||
It is possible to further reduce the precision using third-party libraries like `bitsandbytes <https://github.com/TimDettmers/bitsandbytes>`_. Although,
|
||||
Lightning doesn't support it out of the box yet but you can still use it by configuring it in your LightningModule and setting ``Trainer(precision=32)``.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import bitsandbytes as bnb
|
||||
|
||||
# in your LightningModule, return the 8-bit optimizer
|
||||
def configure_optimizers(self):
|
||||
return bnb.optim.Adam8bit(model.parameters(), lr=0.001, betas=(0.9, 0.995))
|
||||
|
|
Loading…
Reference in New Issue