[Bug]: Engine Core initialization failed. See root cause above
Your current environment
Colab notebooks, A100
🐛 Describe the bug
I have no idea what's wrong. This model works with normal pipeline, but fails with vllm. It was saved to 16 bit and built off Unsloth/Llama3.18b Instruct
This works -> from transformers import pipeline prompt = ( "Do aliens suffer?" ) gen = pipeline("text-generation", model=best_model, tokenizer=tokenizer) print(gen(prompt, max_new_tokens=256, do_sample=True, temperature=0.7)[0]["generated_text"])
This fails-> It does not give me a root cause this error is all I see after it hangs for about 3 minutes
INFO 05-03 23:45:17 [config.py:717] This model supports multiple tasks: {'generate', 'reward', 'classify', 'score', 'embed'}. Defaulting to 'generate'.
INFO 05-03 23:45:17 [config.py:2003] Chunked prefill is enabled with max_num_batched_tokens=8192.
WARNING 05-03 23:45:19 [utils.py:2382] We must use the spawn multiprocessing start method. Overriding VLLM_WORKER_MULTIPROC_METHOD to 'spawn'. See https://docs.vllm.ai/en/latest/getting_started/troubleshooting.html#python-multiprocessing for more information. Reason: CUDA is initialized
RuntimeError Traceback (most recent call last)
8 frames /usr/local/lib/python3.11/dist-packages/vllm/v1/engine/core_client.py in _wait_for_engine_startup(self) 428 if len(events) > 1 or events[0][0] != sync_input_socket: 429 # One of the core processes exited. --> 430 raise RuntimeError("Engine core initialization failed. " 431 "See root cause above.") 432
RuntimeError: Engine core initialization failed. See root cause above.
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, which can answer lots of frequently asked questions.
/usr/local/lib/python3.11/dist-packages/vllm/utils.py in inner(*args, **kwargs) 1159 ) 1160 -> 1161 return fn(*args, **kwargs) 1162 1163 return inner # type: ignore
/usr/local/lib/python3.11/dist-packages/vllm/entrypoints/llm.py in init(self, model, tokenizer, tokenizer_mode, skip_tokenizer_init, trust_remote_code, allowed_local_media_path, tensor_parallel_size, dtype, quantization, revision, tokenizer_revision, seed, gpu_memory_utilization, swap_space, cpu_offload_gb, enforce_eager, max_seq_len_to_capture, disable_custom_all_reduce, disable_async_output_proc, hf_token, hf_overrides, mm_processor_kwargs, task, override_pooler_config, compilation_config, **kwargs) 245 246 # Create the Engine (autoselects V0 vs V1) --> 247 self.llm_engine = LLMEngine.from_engine_args( 248 engine_args=engine_args, usage_context=UsageContext.LLM_CLASS) 249 self.engine_class = type(self.llm_engine)
/usr/local/lib/python3.11/dist-packages/vllm/engine/llm_engine.py in from_engine_args(cls, engine_args, usage_context, stat_loggers) 508 engine_cls = V1LLMEngine 509 --> 510 return engine_cls.from_vllm_config( 511 vllm_config=vllm_config, 512 usage_context=usage_context,
/usr/local/lib/python3.11/dist-packages/vllm/v1/engine/llm_engine.py in from_vllm_config(cls, vllm_config, usage_context, stat_loggers, disable_log_stats) 110 disable_log_stats: bool = False, 111 ) -> "LLMEngine": --> 112 return cls(vllm_config=vllm_config, 113 executor_class=Executor.get_class(vllm_config), 114 log_stats=(not disable_log_stats),
/usr/local/lib/python3.11/dist-packages/vllm/v1/engine/llm_engine.py in init(self, vllm_config, executor_class, log_stats, usage_context, stat_loggers, mm_registry, use_cached_outputs, multiprocess_mode) 90 91 # EngineCore (gets EngineCoreRequests and gives EngineCoreOutputs) ---> 92 self.engine_core = EngineCoreClient.make_client( 93 multiprocess_mode=multiprocess_mode, 94 asyncio_mode=False,
/usr/local/lib/python3.11/dist-packages/vllm/v1/engine/core_client.py in make_client(multiprocess_mode, asyncio_mode, vllm_config, executor_class, log_stats) 71 72 if multiprocess_mode and not asyncio_mode: ---> 73 return SyncMPClient(vllm_config, executor_class, log_stats) 74 75 return InprocClient(vllm_config, executor_class, log_stats)
/usr/local/lib/python3.11/dist-packages/vllm/v1/engine/core_client.py in init(self, vllm_config, executor_class, log_stats) 492 def init(self, vllm_config: VllmConfig, executor_class: type[Executor], 493 log_stats: bool): --> 494 super().init( 495 asyncio_mode=False, 496 vllm_config=vllm_config,
/usr/local/lib/python3.11/dist-packages/vllm/v1/engine/core_client.py in init(self, asyncio_mode, vllm_config, executor_class, log_stats) 396 397 # Wait for engine core process(es) to start. --> 398 self._wait_for_engine_startup() 399 400 self.utility_results: dict[int, AnyFuture] = {}
/usr/local/lib/python3.11/dist-packages/vllm/v1/engine/core_client.py in _wait_for_engine_startup(self) 428 if len(events) > 1 or events[0][0] != sync_input_socket: 429 # One of the core processes exited. --> 430 raise RuntimeError("Engine core initialization failed. " 431 "See root cause above.") 432
These are my models files
Could the log be reformatted for less readability
Could the log be reformatted for less readability
No I can't reformat the logs... This is how they were given...? Do you know the cause of the issue?
In fact, it's not very clear about your env. However, Try to use this env var VLLM_WORKER_MULTIPROC_METHOD=spawn
In fact, it's not very clear about your env. However, Try to use this env var
VLLM_WORKER_MULTIPROC_METHOD=spawn
Ok that worked after a few minutes. Do you know what's wrong with it?
Ok it worked once but now every time I try it still fails
INFO 05-04 17:04:18 [config.py:717] This model supports multiple tasks: {'score', 'generate', 'reward', 'classify', 'embed'}. Defaulting to 'generate'. INFO 05-04 17:04:18 [config.py:2003] Chunked prefill is enabled with max_num_batched_tokens=8192.
RuntimeError Traceback (most recent call last)
8 frames /usr/local/lib/python3.11/dist-packages/vllm/utils.py in inner(*args, **kwargs) 1159 ) 1160 -> 1161 return fn(*args, **kwargs) 1162 1163 return inner # type: ignore
/usr/local/lib/python3.11/dist-packages/vllm/entrypoints/llm.py in init(self, model, tokenizer, tokenizer_mode, skip_tokenizer_init, trust_remote_code, allowed_local_media_path, tensor_parallel_size, dtype, quantization, revision, tokenizer_revision, seed, gpu_memory_utilization, swap_space, cpu_offload_gb, enforce_eager, max_seq_len_to_capture, disable_custom_all_reduce, disable_async_output_proc, hf_token, hf_overrides, mm_processor_kwargs, task, override_pooler_config, compilation_config, **kwargs) 245 246 # Create the Engine (autoselects V0 vs V1) --> 247 self.llm_engine = LLMEngine.from_engine_args( 248 engine_args=engine_args, usage_context=UsageContext.LLM_CLASS) 249 self.engine_class = type(self.llm_engine)
/usr/local/lib/python3.11/dist-packages/vllm/engine/llm_engine.py in from_engine_args(cls, engine_args, usage_context, stat_loggers) 508 engine_cls = V1LLMEngine 509 --> 510 return engine_cls.from_vllm_config( 511 vllm_config=vllm_config, 512 usage_context=usage_context,
/usr/local/lib/python3.11/dist-packages/vllm/v1/engine/llm_engine.py in from_vllm_config(cls, vllm_config, usage_context, stat_loggers, disable_log_stats) 110 disable_log_stats: bool = False, 111 ) -> "LLMEngine": --> 112 return cls(vllm_config=vllm_config, 113 executor_class=Executor.get_class(vllm_config), 114 log_stats=(not disable_log_stats),
/usr/local/lib/python3.11/dist-packages/vllm/v1/engine/llm_engine.py in init(self, vllm_config, executor_class, log_stats, usage_context, stat_loggers, mm_registry, use_cached_outputs, multiprocess_mode) 90 91 # EngineCore (gets EngineCoreRequests and gives EngineCoreOutputs) ---> 92 self.engine_core = EngineCoreClient.make_client( 93 multiprocess_mode=multiprocess_mode, 94 asyncio_mode=False,
/usr/local/lib/python3.11/dist-packages/vllm/v1/engine/core_client.py in make_client(multiprocess_mode, asyncio_mode, vllm_config, executor_class, log_stats) 71 72 if multiprocess_mode and not asyncio_mode: ---> 73 return SyncMPClient(vllm_config, executor_class, log_stats) 74 75 return InprocClient(vllm_config, executor_class, log_stats)
/usr/local/lib/python3.11/dist-packages/vllm/v1/engine/core_client.py in init(self, vllm_config, executor_class, log_stats) 492 def init(self, vllm_config: VllmConfig, executor_class: type[Executor], 493 log_stats: bool): --> 494 super().init( 495 asyncio_mode=False, 496 vllm_config=vllm_config,
/usr/local/lib/python3.11/dist-packages/vllm/v1/engine/core_client.py in init(self, asyncio_mode, vllm_config, executor_class, log_stats) 396 397 # Wait for engine core process(es) to start. --> 398 self._wait_for_engine_startup() 399 400 self.utility_results: dict[int, AnyFuture] = {}
/usr/local/lib/python3.11/dist-packages/vllm/v1/engine/core_client.py in _wait_for_engine_startup(self) 428 if len(events) > 1 or events[0][0] != sync_input_socket: 429 # One of the core processes exited. --> 430 raise RuntimeError("Engine core initialization failed. " 431 "See root cause above.") 432
Just FYI there is nothing else in my environment. It's a colab notebook on an A100 and I just installed vllm and transformers then tried to make vllm work...
Also @jeremyzhang866 this happens with the official Unsloth model too. https://huggingface.co/unsloth/Meta-Llama-3.1-8B
@DarkLight1337 please take a look?
Which version of vLLM are you using? I suggest updating to the latest version as the error logging has improved
Same error here, using vllm Version: 0.8.5
Can you show the error logs?
Traceback (most recent call last):
File "/home/ucabpag/reasoning-agents/test_rollouts.py", line 59, in main
asyncio.run(async_main(config))
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/ucabpag/reasoning-agents/test_rollouts.py", line 42, in async_main
eval_results = ray.get(experience_manager.run_evaluation.remote(0))
File "/usr/local/lib/python3.10/dist-packages/ray/_private/auto_init_hook.py", line 21, in auto_init_wrapper
return fn(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/ray/_private/client_mode_hook.py", line 103, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/ray/_private/worker.py", line 2661, in get
values, debugger_breakpoint = worker.get_objects(object_refs, timeout=timeout)
File "/usr/local/lib/python3.10/dist-packages/ray/_private/worker.py", line 871, in get_objects
raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(ActorDiedError): [36mray::ExperienceManager.run_evaluation()[39m (pid=450829, ip=193.60.225.51, actor_id=ba8fbb5b687b920b49a1399201000000, repr=<train_balrog.experience_manager.ExperienceManager object at 0xffd986562fe0>)
File "/home/ucabpag/reasoning-agents/train_balrog/experience_manager.py", line 500, in run_evaluation
episode_log = ray.get(done_future)
ray.exceptions.RayTaskError(ActorDiedError): [36mray::EvalWorker.evaluate_episode()[39m (pid=453305, ip=193.60.225.51, actor_id=dfc4c5c09c8b036cd1ea38d401000000, repr=<train_balrog.experience_manager.EvalWorker object at 0xffd994b51120>)
File "/home/ucabpag/reasoning-agents/train_balrog/experience_manager.py", line 243, in evaluate_episode
step_return = self.env_runner.step()
File "/home/ucabpag/reasoning-agents/train_balrog/experience_manager.py", line 96, in step
action, action_token_ids, prompt_token_ids, logprob = self.agent.act(self.obs, self.prev_action)
File "/home/ucabpag/reasoning-agents/train_balrog/agents/plan.py", line 327, in act
output, action_token_ids, prompt_token_ids, logprob = self._generate_output(messages, plan_instruction)
File "/home/ucabpag/reasoning-agents/train_balrog/agents/plan.py", line 278, in _generate_output
output, action_token_ids, prompt_token_ids, logprob = self.vllm_manager.generate(
File "/home/ucabpag/reasoning-agents/train_balrog/vLLM_manager.py", line 398, in generate
output = ray.get(ref)[0]
ray.exceptions.ActorDiedError: The actor died because of an error raised in its creation task, [36mray::LLMRayActor.__init__()[39m (pid=450773, ip=193.60.225.51, actor_id=91016bd096bb15954d21878c01000000, repr=<train_balrog.vLLM_manager.LLMRayActor object at 0xffd9b4792ce0>)
File "/home/ucabpag/reasoning-agents/train_balrog/vLLM_manager.py", line 155, in __init__
self.llm = vllm.LLM(*args, **kwargs)
File "/root/.local/lib/python3.10/site-packages/vllm/utils.py", line 1161, in inner
return fn(*args, **kwargs)
File "/root/.local/lib/python3.10/site-packages/vllm/entrypoints/llm.py", line 247, in __init__
self.llm_engine = LLMEngine.from_engine_args(
File "/root/.local/lib/python3.10/site-packages/vllm/engine/llm_engine.py", line 510, in from_engine_args
return engine_cls.from_vllm_config(
File "/root/.local/lib/python3.10/site-packages/vllm/v1/engine/llm_engine.py", line 112, in from_vllm_config
return cls(vllm_config=vllm_config,
File "/root/.local/lib/python3.10/site-packages/vllm/v1/engine/llm_engine.py", line 92, in __init__
self.engine_core = EngineCoreClient.make_client(
File "/root/.local/lib/python3.10/site-packages/vllm/v1/engine/core_client.py", line 73, in make_client
return SyncMPClient(vllm_config, executor_class, log_stats)
File "/root/.local/lib/python3.10/site-packages/vllm/v1/engine/core_client.py", line 494, in __init__
super().__init__(
File "/root/.local/lib/python3.10/site-packages/vllm/v1/engine/core_client.py", line 398, in __init__
self._wait_for_engine_startup()
File "/root/.local/lib/python3.10/site-packages/vllm/v1/engine/core_client.py", line 430, in _wait_for_engine_startup
raise RuntimeError("Engine core initialization failed. "
RuntimeError: Engine core initialization failed. See root cause above.
Can you show how you're initializing vLLM? It doesn't look like a standard way
@DarkLight1337 I'm running a very vanilla instance
llm=LLM(model="CompassioninMachineLearning/May3_missing", tokenizer="CompassioninMachineLearning/May3_missing", dtype='bfloat16')
What type of model is that? Also I see you using ray, but you didn't enable parallelism in vLLM.
It's a custom model trained on Unsloth/Llama3.1. 8b instruct which had the exact same issue. I really didn't do anything custom just use vllm out of the box.
On Tue, May 6, 2025, 19:46 Cyrus Leung @.***> wrote:
DarkLight1337 left a comment (vllm-project/vllm#17618) https://github.com/vllm-project/vllm/issues/17618#issuecomment-2856859269
What type of model is that? Also I see you using ray, but you didn't enable parallelism in vLLM.
— Reply to this email directly, view it on GitHub https://github.com/vllm-project/vllm/issues/17618#issuecomment-2856859269, or unsubscribe https://github.com/notifications/unsubscribe-auth/BLCYVMG7WG67QTUPOOHNSQD25FXX5AVCNFSM6AAAAAB4MHSIBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQNJWHA2TSMRWHE . You are receiving this because you authored the thread.Message ID: @.***>
I suggest you try to run vLLM directly first without any of your wrapper code. Then show the error logs again if they occur.
Hi @DarkLight1337 This is a confirmed issue now affecting multiple people. My model is public and so is unlsoth https://huggingface.co/unsloth/Meta-Llama-3.1-8B-Instruct. Can you please replicate this? I don't know how to run vllm on colab without wrapping it I just don't want this ongoing error to keep persisting because I am slow with troubleshooting.