Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Some situations encountered after enabling multiple workers #438

Closed
josangmi opened this issue Jul 31, 2024 · 3 comments
Closed

[BUG] Some situations encountered after enabling multiple workers #438

josangmi opened this issue Jul 31, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@josangmi
Copy link

Feel free to ask any kind of questions in the issues page, but please use English since other users may find your questions valuable.

Describe the bug
A clear and concise description of what the bug is.
直接用 --workers 2 会出现
WARNING: You must pass the application as an import string to enable 'reload' or 'workers' 然后会退出进程,
image

To Reproduce
Steps to reproduce the behavior:
需要修改:
原代码: uvicorn.run(app, host=host, port=int(port), workers=args.workers, log_level="info")
修改后代码: uvicorn.run("tools.api:app", host=host, port=int(port), workers=args.workers, log_level="info")
然后就可以启动了。
但是并没有加载两个模型,理解不能同时进行推理,如果希望加载模型同时推理的话,有优化的办法吗?
还有多显卡的话,好像不能device=auto
Expected behavior
A clear and concise description of what you expected to happen.
多workers 启动之后使用会出现
image
接下来不会改了。 谢谢。
Screenshots / log
If applicable, add screenshots / logs to help explain your problem.

Additional context
Add any other context about the problem here.

@josangmi josangmi added the bug Something isn't working label Jul 31, 2024
@PoTaTo-Mika
Copy link
Collaborator

可以尝试单机多端口进行并发。

@keepgoingwang
Copy link

keepgoingwang commented Aug 20, 2024

原因有可能是开启多进程后,args参数是由主进程获取的,子进程无法获取主进程变量。不知道后续是否会修补这个bug

@Stardust-minus Stardust-minus changed the title [BUG]开启多workers后遇到的一些状况 [BUG] Some situations encountered after enabling multiple workers Sep 9, 2024
@Stardust-minus
Copy link
Member

#515 Change title to English.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants