Skip to content

Commit

Permalink
bf16: change to warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Titus-von-Koeller authored Feb 21, 2024
1 parent ab07a4a commit aca80a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/source/integrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ Please review the [bitsandbytes section in the Accelerate docs](https://huggingf

Details about the BitsAndBytesConfig can be found [here](https://huggingface.co/docs/transformers/v4.37.2/en/main_classes/quantization#transformers.BitsAndBytesConfig).

## Beware: bf16 is the optimal compute data type
If your hardware supports it, `bf16` is the optimal compute dtype. The default is `float32` for backward compatibility and numerical stability. `float16` often leads to numerical instabilities, but `bfloat16` provides the benefits of both worlds: numerical stability and significant computation speedup. Therefore, be sure to check if your hardware supports `bf16` and configure it using the `bnb_4bit_compute_dtype` parameter in BitsAndBytesConfig:
> [!WARNING]
> **Beware: bf16 is the optimal compute data type!**
>
> If your hardware supports it, `bf16` is the optimal compute dtype. The default is `float32` for backward compatibility and numerical stability. `float16` often leads to numerical instabilities, but `bfloat16` provides the benefits of both worlds: numerical stability and significant computation speedup. Therefore, be sure to check if your hardware supports `bf16` and configure it using the `bnb_4bit_compute_dtype` parameter in BitsAndBytesConfig:
```py
import torch
Expand Down

0 comments on commit aca80a0

Please sign in to comment.