Too many python process when running python/llm/example/GPU/HuggingFace/LLM/codeshell/server.py
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"
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)
We have produced this issue and are looking into it. Will keep you updated as soon as possible.
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.