microsoft / microsoft/MInference

[Bug]: Failed to launch vllm while import MInference

Open
#178 3 comments 0 reactions 1 assignee View on GitHub

@iofu728 is already working on this.

Since Aug 11, 2025.

bug
Dominant language
Python
Stars
1.2k
Forks
82
Avg merge
1d 18h
Merged PRs (30d)
1

Description

Describe the bug
  1. When starting example/run_vllm.py, an error occurred stating that vllm failed to launch. After commenting out import Minference, vllm was able to run normally.

2.Even though vllm is already installed, I still receive the message: "To benefit from fast kernel implementations, we recommend installing SGLang or vllm."

3.Following the minference official instructions, I tried to install flash attention with these commands:

pip install "vllm>=0.9.0"
pip install git+https://github.com/vllm-project/flash-attention.

The second step attempted to install torch==2.4.0, but vllm==0.9.0 requires torch==2.7.0. Therefore, I used the official flash_attn==2.8.2 instead.

Steps to reproduce

No response

Expected Behavior

No response

Logs

root@autodl-container-23f447a835-a0cb773a:/MInference-triangle/MInference-main/examples# python run_vllm.py
INFO 08-08 17:55:42 [init.py:244] Automatically detected platform cuda.
To benefit from fast kernel implementations, we recommend installing SGLang or vllm.
INFO 08-08 17:55:50 [config.py:841] This model supports multiple tasks: {'embed', 'generate', 'reward', 'classify'}. Defaulting to 'generate'.
INFO 08-08 17:55:50 [config.py:1472] Using max model len 32768
INFO 08-08 17:55:51 [config.py:2285] Chunked prefill is enabled with max_num_batched_tokens=8192.
WARNING 08-08 17:55:51 [cuda.py:102] To see benefits of async output processing, enable CUDA graph. Since, enforce-eager is enabled, async output processor cannot be used
WARNING 08-08 17:55:51 [init.py:2662] We must use the spawn multiprocessing start method. Overriding VLLM_WORKER_MULTIPROC_METHOD to 'spawn'. See https://docs.vllm.ai/en/latest/usage/troubleshooting.html#python-multiprocessing for more information. Reason: CUDA is initialized
INFO 08-08 17:55:55 [init.py:244] Automatically detected platform cuda.
To benefit from fast kernel implementations, we recommend installing SGLang or vllm.
INFO 08-08 17:56:04 [config.py:841] This model supports multiple tasks: {'classify', 'generate', 'embed', 'reward'}. Defaulting to 'generate'.
INFO 08-08 17:56:04 [config.py:1472] Using max model len 32768
INFO 08-08 17:56:04 [config.py:2285] Chunked prefill is enabled with max_num_batched_tokens=8192.
WARNING 08-08 17:56:04 [cuda.py:102] To see benefits of async output processing, enable CUDA graph. Since, enforce-eager is enabled, async output processor cannot be used
Traceback (most recent call last):
File "", line 1, in
File "/root/miniconda3/lib/python3.12/multiprocessing/spawn.py", line 122, in spawn_main
exitcode = _main(fd, parent_sentinel)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/multiprocessing/spawn.py", line 131, in _main
prepare(preparation_data)
File "/root/miniconda3/lib/python3.12/multiprocessing/spawn.py", line 246, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/root/miniconda3/lib/python3.12/multiprocessing/spawn.py", line 297, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 286, in run_path
File "", line 98, in _run_module_code
File "", line 88, in _run_code
File "/MInference-triangle/MInference-main/examples/run_vllm.py", line 22, in
llm = LLM(
^^^^
File "/root/miniconda3/lib/python3.12/site-packages/vllm/entrypoints/llm.py", line 271, in init
self.llm_engine = LLMEngine.from_engine_args(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/vllm/v1/engine/llm_engine.py", line 150, in from_engine_args
return cls(vllm_config=vllm_config,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/vllm/v1/engine/llm_engine.py", line 101, in init
self.engine_core = EngineCoreClient.make_client(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 75, in make_client
return SyncMPClient(vllm_config, executor_class, log_stats)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 503, in init
super().init(
File "/root/miniconda3/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 403, in init
with launch_core_engines(vllm_config, executor_class,
File "/root/miniconda3/lib/python3.12/contextlib.py", line 137, in enter
return next(self.gen)
^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/vllm/v1/engine/utils.py", line 417, in launch_core_engines
local_engine_manager = CoreEngineProcManager(
^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/vllm/v1/engine/utils.py", line 121, in init
proc.start()
File "/root/miniconda3/lib/python3.12/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/multiprocessing/context.py", line 289, in _Popen
return Popen(process_obj)
^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/multiprocessing/popen_spawn_posix.py", line 32, in init
super().init(process_obj)
File "/root/miniconda3/lib/python3.12/multiprocessing/popen_fork.py", line 19, in init
self._launch(process_obj)
File "/root/miniconda3/lib/python3.12/multiprocessing/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/multiprocessing/spawn.py", line 164, in get_preparation_data
_check_not_importing_main()
File "/root/miniconda3/lib/python3.12/multiprocessing/spawn.py", line 140, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

    To fix this issue, refer to the "Safe importing of main module"
    section in https://docs.python.org/3/library/multiprocessing.html

Traceback (most recent call last):
File "/MInference-triangle/MInference-main/examples/run_vllm.py", line 22, in
llm = LLM(
^^^^
File "/root/miniconda3/lib/python3.12/site-packages/vllm/entrypoints/llm.py", line 271, in init
self.llm_engine = LLMEngine.from_engine_args(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/vllm/engine/llm_engine.py", line 501, in from_engine_args
return engine_cls.from_vllm_config(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/vllm/v1/engine/llm_engine.py", line 124, in from_vllm_config
return cls(vllm_config=vllm_config,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/vllm/v1/engine/llm_engine.py", line 101, in init
self.engine_core = EngineCoreClient.make_client(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 75, in make_client
return SyncMPClient(vllm_config, executor_class, log_stats)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 503, in init
super().init(
File "/root/miniconda3/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 403, in init
with launch_core_engines(vllm_config, executor_class,
File "/root/miniconda3/lib/python3.12/contextlib.py", line 144, in exit
next(self.gen)
File "/root/miniconda3/lib/python3.12/site-packages/vllm/v1/engine/utils.py", line 434, in launch_core_engines
wait_for_engine_startup(
File "/root/miniconda3/lib/python3.12/site-packages/vllm/v1/engine/utils.py", line 484, in wait_for_engine_startup
raise RuntimeError("Engine core initialization failed. "
RuntimeError: Engine core initialization failed. See root cause above. Failed core proc(s): {}
root@autodl-container-23f447a835-a0cb773a:/MInference-triangle/MInference-main/examples#

Additional Information

Minference: latest with triangle
vllm: 0.9.0
torch:2.7.0+cu128
flash_attn:2.8.2 from https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.2/flash_attn-2.8.2+cu12torch2.7cxx11abiFALSE-cp312-cp312-linux_x86_64.whl
python version:3.12.3

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.