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

Raise inference failure exceptions in default handlers #883

Merged
merged 3 commits into from
Jun 30, 2023

Conversation

rohithkrn
Copy link
Contributor

@rohithkrn rohithkrn commented Jun 29, 2023

Description

Currently inference failure exceptions are suppressed in default handlers preventing OOM exceptions to be handled correctly. Output is constructed here anyway.

This is needed for MME on SM

@rohithkrn rohithkrn requested review from zachgk, frankfliu and a team as code owners June 29, 2023 23:04
@@ -368,7 +368,7 @@ def inference(self, inputs: Input):
outputs.add_property("content-type", "application/json")
except Exception as e:
logging.exception("DeepSpeed inference failed")
outputs = Output().error((str(e)))
raise e
Copy link
Contributor

Choose a reason for hiding this comment

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

If we rethrow the exception, we don't need to catch it at the first place

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I thought about it too. I did not remove it as I was not sure if the log statement right above provided any value.

Copy link
Contributor

Choose a reason for hiding this comment

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

the exception will be caught at higher level and will be logged there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, updated

@rohithkrn rohithkrn merged commit 7fb06bc into deepjavalibrary:master Jun 30, 2023
8 checks passed
KexinFeng pushed a commit to KexinFeng/djl-serving-forked that referenced this pull request Aug 16, 2023
…ry#883)

* raise inference failure exceptions in default handlers
KexinFeng pushed a commit to KexinFeng/djl-serving-forked that referenced this pull request Aug 16, 2023
…ry#883)

* raise inference failure exceptions in default handlers
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