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

For live reload, retry if model is not ready #213

Merged
merged 1 commit into from
Feb 8, 2023

Conversation

pankajroark
Copy link
Collaborator

We were retrying if we couldn't connect to the inference server, but not when we could connect but the model wasn't ready. We do that now. The effect of this issue was that if model took a long time to load, then the requests until then would fail. This leads to a bad user experience when calling predict right after applying a patch for a slow loading model. This retry behavior is consistent with non-reloadable models, where, if the model is deploy via kserve or knative, the request would wait until the model is ready.

Please note that all files under truss_container_fs are auto-generated and can be ignored for this review. Added a test for this case as well.

retry=(
retry_if_exception_type(ConnectionError)
| retry_if_exception_type(ModelNotReady)
),
stop=stop_after_attempt(INFERENCE_SERVER_START_WAIT_SECS),
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we increase this timeout if we're also waiting from the model to be ready

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I think the tradeoff is that for some error cases it may increase the time to return an error. Let's start with this and then we can tune. This will not completely eliminate the issue, models can take any amount of time to load. In those cases it's fine to return the 503 error. Idea is that we retry a bit for the common simple cases.

@pankajroark pankajroark merged commit 7177c1e into main Feb 8, 2023
@pankajroark pankajroark deleted the pg/control-retry-model-load branch February 8, 2023 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants