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

chore(ml): set higher worker timeout for openvino #11174

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

mertalev
Copy link
Contributor

Description

The first time a model is loaded into OpenVINO, it must be compiled into OpenVINO format. This process is intensive and can take over 120s. Since it also takes up the GIL and hence doesn't allow the server to respond to requests, it can exceed gunicorn's worker timeout and cause crashes.

Increasing the default timeout for OpenVINO will prevent the service from crashing here.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jul 18, 2024
Copy link
Member

@bo0tzz bo0tzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Can we do this ahead of time before pushing the model to HF?

@mertalev mertalev merged commit 88f6208 into main Jul 18, 2024
23 checks passed
@mertalev mertalev deleted the chore/ml-increase-timeout branch July 18, 2024 14:51
@mertalev
Copy link
Contributor Author

Can we do this ahead of time before pushing the model to HF?

OpenVINO does device-specific optimizations so I'm not sure, but we can definitely look into it.

martabal added a commit to martabal/docker-immich that referenced this pull request Jul 18, 2024
@kszyd
Copy link

kszyd commented Jan 16, 2025

你好,我现在也遇到了同样的问题。设备是树莓派p4,通过omv-compose插件部署的immich,请问从哪个地方可以修改超时时间?能给出具体路径吗?我是一个新手。谢谢。

@mertalev
Copy link
Contributor Author

你好,我现在也遇到了同样的问题。设备是树莓派p4,通过omv-compose插件部署的immich,请问从哪个地方可以修改超时时间?能给出具体路径吗?我是一个新手。谢谢。

You can set MACHINE_LEARNING_WORKER_TIMEOUT=3000 in the .env file and redeploy Immich to give it more time. But the Raspberry Pi 4 might not be powerful enough to run machine learning. I recommend using remote machine learning if possible to process the data on a more powerful device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants