ipex-llm icon indicating copy to clipboard operation
ipex-llm copied to clipboard

Too many python process when running python/llm/example/GPU/HuggingFace/LLM/codeshell/server.py

Open wluo1007 opened this issue 1 year ago • 2 comments

Hi, When running python/llm/example/GPU/HuggingFace/LLM/codeshell/server.py

python server.py --checkpoint-path /home/user/Qwen2-7B-Instruct --device xpu --multi-turn --max-context 1024

40+ python processes would be running, ps aux | grep "python" image

In the code, the uvicorn workers is set to 1, not sure why so many process were running. uvicorn.run(app, host=args.server_name, port=args.server_port, workers=1)

wluo1007 avatar Aug 22 '24 09:08 wluo1007

We have produced this issue and are looking into it. Will keep you updated as soon as possible.

hkvision avatar Aug 26 '24 02:08 hkvision

Hi wluo1007, We have looked into the issue. The current conclusion is that ipex-llm will import intel_extension_for_pytorch and just only importing intel_extension_for_pytorch will cause this issue. The following is a quick example to verify our discovery

import uvicorn
import intel_extension_for_pytorch as ipex
from fastapi import FastAPI

app = FastAPI()

if __name__ == "__main__":
    uvicorn.run(app, workers=1)

Running the above code will reproduce the many process issue, while commenting out import intel_extension_for_pytorch as ipex will only have one main process.

cranechu0131 avatar Aug 28 '24 02:08 cranechu0131