-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix text generation quality for bf16 models when sampling #1644
base: main
Are you sure you want to change the base?
Conversation
7b8180b
to
9353dda
Compare
Here are the results of transformer tests with v1.15-release branch.
|
6755f0a
to
5e5dbe4
Compare
5e5dbe4
to
090527c
Compare
Based on discussion with @jiminha, we will keep the upcast to float() introduced in huggingface/transformers@22e6f14#diff-26783ca033d92b4ce2e01eb691dbf5b05dd972b0cbfdc69fc726cf77a9dcb011 The accuracy of text generated for some lower precision models is affected because the distribution sampled by Here are examples of outputs for different models: This PR 090527c Falcon-7b This PR 090527c Llama-7b This PR 090527c |
What does this PR do?
Improves the quality of the text generated by bf16 models when sampling. This change also affects multi-card inference using deepspeed in
run_generation.py
which uses bf16 by default.For example:
python run_generation.py --model_name_or_path gpt2 --use_kv_cache --max_new_tokens 100 --do_sample --prompt "Here is my prompt" --bf16
Before fix: main a51475f
Here is my prompt for them to see this thread Quote courtesy of set-up-example.com Waaah awaaaaah. Whoe wooooohhhhhhhhhhhhhhhh. What's that? Haskell version in printable format?\n\[email protected]\n\nMy HOST ROCKS FOR MY CORE:\n\nacmme29@design's turntable.mac.ca:20187 Rational: why can't I mod ram?\n\n%~v1-pc
After fix:
Here is my prompt for your comment, if you wish to share with a new person:In order to maintain a good balance of health and safety, a number of initiatives have been put forth. These include protecting animals, preventing accidental death, and establishing and monitoring healthy cages and the care of animals in humane environments. These measures improve safety and quality of life for animal owners and the public alike.Introduction\n\nThe present study compared population densities of the Australian and New Zealand species of moss, plants, and
Before submitting