deepspeedai / deepspeedai/DeepSpeed
[REQUEST] bfloat16 for inference. Potential issues converting bfloat16 to float16 for inference?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 43.1k
- Forks
- 5k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 112
Description
Is your feature request related to a problem? Please describe.
Bfloat16 is more suitable for training large models due to its increased stability. However, while DeepSpeed supports training with bfloat16, it does not currently support using inference with bfloat16
This leads me to the desire to have bfloat16 support, and makes me ask the question:
Is it possible that converting bfloat16 to float16 will cause issues? I think it may due to the smaller possible range with float16, but if it does then how likely is it to cause issues? Will it cause a large degradation or only slightly? If I want to use DeepSpeed Inference should my models be trained with float16 rather than bfloat16 for the time being?
I have loaded a blfoat16 trained model with float16 before and didn't notice any obvious degradation but there could be some.
Describe the solution you'd like
I want bfloat16 to be supported for inference and an answer to my questions.
Describe alternatives you've considered
Train only in float16 and deal with the increased instability during training for ensured quality with DeepSpeed inference.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing DeepSpeed's existing inference and bfloat16 support, then determine where inference currently converts or rejects bfloat16 models. The work is complete when bfloat16 inference is supported and the impact of converting bfloat16 to float16 is documented or tested.
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