lm-sys / lm-sys/FastChat

运行baichuan2报错

Open
#2,987 0 comments 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

(base) ps@ps:/data/model_hub/llm$ CUDA_VISIBLE_DEVICES=1,2 python3 -m fastchat.serve.cli --model-path Baichuan2-13B-Chat --num-gpus 2
[2024-01-31 14:19:32,877] [INFO] [real_accelerator.py:133:get_accelerator] Setting ds_accelerator to cuda (auto detect)
Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████| 6/6 [00:14<00:00, 2.39s/it]
<reserved_102> : 你好
<reserved_103> : Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/data/FastChat/fastchat/serve/cli.py", line 256, in
main(args)
File "/data/FastChat/fastchat/serve/cli.py", line 191, in main
chat_loop(
File "/data/FastChat/fastchat/serve/inference.py", line 373, in chat_loop
outputs = chatio.stream_output(output_stream)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/FastChat/fastchat/serve/cli.py", line 54, in stream_output
for outputs in output_stream:
File "/data/miniconda3/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 56, in generator_context
response = gen.send(request)
^^^^^^^^^^^^^^^^^
File "/data/FastChat/fastchat/serve/inference.py", line 161, in generate_stream
indices = torch.multinomial(probs, num_samples=2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: probability tensor contains either inf, nan or element < 0

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/inference.py at generate_stream, especially the torch.multinomial call at line 161, and reproduce the provided Baichuan2 command with two GPUs. Trace why the probability tensor contains invalid values and verify the fix by confirming interactive generation completes without the reported RuntimeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
backend, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.