5.6. Python マルチプロセスエラー
Python マルチプロセスの警告またはランタイムエラーが発生する可能性があります。これは、コードが Python マルチプロセス用に適切に構造化されていない場合に発生する可能性があります。以下は、コンソールの警告の例です。
WARNING 12-11 14:50:37 multiproc_worker_utils.py:281] CUDA was previously initialized. We must use the `spawn` multiprocessing start method. Setting VLLM_WORKER_MULTIPROC_METHOD to 'spawn'. See https://docs.vllm.ai/en/latest/getting_started/troubleshooting.html#python-multiprocessing for more information.以下は Python ランタイムエラーの例です。
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ランタイムエラーを解決するには、Python コードを更新し、
if__name__ = "__main__":ブロックの背後でvllmの使用を保護します。以下に例を示します。if __name__ = "__main__": import vllm llm = vllm.LLM(...)