vllm [Bug]:多GPU推理(tensor_parallel_size=2)在Intel GPU上失败

brvekthn  于 2个月前  发布在  其他
关注(0)|答案(4)|浏览(26)

当前环境

Collecting environment information...
WARNING 07-23 19:11:42 _custom_ops.py:14] Failed to import from vllm._C with ModuleNotFoundError("No module named 'vllm._C'")
PyTorch version: 2.1.0.post1+cxx11.abi
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: openSUSE Leap 15.4 (x86_64)
GCC version: (Spack GCC) 11.4.0
Clang version: Could not collect
CMake version: version 3.30.1
Libc version: glibc-2.31

Python version: 3.10.14 (main, May  6 2024, 19:42:50) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.14.21-150400.24.100-default-x86_64-with-glibc2.31
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):                             208
On-line CPU(s) list:                0-207
Vendor ID:                          GenuineIntel
Model name:                         Intel (R) Xeon (R) CPU Max 9470C
CPU family:                         6
Model:                              143
Thread(s) per core:                 2
Core(s) per socket:                 52
Socket(s):                          2
Stepping:                           8
Frequency boost:                    enabled
CPU max MHz:                        2001.0000
CPU min MHz:                        800.0000
BogoMIPS:                           4000.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 tsc_known_freq 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 cat_l2 cdp_l3 invpcid_single cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm 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 avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr avx512_fp16 amx_tile flush_l1d arch_capabilities
Virtualization:                     VT-x
L1d cache:                          4.9 MiB (104 instances)
L1i cache:                          3.3 MiB (104 instances)
L2 cache:                           208 MiB (104 instances)
L3 cache:                           210 MiB (2 instances)
NUMA node(s):                       4
NUMA node0 CPU(s):                  0-51,104-155
NUMA node1 CPU(s):                  52-103,156-207
NUMA node2 CPU(s):
NUMA node3 CPU(s):
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        Not affected
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      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
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

Versions of relevant libraries:
[pip3] intel-extension-for-pytorch==2.1.30a0
[pip3] numpy==1.26.4
[pip3] torch==2.1.0.post1+cxx11.abi
[pip3] transformers==4.43.1
[pip3] triton==2.1.0
[conda] intel-extension-for-pytorch 2.1.30a0                 pypi_0    pypi
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] torch                     2.1.0.post1+cxx11.abi          pypi_0    pypi
[conda] transformers              4.43.1                   pypi_0    pypi
[conda] triton                    2.1.0                    pypi_0    pypi
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.5.3.post1
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
Could not collect

sycl-ls 获取的 Intel GPU 信息

[ext_oneapi_level_zero:gpu:0] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.28202]
[ext_oneapi_level_zero:gpu:1] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.28202]
[ext_oneapi_level_zero:gpu:2] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.28202]
[ext_oneapi_level_zero:gpu:3] Intel(R) Level-Zero, Intel(R) Data Center GPU Max 1550 1.3 [1.3.28202]

🐛 描述错误

offline_inference.py 示例在 tensor_parallel_size=2 上崩溃。

from vllm import LLM, SamplingParams

# Sample prompts.
prompts = [
    "Hello, my name is",
    "The president of the United States is",
    "The capital of France is",
    "The future of AI is",
]
# Create a sampling params object.
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)

# Create an LLM.
llm = LLM(model="facebook/opt-125m", tensor_parallel_size=2)
# Generate texts from the prompts. The output is a list of RequestOutput objects
# that contain the prompt, generated text, and other information.
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}")

示例输出

