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

[Logging I/O] Post inference hooks as background tasks #422

Merged
merged 13 commits into from
Jan 23, 2024

Conversation

tiffzhao5
Copy link
Collaborator

@tiffzhao5 tiffzhao5 commented Jan 19, 2024

Pull Request Summary

Making post inference hooks execute as background tasks in the forwarder (http_forwarder for sync, celery_forwarder for async).

Test Plan and Usage Guide

Local testing (unit tests are follow ups):

Sync:
Screenshot 2024-01-17 at 6 40 47 PM

Async:
image

Screenshot 2024-01-19 at 2 12 40 PM

sc-832920

Copy link

This pull request has been linked to Shortcut Story #832920: Post inference hooks as background tasks.

@tiffzhao5 tiffzhao5 changed the title [I/O Storage] Post inference hooks as background tasks [Logging I/O] Post inference hooks as background tasks Jan 23, 2024
)
request_params = args[0]
request_params_pydantic = EndpointPredictV1Request.parse_obj(request_params)
forwarder.post_inference_hooks_handler.handle(request_params_pydantic, retval, task_id) # type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

any way to pass in forwarder to the class rather than using encapsulation? maybe the @app.task decorator allows custom args to be passed into the base class?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah I originally tried that approach but sadly you can't pass in custom args into the @app.task decorator: https://docs.celeryq.dev/en/stable/userguide/tasks.html#list-of-options

@tiffzhao5 tiffzhao5 merged commit 112513c into main Jan 23, 2024
5 checks passed
@tiffzhao5 tiffzhao5 deleted the tiffany/hooks-to-tasks branch January 23, 2024 23:38
@yunfeng-scale yunfeng-scale mentioned this pull request Mar 6, 2024
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.

None yet

2 participants