Skip to content
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

[Bug]: Meta-Llama-3-3-70B-Instruct Outputs "!!!!" With Context Length above 10k #738

Open
ppatel-eng opened this issue Jan 25, 2025 · 8 comments
Labels
bug Something isn't working

Comments

@ppatel-eng
Copy link

Your current environment

Environment Details

Running in a Kubernetes environment with Habana Gaudi2 accelerators:

  • Hardware: Habana Gaudi2 accelerators

  • Deployment: Kubernetes cluster

  • Node Resources:

    • CPU: 160 cores
    • Memory: 734GB
    • Gaudi2 Accelerators: 8 per node
  • Gaudi Habana Version: 1.18

  • vLLM Version: 0.6.2+geb0d42fc

  • Python Version: 3.10

How would you like to use vllm

I would like to serve the Meta-Llama-3-3-70B-Instruct model.

Current Configuration

Meta-Llama-3-3-70B-Instruct:
arguments:
- --gpu-memory-utilization 0.90
- --max-logprobs 5
- --enable-auto-tool-choice
- --tool-call-parser llama3_json
- --download-dir /data
- --tensor-parallel-size 4
- --chat-template /data/chat_templates/tool_chat_template_llama31_json.jinja
gpuLimit: 1
numGPU: 4

Model Input Dumps

No response

🐛 Describe the bug

When we provide a context over 10k tokens but sometimes with as little as 3k tokens, we get a response where the model starts outputting exclamation points instead. We tested this same script with the same model on Nvidia A100s and did not see this issue testing up to 60k tokens despite serving the model with the same exact vLLM settings (vllm version 0.6.2).

from openai import OpenAI

client = OpenAI(
    base_url=<model endpoint>,
    api_key=""
)
model = 'meta-llama/Llama-3.3-70B-Instruct'  # updated to match exact model name

for i in range(1, 12800, 1000):
    test_list = ["test " * i]
    try:
        response = client.chat.completions.create(
            model=model,
            messages=[{"role": "user", "content": f"how many times do I say the word test {test_list}"}],
            max_tokens=100
        )
        print(response)
        if "!!!" in response.choices[0].message.content:
            break
    except Exception as e:
        print(f"Error at iteration {i}: {str(e)}")

Example Response:

