vllm icon indicating copy to clipboard operation
vllm copied to clipboard

[Usage]: Cannot run the starter code in tutorial

Open zhimin-z opened this issue 9 months ago • 11 comments

Your current environment

I am a new user who recently ran this starter code on my lab server:

import torch
from vllm import LLM, SamplingParams

# Clear any leftover memory from previous models
torch.cuda.set_device('cuda:3')
torch.cuda.empty_cache()

prompts = [
    "Hello, my name is",
    "The president of the United States is",
    "The capital of France is",
    "The future of AI is",
]

sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
llm = LLM(model="allenai/OLMo-1B-hf", device='cuda:3')
outputs = llm.generate(prompts, sampling_params)

# Print the outputs.
for output in outputs:
    prompt = output.prompt
    generated_text = output.outputs[0].text
    print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")

This piece of code always throws error:

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
Cell In[9], [line 16](vscode-notebook-cell:?execution_count=9&line=16)
      [8](vscode-notebook-cell:?execution_count=9&line=8) prompts = [
      [9](vscode-notebook-cell:?execution_count=9&line=9)     "Hello, my name is",
     [10](vscode-notebook-cell:?execution_count=9&line=10)     "The president of the United States is",
     [11](vscode-notebook-cell:?execution_count=9&line=11)     "The capital of France is",
     [12](vscode-notebook-cell:?execution_count=9&line=12)     "The future of AI is",
     [13](vscode-notebook-cell:?execution_count=9&line=13) ]
     [15](vscode-notebook-cell:?execution_count=9&line=15) sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
---> [16](vscode-notebook-cell:?execution_count=9&line=16) llm = LLM(model="allenai/OLMo-1B-hf", device='cuda:3')
     [17](vscode-notebook-cell:?execution_count=9&line=17) outputs = llm.generate(prompts, sampling_params)
     [19](vscode-notebook-cell:?execution_count=9&line=19) # Print the outputs.