WARNING 07-23 19:14:08 _custom_ops.py:14] Failed to import from vllm._C with ModuleNotFoundError("No module named 'vllm._C'")
INFO 07-23 19:14:11 config.py:715] Defaulting to use ray for distributed inference
2024-07-23 19:14:13,353	INFO worker.py:1788 -- Started a local Ray instance.
INFO 07-23 19:14:16 llm_engine.py:176] Initializing an LLM engine (v0.5.3.post1) with config: model='facebook/opt-125m', speculative_config=None, tokenizer='facebook/opt-125m', skip_tokenizer_init=False, tokenizer_mode=auto, revision=None, rope_scaling=None, rope_theta=None, tokenizer_revision=None, trust_remote_code=False, dtype=torch.float16, max_seq_len=2048, download_dir=None, load_format=LoadFormat.AUTO, tensor_parallel_size=2, pipeline_parallel_size=1, disable_custom_all_reduce=False, quantization=None, enforce_eager=False, kv_cache_dtype=auto, quantization_param_path=None, device_config=xpu, decoding_config=DecodingConfig(guided_decoding_backend='outlines'), observability_config=ObservabilityConfig(otlp_traces_endpoint=None), seed=0, served_model_name=facebook/opt-125m, use_v2_block_manager=False, enable_prefix_caching=False)
(pid=100697) WARNING 07-23 19:14:19 _custom_ops.py:14] Failed to import from vllm._C with ModuleNotFoundError("No module named 'vllm._C'")
Traceback (most recent call last):
  File "/home/raffenet/proj/vllm/examples/offline_inference.py", line 14, in <module>
    llm = LLM(model="facebook/opt-125m", tensor_parallel_size=2)
  File "/home/raffenet/.conda/envs/vllm/lib/python3.10/site-packages/vllm-0.5.3.post1+xpu-py3.10.egg/vllm/entrypoints/llm.py", line 155, in __init__
    self.llm_engine = LLMEngine.from_engine_args(
  File "/home/raffenet/.conda/envs/vllm/lib/python3.10/site-packages/vllm-0.5.3.post1+xpu-py3.10.egg/vllm/engine/llm_engine.py", line 441, in from_engine_args
    engine = cls(
  File "/home/raffenet/.conda/envs/vllm/lib/python3.10/site-packages/vllm-0.5.3.post1+xpu-py3.10.egg/vllm/engine/llm_engine.py", line 251, in __init__
    self.model_executor = executor_class(
  File "/home/raffenet/.conda/envs/vllm/lib/python3.10/site-packages/vllm-0.5.3.post1+xpu-py3.10.egg/vllm/executor/ray_xpu_executor.py", line 75, in __init__
    self._init_workers_ray(placement_group)
  File "/home/raffenet/.conda/envs/vllm/lib/python3.10/site-packages/vllm-0.5.3.post1+xpu-py3.10.egg/vllm/executor/ray_xpu_executor.py", line 168, in _init_workers_ray
    worker_node_and_gpu_ids = self._run_workers("get_node_and_gpu_ids",
  File "/home/raffenet/.conda/envs/vllm/lib/python3.10/site-packages/vllm-0.5.3.post1+xpu-py3.10.egg/vllm/executor/ray_xpu_executor.py", line 323, in _run_workers
    return driver_worker_output + ray_worker_outputs
TypeError: can only concatenate tuple (not "list") to tuple
(pid=100897) WARNING 07-23 19:14:23 _custom_ops.py:14] Failed to import from vllm._C with ModuleNotFoundError("No module named 'vllm._C'")

在错误发生时手动打印正在连接的值:

driver_worker_output: ('1e74c71e6f5268f65d01ec726894b8dc9910b8b191bad2cdbb2f6e15', [0])
ray_worker_outputs: [('1e74c71e6f5268f65d01ec726894b8dc9910b8b191bad2cdbb2f6e15', [1])]
a6b3iqyw

a6b3iqyw1#

翻译结果为:此外,如果我将错误的返回值修改为我认为它期望的值,我在后续执行过程中会遇到这个回溯。

$x_{1a0b_1^x}$

fcy6dtqo

fcy6dtqo2#

@jikunshang 这些问题在 #5685 中得到了解决吗?

k2arahey

k2arahey3#

@jikunshang 这些问题在 #5685 中得到了解决吗?
是的,我已经修复了Tensor并行支持问题,请尝试这个 PR。

mkshixfv

mkshixfv4#

@jikunshang 这些问题在 #5685 中得到了解决吗?
是的,我已经修复了Tensor并行支持问题,请尝试这个PR。
我在我的系统上测试过,它确实可以在tp>1的情况下工作。谢谢!我希望它可以合并并在未来的版本中提供。

相关问题