Skip to content

Conversation

@CatherineSue
Copy link
Contributor

@CatherineSue CatherineSue commented Feb 20, 2024

Hi, when the temp is too low, we found the generated text would be empty in v0.3.0:

# python3 -m vllm.entrypoints.openai.api_server --port 8080 --model /models/Llama-2-70b-chat-hf --tensor-parallel-size 2
# curl http://localhost:8080/v1/completions     -H "Content-Type: application/json"     -d '{
       "model": "/models/Llama-2-70b-chat-hf",
       "prompt": "The capital of France is",
       "max_tokens": 100,
       "n": 1,
       "temperature": 1e-4,
       "ignore_eos": 1
    }'
{"id":"cmpl-1e09b4828b154423b9b147897f49b599","object":"text_completion","created":1203634,"model":"/models/Llama-2-70b-chat-hf","choices":[{"index":0,"text":"","logprobs":null,"finish_reason":"length"}],"usage":{"prompt_tokens":6,"total_tokens":106,"completion_tokens":100}}

And it would raise RuntimeError: probability tensor contains either `inf`, `nan` or element < 0 in v0.2.4.

Here are some findings after debugging:

We think it would be confusing if the output kept being empty when users set the temperature too low. It would be nice to have the temperature max out the temperature to 1e-2 or 1e-3 to avoid the empty output. This PR:

  • max out the temperature to 1e-2, and log a warning to users
  • Use float32 for logits to avoid numerical errors.

@DarkLight1337
Copy link
Member

Thanks for the QoL change! (And sorry for the long wait) I'll help get this merged.

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) August 13, 2024 14:01
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Aug 13, 2024
@DarkLight1337 DarkLight1337 merged commit c134a46 into vllm-project:main Aug 14, 2024
@DarkLight1337
Copy link
Member

Finally merged, sorry for the long delay!

Alvant pushed a commit to compressa-ai/vllm that referenced this pull request Oct 26, 2024
LeiWang1999 pushed a commit to LeiWang1999/vllm-bitblas that referenced this pull request Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants