lm-sys / lm-sys/FastChat

run qwen-1.5-4b-chat with vllm worker failed: max seq len (32768) is larger than the maximum number of tokens

Open
#3,177 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
39.5k
Forks
4.8k
PR merge metrics
No merged PRs in 30d

Description

Error logs:
```shell
Run model worker...
INFO 03-20 19:18:21 llm_engine.py:72] Initializing an LLM engine with config: model='/data/models/qwen1.5-4b-chat', tokenizer='/data/models/qwen1.5-4b-chat', tokenizer_mode=auto, revision=None, tokenizer_revision=None, trust_remote_code=True, dtype=torch.bfloat16, max_seq_len=32768, download_dir=None, load_format=auto, tensor_parallel_size=1, disable_custom_all_reduce=False, quantization=None, enforce_eager=True, kv_cache_dtype=auto, seed=0)
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
INFO 03-20 19:18:27 llm_engine.py:322] # GPU blocks: 1842, # CPU blocks: 655
2024-03-20 19:18:27 | ERROR | stderr | Traceback (most recent call last):
2024-03-20 19:18:27 | ERROR | stderr | File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
2024-03-20 19:18:27 | ERROR | stderr | return _run_code(code, main_globals, None,
2024-03-20 19:18:27 | ERROR | stderr | File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
2024-03-20 19:18:27 | ERROR | stderr | exec(code, run_globals)
2024-03-20 19:18:27 | ERROR | stderr | File "/FastChat/fastchat/serve/vllm_worker.py", line 290, in
2024-03-20 19:18:27 | ERROR | stderr | engine = AsyncLLMEngine.from_engine_args(engine_args)
2024-03-20 19:18:27 | ERROR | stderr | File "/usr/local/lib/python3.9/dist-packages/vllm/engine/async_llm_engine.py", line 623, in from_engine_args
2024-03-20 19:18:27 | ERROR | stderr | engine = cls(parallel_config.worker_use_ray,
2024-03-20 19:18:27 | ERROR | stderr | File "/usr/local/lib/python3.9/dist-packages/vllm/engine/async_llm_engine.py", line 319, in __init__
2024-03-20 19:18:27 | ERROR | stderr | self.engine = self._init_engine(*args, **kwargs)
2024-03-20 19:18:27 | ERROR | stderr | File "/usr/local/lib/python3.9/dist-packages/vllm/engine/async_llm_engine.py", line 364, in _init_engine
2024-03-20 19:18:27 | ERROR | stderr | return engine_class(*args, **kwargs)
2024-03-20 19:18:27 | ERROR | stderr | File "/usr/local/lib/python3.9/dist-packages/vllm/engine/llm_engine.py", line 114, in __init__
2024-03-20 19:18:27 | ERROR | stderr | self._init_cache()
2024-03-20 19:18:27 | ERROR | stderr | File "/usr/local/lib/python3.9/dist-packages/vllm/engine/llm_engine.py", line 331, in _init_cache
2024-03-20 19:18:27 | ERROR | stderr | raise ValueError(
2024-03-20 19:18:27 | ERROR | stderr | ValueError: The model's max seq len (32768) is larger than the maximum number of tokens that can be stored in KV cache (29472). Try increasing `gpu_memory_utilization` or decreasing `max_model_len` when initializing the engine.
```

Here I can find dicussion about vllm:
https://github.com/vllm-project/vllm/issues/2418

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with fastchat/serve/vllm_worker.py around the AsyncLLMEngine initialization shown in the traceback, then compare the Qwen model's sequence length with vLLM's KV-cache capacity. Reproduce the failure using the reported qwen-1.5-4b-chat configuration and determine what behavior or configuration change should prevent the worker from exiting.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai-infra-agents
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.