File ~/open-moe-llm-leaderboard/.venv/lib/python3.10/site-packages/vllm/entrypoints/llm.py:123, in LLM.__init__(self, model, tokenizer, tokenizer_mode, skip_tokenizer_init, trust_remote_code, tensor_parallel_size, dtype, quantization, revision, tokenizer_revision, seed, gpu_memory_utilization, swap_space, enforce_eager, max_context_len_to_capture, max_seq_len_to_capture, disable_custom_all_reduce, **kwargs)
    [102](https://vscode-remote+ssh-002dremote-002bdocjk-002dgpu-002d02.vscode-resource.vscode-cdn.net/home/21zz42/open-moe-llm-leaderboard/~/open-moe-llm-leaderboard/.venv/lib/python3.10/site-packages/vllm/entrypoints/llm.py:102)     kwargs["disable_log_stats"] = True
    [103](https://vscode-remote+ssh-002dremote-002bdocjk-002dgpu-002d02.vscode-resource.vscode-cdn.net/home/21zz42/open-moe-llm-leaderboard/~/open-moe-llm-leaderboard/.venv/lib/python3.10/site-packages/vllm/entrypoints/llm.py:103) engine_args = EngineArgs(
    [104](https://vscode-remote+ssh-002dremote-002bdocjk-002dgpu-002d02.vscode-resource.vscode-cdn.net/home/21zz42/open-moe-llm-leaderboard/~/open-moe-llm-leaderboard/.venv/lib/python3.10/site-packages/vllm/entrypoints/llm.py:104)     model=model,
    [105](https://vscode-remote+ssh-002dremote-002bdocjk-002dgpu-002d02.vscode-resource.vscode-cdn.net/home/21zz42/open-moe-llm-leaderboard/~/open-moe-llm-leaderboard/.venv/lib/python3.10/site-packages/vllm/entrypoints/llm.py:105)     tokenizer=tokenizer,
   (...)
    [121](https://vscode-remote+ssh-002dremote-002bdocjk-002dgpu-002d02.vscode-resource.vscode-cdn.net/home/21zz42/open-moe-llm-leaderboard/~/open-moe-llm-leaderboard/.venv/lib/python3.10/site-packages/vllm/entrypoints/llm.py:121)     **kwargs,
    [122](https://vscode-remote+ssh-002dremote-002bdocjk-002dgpu-002d02.vscode-resource.vscode-cdn.net/home/21zz42/open-moe-llm-leaderboard/~/open-moe-llm-leaderboard/.venv/lib/python3.10/site-packages/vllm/entrypoints/llm.py:122) )
--> [123](https://vscode-remote+ssh-002dremote-002bdocjk-002dgpu-002d02.vscode-resource.vscode-cdn.net/home/21zz42/open-moe-llm-leaderboard/~/open-moe-llm-leaderboard/.venv/lib/python3.10/site-packages/vllm/entrypoints/llm.py:123) self.llm_engine = LLMEngine.from_engine_args(
    [124](https://vscode-remote+ssh-002dremote-002bdocjk-002dgpu-002d02.vscode-resource.vscode-cdn.net/home/21zz42/open-moe-llm-leaderboard/~/open-moe-llm-leaderboard/.venv/lib/python3.10/site-packages/vllm/entrypoints/llm.py:124)     engine_args, usage_context=UsageContext.LLM_CLASS)
    [125](https://vscode-remote+ssh-002dremote-002bdocjk-002dgpu-002d02.vscode-resource.vscode-cdn.net/home/21zz42/open-moe-llm-leaderboard/~/open-moe-llm-leaderboard/.venv/lib/python3.10/site-packages/vllm/entrypoints/llm.py:125) self.request_counter = Counter()
...
    [153](https://vscode-remote+ssh-002dremote-002bdocjk-002dgpu-002d02.vscode-resource.vscode-cdn.net/home/21zz42/open-moe-llm-leaderboard/~/open-moe-llm-leaderboard/.venv/lib/python3.10/site-packages/vllm/worker/worker.py:153) num_gpu_blocks = int(
    [154](https://vscode-remote+ssh-002dremote-002bdocjk-002dgpu-002d02.vscode-resource.vscode-cdn.net/home/21zz42/open-moe-llm-leaderboard/~/open-moe-llm-leaderboard/.venv/lib/python3.10/site-packages/vllm/worker/worker.py:154)     (total_gpu_memory * self.cache_config.gpu_memory_utilization -
    [155](https://vscode-remote+ssh-002dremote-002bdocjk-002dgpu-002d02.vscode-resource.vscode-cdn.net/home/21zz42/open-moe-llm-leaderboard/~/open-moe-llm-leaderboard/.venv/lib/python3.10/site-packages/vllm/worker/worker.py:155)      peak_memory) // cache_block_size)

AssertionError: Error in memory profiling. This happens when the GPU memory was not properly cleaned up before initializing the vLLM instance.

This is the GPU profile of my server using nvtop:

Device 0 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s
 GPU 1410MHz MEM 1512MHz TEMP  47°C FAN N/A% POW  69 / 300 W
 GPU[                                0%] MEM[|||||||||||||||||79.034Gi/80.000Gi]
 Device 1 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s
 GPU 1410MHz MEM 1512MHz TEMP  44°C FAN N/A% POW  67 / 300 W
 GPU[                                0%] MEM[||||||||||       22.999Gi/80.000Gi]
 Device 2 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s
 GPU 1410MHz MEM 1512MHz TEMP  44°C FAN N/A% POW  65 / 300 W
 GPU[                                0%] MEM[||||||||||       22.999Gi/80.000Gi]
 Device 3 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s
 GPU 1410MHz MEM 1512MHz TEMP  42°C FAN N/A% POW  64 / 300 W
 GPU[                                0%] MEM[||||||||||||     28.737Gi/80.000Gi]
 Device 4 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s
 GPU 1410MHz MEM 1512MHz TEMP  44°C FAN N/A% POW  66 / 300 W
 GPU[                                0%] MEM[||||||||||       22.999Gi/80.000Gi]
 Device 5 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s
 GPU 1410MHz MEM 1512MHz TEMP  46°C FAN N/A% POW  67 / 300 W
 GPU[                                0%] MEM[||||||||||       23.528Gi/80.000Gi]
 Device 6 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s
 GPU 1410MHz MEM 1512MHz TEMP  44°C FAN N/A% POW  63 / 300 W
 GPU[                                0%] MEM[||||||||||       22.999Gi/80.000Gi]
 Device 7 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s
 GPU 1410MHz MEM 1512MHz TEMP  49°C FAN N/A% POW  73 / 300 W
 GPU[                                0%] MEM[|||               8.389Gi/80.000Gi]

Here is what wget https://raw.githubusercontent.com/vllm-project/vllm/main/collect_env.py && python3 collect_env.py give:

Collecting environment information...
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A

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

Python version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.15.0-88-generic-x86_64-with-glibc2.35
Is CUDA available: N/A
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: 
GPU 0: NVIDIA A100 80GB PCIe
GPU 1: NVIDIA A100 80GB PCIe
GPU 2: NVIDIA A100 80GB PCIe
GPU 3: NVIDIA A100 80GB PCIe
GPU 4: NVIDIA A100 80GB PCIe
GPU 5: NVIDIA A100 80GB PCIe
GPU 6: NVIDIA A100 80GB PCIe
GPU 7: NVIDIA A100 80GB PCIe

Nvidia driver version: 525.147.05
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: N/A

CPU:
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Address sizes:                      46 bits physical, 48 bits virtual
Byte Order:                         Little Endian
CPU(s):                             96
On-line CPU(s) list:                0-95
Vendor ID:                          GenuineIntel
Model name:                         Intel(R) Xeon(R) Platinum 8268 CPU @ 2.90GHz
CPU family:                         6
Model:                              85
Thread(s) per core:                 2
Core(s) per socket:                 24
Socket(s):                          2
Stepping:                           7
CPU max MHz:                        3900.0000
CPU min MHz:                        1200.0000
BogoMIPS:                           5800.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 cdp_l3 invpcid_single intel_ppin 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 mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke avx512_vnni md_clear flush_l1d arch_capabilities
Virtualization:                     VT-x
L1d cache:                          1.5 MiB (48 instances)
L1i cache:                          1.5 MiB (48 instances)
L2 cache:                           48 MiB (48 instances)
L3 cache:                           71.5 MiB (2 instances)
NUMA node(s):                       2
NUMA node0 CPU(s):                  0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94
NUMA node1 CPU(s):                  1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95
Vulnerability Gather data sampling: Mitigation; Microcode
Vulnerability Itlb multihit:        KVM: Mitigation: VMX disabled
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed:             Mitigation; Enhanced IBRS
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 IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Mitigation; TSX disabled

Versions of relevant libraries:
[pip3] numpy==1.26.1
[conda] Could not collectROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: N/A
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0    GPU1    GPU2    GPU3    GPU4    GPU5    GPU6    GPU7    CPU Affinity    NUMA Affinity
GPU0     X      PIX     NODE    NODE    SYS     SYS     SYS     SYS     0,2,4,6,8,10    0
GPU1    PIX      X      NODE    NODE    SYS     SYS     SYS     SYS     0,2,4,6,8,10    0
GPU2    NODE    NODE     X      PIX     SYS     SYS     SYS     SYS     0,2,4,6,8,10    0
GPU3    NODE    NODE    PIX      X      SYS     SYS     SYS     SYS     0,2,4,6,8,10    0
GPU4    SYS     SYS     SYS     SYS      X      PIX     NODE    NODE    1,3,5,7,9,11    1
GPU5    SYS     SYS     SYS     SYS     PIX      X      NODE    NODE    1,3,5,7,9,11    1
GPU6    SYS     SYS     SYS     SYS     NODE    NODE     X      PIX     1,3,5,7,9,11    1
GPU7    SYS     SYS     SYS     SYS     NODE    NODE    PIX      X      1,3,5,7,9,11    1

Legend:

  X    = Self
  SYS  = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
  NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
  PHB  = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
  PXB  = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
  PIX  = Connection traversing at most a single PCIe bridge
  NV#  = Connection traversing a bonded set of # NVLinks

How would you like to use vllm

How should I proceed?

zhimin-z avatar May 05 '24 20:05 zhimin-z

# Clear any leftover memory from previous models
torch.cuda.set_device('cuda:3')
torch.cuda.empty_cache()

Try to remove these code, and run in a fresh new python script like python test.py with export CUDA_VISIBLE_DEVICES=3 ?

youkaichao avatar May 05 '24 20:05 youkaichao

# Clear any leftover memory from previous models
torch.cuda.set_device('cuda:3')
torch.cuda.empty_cache()

Try to remove these code, and run in a fresh new python script like python test.py with export CUDA_VISIBLE_DEVICES=3 ?

Thanks for your reply. I did it with what you suggested, but this time it throws OutOfMemoryError: CUDA out of memory. Tried to allocate 4.43 GiB. GPU, here is my GPU profiling:

Device 0 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s
 GPU 1410MHz MEM 1512MHz TEMP  49°C FAN N/A% POW  75 / 300 W
 GPU[||                              5%] MEM[|||||||||||||||||79.020Gi/80.000Gi]
 Device 1 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s
 GPU 1410MHz MEM 1512MHz TEMP  48°C FAN N/A% POW  70 / 300 W
 GPU[||                              5%] MEM[||||||||         18.719Gi/80.000Gi]
 Device 2 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 8.789 MiB/s
 GPU 1410MHz MEM 1512MHz TEMP  46°C FAN N/A% POW  67 / 300 W
 GPU[||                              6%] MEM[||||||||         19.594Gi/80.000Gi]
 Device 3 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 3.906 MiB/s TX: 0.000 KiB/s
 GPU 1410MHz MEM 1512MHz TEMP  44°C FAN N/A% POW 103 / 300 W
 GPU[||                              6%] MEM[||||||||||       22.547Gi/80.000Gi]
 Device 4 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s
 GPU 1410MHz MEM 1512MHz TEMP  48°C FAN N/A% POW  80 / 300 W
 GPU[||                              6%] MEM[|||||||          18.026Gi/80.000Gi]
 Device 5 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 1.953 MiB/s
 GPU 1410MHz MEM 1512MHz TEMP  46°C FAN N/A% POW  65 / 300 W
 GPU[||                              6%] MEM[||||||||         18.645Gi/80.000Gi]
 Device 6 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 41.99 MiB/s TX: 0.000 KiB/s
 GPU 1410MHz MEM 1512MHz TEMP  46°C FAN N/A% POW  91 / 300 W
 GPU[|                               4%] MEM[||||||||         19.895Gi/80.000Gi]
 Device 7 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s
 GPU 1410MHz MEM 1512MHz TEMP  50°C FAN N/A% POW  75 / 300 W
 GPU[|||                             9%] MEM[||||||||||||     28.717Gi/80.000Gi]

I also set export CUDA_VISIBLE_DEVICES=5 and changed code to llm = LLM(model="allenai/OLMo-1B-hf", device='cuda:5'), but it still throws: AssertionError: Error in memory profiling. This happens when the GPU memory was not properly cleaned up before initializing the vLLM instance. I am sure this server is shared across different students in our lab, but it is still weird that I cannot use any GPU for this starter code...

zhimin-z avatar May 05 '24 20:05 zhimin-z

when you have export CUDA_VISIBLE_DEVICES=5 , you don't need to set the device arg in LLM .

youkaichao avatar May 05 '24 20:05 youkaichao

export CUDA_VISIBLE_DEVICES=5

If I set export CUDA_VISIBLE_DEVICES=5 and use the following code:

from vllm import LLM, SamplingParams

prompts = [
    "Hello, my name is",
    "The president of the United States is",
    "The capital of France is",
    "The future of AI is",
]

sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
llm = LLM(model="allenai/OLMo-1B-hf")
outputs = llm.generate(prompts, sampling_params)

# Print the outputs.
for output in outputs:
    prompt = output.prompt
    generated_text = output.outputs[0].text
    print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")

Then it would throw OutOfMemoryError: CUDA out of memory. Tried to allocate 64.00 MiB. GPU error. I think only device 0 is full in memory, am I right?

zhimin-z avatar May 05 '24 20:05 zhimin-z

Your system driver or any other program takes too much memory:

Device 0 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s GPU 1410MHz MEM 1512MHz TEMP 49°C FAN N/A% POW 75 / 300 W GPU[|| 5%] MEM[|||||||||||||||||79.020Gi/80.000Gi] Device 1 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s GPU 1410MHz MEM 1512MHz TEMP 48°C FAN N/A% POW 70 / 300 W GPU[|| 5%] MEM[|||||||| 18.719Gi/80.000Gi] Device 2 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 8.789 MiB/s GPU 1410MHz MEM 1512MHz TEMP 46°C FAN N/A% POW 67 / 300 W GPU[|| 6%] MEM[|||||||| 19.594Gi/80.000Gi] Device 3 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 3.906 MiB/s TX: 0.000 KiB/s GPU 1410MHz MEM 1512MHz TEMP 44°C FAN N/A% POW 103 / 300 W GPU[|| 6%] MEM[|||||||||| 22.547Gi/80.000Gi] Device 4 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s GPU 1410MHz MEM 1512MHz TEMP 48°C FAN N/A% POW 80 / 300 W GPU[|| 6%] MEM[||||||| 18.026Gi/80.000Gi] Device 5 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 1.953 MiB/s GPU 1410MHz MEM 1512MHz TEMP 46°C FAN N/A% POW 65 / 300 W GPU[|| 6%] MEM[|||||||| 18.645Gi/80.000Gi] Device 6 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 41.99 MiB/s TX: 0.000 KiB/s GPU 1410MHz MEM 1512MHz TEMP 46°C FAN N/A% POW 91 / 300 W GPU[| 4%] MEM[|||||||| 19.895Gi/80.000Gi] Device 7 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s GPU 1410MHz MEM 1512MHz TEMP 50°C FAN N/A% POW 75 / 300 W GPU[||| 9%] MEM[|||||||||||| 28.717Gi/80.000Gi]

You need to set gpu_memory_utilization to a lower value, e.g. 0.7:

llm = LLM(model="allenai/OLMo-1B-hf", gpu_memory_utilization=0.7)

youkaichao avatar May 05 '24 20:05 youkaichao

Your system driver or any other program takes too much memory:

Device 0 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s GPU 1410MHz MEM 1512MHz TEMP 49°C FAN N/A% POW 75 / 300 W GPU[|| 5%] MEM[|||||||||||||||||79.020Gi/80.000Gi] Device 1 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s GPU 1410MHz MEM 1512MHz TEMP 48°C FAN N/A% POW 70 / 300 W GPU[|| 5%] MEM[|||||||| 18.719Gi/80.000Gi] Device 2 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 8.789 MiB/s GPU 1410MHz MEM 1512MHz TEMP 46°C FAN N/A% POW 67 / 300 W GPU[|| 6%] MEM[|||||||| 19.594Gi/80.000Gi] Device 3 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 3.906 MiB/s TX: 0.000 KiB/s GPU 1410MHz MEM 1512MHz TEMP 44°C FAN N/A% POW 103 / 300 W GPU[|| 6%] MEM[|||||||||| 22.547Gi/80.000Gi] Device 4 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s GPU 1410MHz MEM 1512MHz TEMP 48°C FAN N/A% POW 80 / 300 W GPU[|| 6%] MEM[||||||| 18.026Gi/80.000Gi] Device 5 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 1.953 MiB/s GPU 1410MHz MEM 1512MHz TEMP 46°C FAN N/A% POW 65 / 300 W GPU[|| 6%] MEM[|||||||| 18.645Gi/80.000Gi] Device 6 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 41.99 MiB/s TX: 0.000 KiB/s GPU 1410MHz MEM 1512MHz TEMP 46°C FAN N/A% POW 91 / 300 W GPU[| 4%] MEM[|||||||| 19.895Gi/80.000Gi] Device 7 [NVIDIA A100 80GB PCIe] PCIe GEN 3@16x RX: 0.000 KiB/s TX: 0.000 KiB/s GPU 1410MHz MEM 1512MHz TEMP 50°C FAN N/A% POW 75 / 300 W GPU[||| 9%] MEM[|||||||||||| 28.717Gi/80.000Gi]

You need to set gpu_memory_utilization to a lower value, e.g. 0.7:

llm = LLM(model="allenai/OLMo-1B-hf", gpu_memory_utilization=0.7)

I tried with a series of values from 0.05 to 0.9, but it always throws OutOfMemoryError: CUDA out of memory. Tried to allocate 64.00 MiB. GPU

Something wrong with my other configuration? I doubt I am still using device 0...

zhimin-z avatar May 05 '24 20:05 zhimin-z

I suggest asking for your admin of the server, to see if there is any unusual limit on your server, or ask admin for how to restrict your program in one specific GPU.

youkaichao avatar May 05 '24 21:05 youkaichao

Hi there, This is the latest error I am facing with using allenai/OLMo-1B-hf

image

I using the code is from the Quick Start Guide. I thought of creating a new issue. But, found this. Hence, replying to it.

prassr avatar May 06 '24 05:05 prassr

Do you try any other supported model? As said, the error is that this model is not supported.

youkaichao avatar May 06 '24 05:05 youkaichao

Ok, sir. Currently I am trying mistralai/Mixtral-8x7B-v0.1.

But, is giving access to gated repository is restricted error.

After getting the access, I am exporting access token from HF using environment variable HF_TOKEN. But, I am still having the same issue.

Would you please help me with this?

prassr avatar May 06 '24 05:05 prassr

Then you need to check you huggingface configuration. Sorry but I cannot help with this. You can reach out to huggingface community.

youkaichao avatar May 06 '24 05:05 youkaichao

Maybe start from a very small model (e.g. facebook/opt-125m) and see if it will run? And also, run nvidia-smi first to make sure the GPU you are using is not occupied.

KuntaiDu avatar May 09 '24 18:05 KuntaiDu

It is mysterious good now.

zhimin-z avatar May 09 '24 22:05 zhimin-z