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

Align code with error message and raise timeout after 30 min #477

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

albertvillanova
Copy link
Member

Align code with error message and raise timeout after 30 min.

Note current error message says:

"Endpoint did not start within 30 minutes, there was a timeout. Please inspect the logs."

@HuggingFaceDocBuilderDev
Copy link
Collaborator

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@clefourrier
Copy link
Member

Hmm, just re-read the code, and the maximum amount of time is managed by MAX_TIME_FOR_SPINUP.
At the place you pointed, we wait for 10 min for an endpoint to load, and we either

  • try to scale it up if it failed
  • retry it as such if it's still pending (it's in the big for loop).

This allows to wait in total for 30 min

@albertvillanova
Copy link
Member Author

I have re-read the code and I think there is an error in its logic:

  • The first time we enter in the while loop, the endpoint is launched and waited with a 10 min timeout
  • If the endpoint is not created within 10 min, an InferenceEndpointTimeoutError is raised
  • This error is caught in the except clause, which logs an error message and re-raises
  • There is no other outer except clause, and therefore we exit the while loop by raising the error

@clefourrier
Copy link
Member

You're right, the raise e should be removed so that it tries to spin up the endpoint with the same params for an extra 10 min

@clefourrier
Copy link
Member

                except InferenceEndpointTimeoutError as e:
                    logger.error(
                        "Endpoint did not start within 30 minutes, there was a timeout. Please inspect the logs."
                    )
                    raise e

should be

                except InferenceEndpointTimeoutError as e:
                    logger.warning(
                        "Endpoint did not start within 10 minutes, there was a timeout. Trying for 10 extra minutes, or stopping if we passed 30 min."
                    )

@albertvillanova
Copy link
Member Author

@clefourrier with the suggestion above, no error will be raised even after 30 min timeout.

@albertvillanova
Copy link
Member Author

Let me try to simplify the logic as much as possible so that we are sure it works as expected.

@albertvillanova
Copy link
Member Author

While refactoring, I also got confused about the must_scaleup_endpoint variable: if I understand correctly, whenever an InferenceEndpointError is raised, must_scaleup_endpoint is set to True, even if the inference point already existed and was set to be reused.
Is this expected?

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.

3 participants