Hi, I used to step into python code via pdb/pudb for debug purpose, but it does not work with vllm.
vllm/vllm/v1/engine/core_client.py at main · vllm-project/vllm · GitHub creates EngineCore process and re-direct the IO, it makes pdb/pudb not work.
import pudb
pudb.set_trace()
Except the print method which is not effective, could you share how to step into the python code of EngineCore process, I’d debug within it, thanks.
You cannot directly use pdb or pudb to step into the EngineCore process in vLLM, because EngineCore runs in a separate process and its IO is redirected, which breaks interactive debuggers like pdb/pudb. This limitation is acknowledged in the vLLM community, and there is no officially supported way to attach pdb/pudb to the EngineCore process as of now. The only workaround mentioned is to use print statements, but this is not ideal for complex debugging tasks. For multi-process debugging, some users suggest using tools like forked-pdb, but this is not documented or officially supported by vLLM (github issue 9602).
Would you like more detail on alternative debugging strategies or how to use forked-pdb in this context?
Sources:
1 Like