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

feat: add timeout option for bentoml runner config #2890

Merged
merged 4 commits into from
Aug 24, 2022

Conversation

jjmachan
Copy link
Contributor

@jjmachan jjmachan commented Aug 10, 2022

What does this PR address?

Fixes #2888
eg

runners:
  timeout: 400 #seconds (global)
  pytorch_runner:
    timeout: 500 # individual timeouts for specific runners

by default all runner have a timeout of 300 seconds

Before submitting:

Who can help review?

Feel free to tag members/contributors who can help review your PR.

@jjmachan jjmachan requested a review from a team as a code owner August 10, 2022 14:30
@jjmachan jjmachan requested review from parano and removed request for a team August 10, 2022 14:30
@codecov
Copy link

codecov bot commented Aug 10, 2022

Codecov Report

Merging #2890 (6fc934b) into main (0e64c50) will decrease coverage by 0.88%.
The diff coverage is 87.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2890      +/-   ##
==========================================
- Coverage   70.77%   69.88%   -0.89%     
==========================================
  Files         104      121      +17     
  Lines        9470     9961     +491     
==========================================
+ Hits         6702     6961     +259     
- Misses       2768     3000     +232     
Impacted Files Coverage Δ
bentoml/_internal/runner/runner_handle/remote.py 88.54% <85.71%> (+0.36%) ⬆️
bentoml/_internal/configuration/containers.py 78.50% <100.00%> (ø)
bentoml/keras.py 0.00% <0.00%> (ø)
bentoml/mlflow.py 0.00% <0.00%> (ø)
bentoml/pytorch_lightning.py 0.00% <0.00%> (ø)
bentoml/pytorch.py 0.00% <0.00%> (ø)
bentoml/tensorflow.py 0.00% <0.00%> (ø)
bentoml/catboost.py 0.00% <0.00%> (ø)
bentoml/exceptions.py 93.33% <0.00%> (ø)
bentoml/xgboost.py 0.00% <0.00%> (ø)
... and 15 more

Copy link
Member

@aarnphm aarnphm left a comment

Choose a reason for hiding this comment

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

Quick q: have you run this test on lower version of bentoml for compat layer?

@jjmachan
Copy link
Contributor Author

I have not actually but can you tell me more about this compat layer?

@aarnphm
Copy link
Member

aarnphm commented Aug 11, 2022

I have not actually but can you tell me more about this compat layer?

Oh just that running this on an older version of bentoml.

@jjmachan jjmachan added this to the 1.0.4 milestone Aug 16, 2022
Copy link
Member

@bojiang bojiang left a comment

Choose a reason for hiding this comment

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

conflicts

Comment on lines +44 to +52
@property
def runner_timeout(self) -> int:
"return the configured timeout for this runner."
runner_cfg = BentoMLContainer.runners_config.get()
if self._runner.name in runner_cfg:
return runner_cfg[self._runner.name]["timeout"]
else:
return runner_cfg["timeout"]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bojiang This is how we get the timeout for each runner client

Copy link
Member

Choose a reason for hiding this comment

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

Is there a case that the runner_name exists in the config but didn't provide a timeout ?

Copy link
Contributor Author

@jjmachan jjmachan Aug 24, 2022

Choose a reason for hiding this comment

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

nope, during initialization BentoMLConfiguration will copy over the default config (including timeout, resources, batching etc) to the runner_name so that situation will not happen.

@jjmachan jjmachan requested a review from bojiang August 23, 2022 18:30
@jjmachan jjmachan merged commit 901256c into bentoml:main Aug 24, 2022
@jjmachan jjmachan deleted the feat/runner-timeout branch August 24, 2022 12:22
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.

Add configuration option for runner timeout
4 participants