ChatCompletion(id='chatcmpl-efc931c17e6b47d7822718750875dc53', choices=[Choice(finish_reason='length', index=0, logprobs=None, message=ChatCompletionMessage(content='**To count the number of times the word "test" appears in the given list, you can use!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!',** refusal=None, role='assistant', audio=None, function_call=None, tool_calls=[]), stop_reason=None)], created=1737767074, model='meta-llama/Llama-3.3-70B-Instruct', object='chat.completion', service_tier=None, system_fingerprint=None, usage=CompletionUsage(completion_tokens=100, prompt_tokens=3053, total_tokens=3153, completion_tokens_details=None, prompt_tokens_details=None), prompt_logprobs=None)```

### Before submitting a new issue...

- [x] Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the [documentation page](https://docs.vllm.ai/en/latest/), which can answer lots of frequently asked questions.
@ppatel-eng ppatel-eng added the bug Something isn't working label Jan 25, 2025
@PatrykWo
Copy link

PatrykWo commented Jan 27, 2025

@ppatel-eng thank you for submitting the issue. For now Llama 3.3 is not fully validated by the team. Any feedback is valuable but we need some time to put the model on the official list of supported models.
Before proceeding please provide more details. Please colect envs.

wget https://raw.githubusercontent.com/vllm-project/vllm/main/collect_env.py

For security purposes, please feel free to check the contents of collect_env.py before running it.
python collect_env.py

@ppatel-eng
Copy link
Author

ppatel-eng commented Jan 27, 2025

Understood, thanks! The results from collect_env.py is below:
We upgraded our vllm version but are still having the same issue.

Is debug build: False
CUDA used to build PyTorch: 12.4
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.5 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.35

Python version: 3.10.12 (main, Jan 17 2025, 14:35:34) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.15.0-122-generic-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                         x86_64
CPU op-mode(s):                       32-bit, 64-bit
Address sizes:                        52 bits physical, 57 bits virtual
Byte Order:                           Little Endian
CPU(s):                               152
On-line CPU(s) list:                  0-151
Vendor ID:                            GenuineIntel
Model name:                           Intel(R) Xeon(R) Platinum 8368 CPU @ 2.40GHz
CPU family:                           6
Model:                                106
Thread(s) per core:                   2
Core(s) per socket:                   38
Socket(s):                            2
Stepping:                             6
CPU max MHz:                          3400.0000
CPU min MHz:                          800.0000
BogoMIPS:                             4800.00
Flags:                                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 invpcid_single ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect wbnoinvd dtherm ida arat pln pts avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid fsrm md_clear pconfig flush_l1d arch_capabilities
Virtualization:                       VT-x
L1d cache:                            3.6 MiB (76 instances)
L1i cache:                            2.4 MiB (76 instances)
L2 cache:                             95 MiB (76 instances)
L3 cache:                             114 MiB (2 instances)
NUMA node(s):                         2
NUMA node0 CPU(s):                    0-37,76-113
NUMA node1 CPU(s):                    38-75,114-151
Vulnerability Gather data sampling:   Mitigation; Microcode
Vulnerability Itlb multihit:          Not affected
Vulnerability L1tf:                   Not affected
Vulnerability Mds:                    Not affected
Vulnerability Meltdown:               Not affected
Vulnerability Mmio stale data:        Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed:               Not affected
Vulnerability Spec rstack overflow:   Not affected
Vulnerability Spec store bypass:      Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:             Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI SW loop, KVM SW loop
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Not affected

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] nvidia-cublas-cu12==12.4.5.8
[pip3] nvidia-cuda-cupti-cu12==12.4.127
[pip3] nvidia-cuda-nvrtc-cu12==12.4.127
[pip3] nvidia-cuda-runtime-cu12==12.4.127
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] nvidia-cufft-cu12==11.2.1.3
[pip3] nvidia-curand-cu12==10.3.5.147
[pip3] nvidia-cusolver-cu12==11.6.1.9
[pip3] nvidia-cusparse-cu12==12.3.1.170
[pip3] nvidia-ml-py==12.570.86
[pip3] nvidia-nccl-cu12==2.21.5
[pip3] nvidia-nvjitlink-cu12==12.4.127
[pip3] nvidia-nvtx-cu12==12.4.127
[pip3] pyzmq==26.2.0
[pip3] torch==2.5.1
[pip3] torchvision==0.20.1
[pip3] transformers==4.48.1
[pip3] triton==3.1.0
[conda] Could not collect
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.6.6.post1
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
Could not collect

TORCHSERVE_PORT_8082_TCP_ADDR=<redacted>
TORCHSERVE_PORT_8081_TCP_ADDR=<redacted>
TORCHSERVE_PORT=tcp://<redacted>:8080
TORCHSERVE_SERVICE_HOST=<redacted>
TORCHSERVE_PORT_7070_TCP_ADDR=<redacted>
TORCHSERVE_SERVICE_PORT_GRPC=7070
TORCHSERVE_PORT_8080_TCP_PORT=8080
TORCHSERVE_SERVICE_PORT=8080
TORCHSERVE_PORT_8080_TCP_PROTO=tcp
TORCHSERVE_PORT_8081_TCP_PORT=8081
TORCHSERVE_PORT_8081_TCP_PROTO=tcp
TORCHSERVE_PORT_8080_TCP_ADDR=<redacted>
TORCHSERVE_PORT_8082_TCP_PROTO=tcp
TORCHSERVE_PORT_7070_TCP_PROTO=tcp
TORCHSERVE_SERVICE_PORT_MDL=8081
TORCHSERVE_SERVICE_PORT_METRICS=8082
TORCHSERVE_PORT_8082_TCP_PORT=8082
TORCHSERVE_SERVICE_PORT_PREDS=8080
TORCHSERVE_PORT_8081_TCP=tcp://<redacted>:8081
TORCHSERVE_PORT_8080_TCP=tcp://<redacted>:8080
TORCHSERVE_PORT_7070_TCP_PORT=7070
TORCHSERVE_PORT_8082_TCP=tcp://<redacted>:8082
TORCHSERVE_PORT_7070_TCP=tcp://<redacted>:7070
LD_LIBRARY_PATH=/usr/local/lib/python3.10/dist-packages/cv2/../../lib64:

@PatrykWo
Copy link

Hi @ppatel-eng, thank you for the update, it seems that vllm-fork for Gaudi is not installed. Please try the steps and run test once again:

$ git clone https://github.com/HabanaAI/vllm-fork.git
$ cd vllm-fork
$ git checkout v0.6.4.post2+Gaudi-1.19.0
$ pip install -e .
$ pip install -r requirements-hpu.txt
$ python setup.py develop

and see if that helps?

@ppatel-eng
Copy link
Author

ppatel-eng commented Feb 7, 2025

Hi, I tried that on the Llama 3.3 70B as well as on a Llama 3.1 70B and am seeing similar issues on both:

--header 'Content-Type: application/json' \
--data "{
    \"model\": \"meta-llama/Llama-3.1-70B-Instruct\",
    \"messages\": [
        {
            \"role\": \"user\",
            \"content\": \"how many times do I say the word test $(printf 'test %.0s' {1..5000})\"
        }
    ],
    \"max_tokens\": 100
}"
{"id":"chatcmpl-79b9f8ec18f64221b323538ed02c1a35","object":"chat.completion","created":1738179683,"model":"meta-llama/Llama-3.1-70B-Instruct","choices":[{"index":0,"message":{"role":"assistant","content":"You!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","tool_calls":[]},"logprobs":null,"finish_reason":"length","stop_reason":null}],"usage":{"prompt_tokens":5044,"total_tokens":5144,"completion_tokens":100,"prompt_tokens_details":null},"prompt_logprobs":null}

What is interesting is that once one of these issues occurs, subsequent smaller requests (<300 tokens) exhibit the same behavior. It appears the model gets "stuck" generating because the logs show Avg generation throughput at about 30 tokens/s for more than 30 minutes after the output has been received and I do not expect the metrics to have that significant a lag.

INFO 01-29 19:38:21 metrics.py:467] Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 32.6 tokens/s, Running: 1 reqs, Swapped: 0 reqs, Pending: 0 reqs, GPU KV cache usage: 3.8%, CPU KV cache usage: 0.0%.
INFO 01-29 19:38:26 metrics.py:467] Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 33.1 tokens/s, Running: 1 reqs, Swapped: 0 reqs, Pending: 0 reqs, GPU KV cache usage: 3.8%, CPU KV cache usage: 0.0%.
...

@iboiko-habana
Copy link

  1. Please re-install triton to version triton==3.1.0
    pip install triton==3.1.0
  2. Please set next flags for OOM/functional issues avoiding in 1.19.0
    VLLM_ENGINE_ITERATION_TIMEOUT_S=3600
    VLLM_RPC_TIMEOUT=100000
    VLLM_PROMPT_USE_FUSEDSDPA=1
    PT_HPU_ENABLE_LAZY_COLLECTIVES=true
    PT_HPUGRAPH_DISABLE_TENSOR_CACHE=1
    VLLM_ALLOW_LONG_MAX_MODEL_LEN=1

Other flags setting is depending on context length. 32K context length flags example:

decreasing of VLLM_GRAPH_RESERVED_MEM, depends on model and long context. VLLM_GRAPH_RESERVED_MEM=0.02 for llama3.1-8b. VLLM_GRAPH_RESERVED_MEM=0.1 for llama3.1-70b.
VLLM_PROMPT_BS_BUCKET_MIN=1 # proposal for usage. depends on model. Can be increased if no OOM
VLLM_PROMPT_BS_BUCKET_STEP=16 # proposal for usage. depends on model. Can be increased until no OOM or decreased if OOM
VLLM_PROMPT_BS_BUCKET_MAX=16 # proposal for usage. depends on model. Can be increased until no OOM or decreased if OOM
VLLM_PROMPT_SEQ_BUCKET_MIN=24576 # proposal for usage. depends on warmup results
VLLM_PROMPT_SEQ_BUCKET_STEP=2048 # proposal for usage. depends on warmup results
VLLM_PROMPT_SEQ_BUCKET_MAX=32768 # context length 32K, 16384 for 16K
VLLM_DECODE_BLOCK_BUCKET_MIN=1024 # proposal for usage. depends on warmup results
VLLM_DECODE_BLOCK_BUCKET_STEP=1024 # proposal for usage. depends on warmup results
VLLM_DECODE_BLOCK_BUCKET_MAX=33792 # max_num_seqs * max_decode_seq // self.block_size, where max_decode_seq is input + output # i.e. 128*((32+1) * 1024)/128 or 32*((32+1)*1024)/128

  1. If issues is present after extra flags settings, please provide more details about tested scenario: server or offline scenario, benchmark details(i.e. if it reproducible via vllm-fork/benchmarks/benchmark_throughput.py) or whole benchmark.

@lkm2835
Copy link

lkm2835 commented Feb 9, 2025

Hi, I tried that on the Llama 3.3 70B as well as on a Llama 3.1 70B and am seeing similar issues on both:

--header 'Content-Type: application/json' \
--data "{
    \"model\": \"meta-llama/Llama-3.1-70B-Instruct\",
    \"messages\": [
        {
            \"role\": \"user\",
            \"content\": \"how many times do I say the word test $(printf 'test %.0s' {1..5000})\"
        }
    ],
    \"max_tokens\": 100
}"
{"id":"chatcmpl-79b9f8ec18f64221b323538ed02c1a35","object":"chat.completion","created":1738179683,"model":"meta-llama/Llama-3.1-70B-Instruct","choices":[{"index":0,"message":{"role":"assistant","content":"You!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","tool_calls":[]},"logprobs":null,"finish_reason":"length","stop_reason":null}],"usage":{"prompt_tokens":5044,"total_tokens":5144,"completion_tokens":100,"prompt_tokens_details":null},"prompt_logprobs":null}

What is interesting is that once one of these issues occurs, subsequent smaller requests (<300 tokens) exhibit the same behavior. It appears the model gets "stuck" generating because the logs show Avg generation throughput at about 30 tokens/s for more than 30 minutes after the output has been received and I do not expect the metrics to have that significant a lag.

INFO 01-29 19:38:21 metrics.py:467] Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 32.6 tokens/s, Running: 1 reqs, Swapped: 0 reqs, Pending: 0 reqs, GPU KV cache usage: 3.8%, CPU KV cache usage: 0.0%.
INFO 01-29 19:38:26 metrics.py:467] Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 33.1 tokens/s, Running: 1 reqs, Swapped: 0 reqs, Pending: 0 reqs, GPU KV cache usage: 3.8%, CPU KV cache usage: 0.0%.
...

I have a same issue. In my case, context length is less than 8K, sometimes the error occurs. (TP Size 2 or 4)
But, when using TP Size 1, the error doesn't occur.

@PatrykWo
Copy link

@lkm2835 we would like to reproduce the test. Please provide all steps which You are using to run benchmark. We must be sure that we are running exactly the same procedure. Thanks.

@lkm2835
Copy link

lkm2835 commented Feb 20, 2025

@PatrykWo
I used Qwen/Qwen2.5-32B-Instruct, beomi/EXAONE-3.5-32B-Instruct-Llamafied and google/gemma-2-27b-it.

PT_HPU_ENABLE_LAZY_COLLECTIVE=1 \
VLLM_SKIP_WARMUP=false \
python -m vllm.entrypoints.openai.api_server \
	--model /root/disks/Qwen2.5-32B-Instruct \
	--served-model-name Qwen2.5-32B-Instruct \
	--gpu_memory_utilization 0.9 \
	--dtype bfloat16 \
	--tensor-parallel-size 2 \
	--max-model-len=8192 \
	--max_num_seqs 256 \
	--port 17000 

And, If you run heavy inference (any datasets) for a few days, using chat completion, the model (tensor-parallel-size>=2) will break.
After the model breaks, the model always generated output will only be "!!!!!".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants