InternLM / InternLM/lmdeploy

[Bug] lmdeploy - ERROR - run out of tokens. session_id=1

Open
#2,319 3 comments 0 reactions 1 assignee Claimed by @lvhan028 View on GitHub
Dominant language
Python
Stars
8.1k
Forks
748
Avg merge
6d 2h
Merged PRs (30d)
54

Description

### Checklist

- [X] 1. I have searched related issues but cannot get the expected help.
- [X] 2. The bug has not been fixed in the latest version.
- [X] 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback.

### Describe the bug

The bug arose when I ran lmdeploy with Llama 3 70B during inference. I tried to generate text completion for a very long note (around 8K tokens).

I tried to include gen_config such as gen_config = GenerationConfig(min_new_tokens = 100) but none of them worked.

### Reproduction

from transformers import AutoTokenizer, AutoModelForCausalLM
from lmdeploy import pipeline, GenerationConfig, TurbomindEngineConfig

model_id = "meta-llama/Meta-Llama-3-70B"

backend_config = TurbomindEngineConfig(cache_max_entry_count=0.2, tp =4)
pipe = pipeline(model_id, backend_config=backend_config)

prompts = [' A very long prompt........']

response = pipe(prompts)

I tried to include generation config but the same error still showed up.
gen_config = GenerationConfig(min_new_tokens = 100)
response = pipe(prompts, gen_config = gen_config)

### Environment

```Shell
NA
```

### Error traceback

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.