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: Support model observability to pyfunc model #502

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

tiopramayudi
Copy link
Contributor

@tiopramayudi tiopramayudi commented Dec 8, 2023

What this PR does / why we need it:

We introduce PyFuncV3Model as new pyfunc class that support model observability. It is working fine for new model but it is not the case for existing model that use PyFuncModel since merlin model can't be changed once it is logged or deployed. Implication of this, users need to create new model that use pyfunc_v3 type and the endpoint will be different hence there will be modification on the upstream caller. This PR will allow PyFuncModel to user model observability as long as the output of the model is PyFuncOutput.

This PR also allow features, entities, and prediction in PyFuncOutput to be pandas DataFrame, previously the type is strictly Values where in reality most of our users use pandas DataFrame and numpy ndarray

Modification:

  • api/api/validator.go -> Relax the validation to allow PyFuncModel also
  • api/cluster/resource/templater.go -> Supply necessary env vars for PyFunc and PyFuncV3 if model observability enabled
  • python/sdk/merlin/pyfunc.py -> Supporting used of pandas DataFrame and numpy ndarray for model input and output

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:


Checklist

  • Added unit test, integration, and/or e2e tests
  • Tested locally
  • Updated documentation
  • Update Swagger spec if the PR introduce API changes
  • Regenerated Golang and Python client if the PR introduce API changes

@ghost
Copy link

ghost commented Dec 8, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

Copy link
Collaborator

@khorshuheng khorshuheng left a comment

Choose a reason for hiding this comment

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

lgtm!

@krithika369
Copy link
Collaborator

krithika369 commented Dec 8, 2023

@tiopramayudi @khorshuheng as discussed internally, let's explore moving the model type to the model version instead to solve the problem:

for existing model that use PyFuncModel since merlin model can't be changed once it is logged or deployed

Edit: Proceeding with this change at least for the short term, after internal discussions.

Copy link
Collaborator

@krithika369 krithika369 left a comment

Choose a reason for hiding this comment

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

Left one comment. The rest LGTM. Thanks, @tiopramayudi !

@khorshuheng khorshuheng added the enhancement New feature or request label Jan 5, 2024
@tiopramayudi tiopramayudi merged commit 367a4ec into main Jan 5, 2024
32 of 33 checks passed
@tiopramayudi tiopramayudi deleted the support-publishing-to-pyfunc branch January 5, 2024 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants