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

LitServe server doesn't crash when there is a failure in setup #347

Closed
tchaton opened this issue Oct 28, 2024 · 3 comments · Fixed by #356
Closed

LitServe server doesn't crash when there is a failure in setup #347

tchaton opened this issue Oct 28, 2024 · 3 comments · Fixed by #356
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@tchaton
Copy link
Collaborator

tchaton commented Oct 28, 2024

🐛 Bug

To Reproduce

Attach a Lightning Studio which is fully reproducible (code, dependencies, environment, etc...) to reproduce this:

  1. Create a Studio.
  2. Reproduce the issue in the Studio.
  3. Publish the Studio.
  4. Paste the Studio link here.
from litserve import LitAPI, LitServer

class DebugLitAPI(LitAPI):
    def setup(self, device):
        raise Exception

    def predict(self, inputs):
        return None

if __name__ == "__main__":
    api = DebugLitAPI()
    server = LitServer(api, accelerator='auto', devices='auto', workers_per_device=2)
    server.run(port=8000)

Instead, it should return exit code error 1.

Code sample

Expected behavior

Environment

If you published a Studio with your bug report, we can automatically get this information. Otherwise, please describe:

  • PyTorch/Jax/Tensorflow Version (e.g., 1.0):
  • OS (e.g., Linux):
  • How you installed PyTorch (conda, pip, source):
  • Build command you used (if compiling from source):
  • Python version:
  • CUDA/cuDNN version:
  • GPU models and configuration:
  • Any other relevant information:

Additional context

@tchaton tchaton added bug Something isn't working help wanted Extra attention is needed labels Oct 28, 2024
@Borda Borda added enhancement New feature or request and removed bug Something isn't working labels Oct 29, 2024
@Borda
Copy link
Member

Borda commented Oct 29, 2024

seems to be the same as #293

@grumpyp
Copy link
Contributor

grumpyp commented Oct 30, 2024

I'd like to improve that, @aniketmaurya, anything I should take into account when working on it?

@aniketmaurya
Copy link
Collaborator

sure go ahead @grumpyp!! we call lit_api.setup here. Probably we can do a check if the started workers successfully called setup or not here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants