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: storage phase 1 for inference service reconciler #56

Merged
merged 8 commits into from
Nov 22, 2021

Conversation

Tomcli
Copy link
Member

@Tomcli Tomcli commented Oct 16, 2021

Motivation

rebase #32 to the new inference service reconciler for model mesh

For Storage Spec details, please refer to the design doc: https://docs.google.com/document/d/1rYNh93XNMRp8YaR56m-_zK3bqpZhhGKgpVbLPPsi-Ow/edit#

Additional storages/parameters support will come in phase 2.

Modifications

Result

@Tomcli
Copy link
Member Author

Tomcli commented Oct 16, 2021

@njhill @pvaneck Quick question, is the schemaPath only used in Pytorch framework? Right now I have schemaPath as optional parameter as part of the storage Spec, but let me know if these kinds of parameters are more framework specific so I can also change it.

In Kserve, the pytorch server assumes both model and graph .mar files are under the model-store folder instead of pointing to a single file.
https://console.cloud.google.com/storage/browser/kfserving-examples/models/torchserve/image_classifier;tab=objects?prefix=&forceOnObjectsSortingFiltering=false&pageState=(%22StorageObjectListTable%22:(%22f%22:%22%255B%255D%22))

In Kserve triton server, it assumes the path is pointing to a folder with structure similar to tensorflow's savedmodel format.
https://console.cloud.google.com/storage/browser/kfserving-examples/models/torchscript?pageState=(%22StorageObjectListTable%22:(%22f%22:%22%255B%255D%22))&prefix=&forceOnObjectsSortingFiltering=false

I think the schemaPath is useful for backward capability since pytorch didn't have a model saving standard, but I feel like this might be too much to add it as part of the storage spec.

Storage *StorageSpec `json:"storage,omitempty"`
}

type StorageSpec struct {
Copy link
Member

Choose a reason for hiding this comment

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

Can we discuss this? we do not want to maintain two versions of InferenceService

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going to create the same spec update to the kserve repo once we agreed on how to handle some of the current edge cases on modelmesh storage. The long term goal is to move the modelmesh serving code as part of the kserve reconciler.

Copy link
Member Author

Choose a reason for hiding this comment

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

@pvaneck I remember in your InferenceService PR #34, you copied the spec because it was during the kserve migration. Will there be any challenges for you to import the inferenceservice types from the kserve package now?

@Tomcli
Copy link
Member Author

Tomcli commented Oct 18, 2021

@njhill @pvaneck Quick question, is the schemaPath only used in Pytorch framework? Right now I have schemaPath as optional parameter as part of the storage Spec, but let me know if these kinds of parameters are more framework specific so I can also change it.

In Kserve, the pytorch server assumes both model and graph .mar files are under the model-store folder instead of pointing to a single file. https://console.cloud.google.com/storage/browser/kfserving-examples/models/torchserve/image_classifier;tab=objects?prefix=&forceOnObjectsSortingFiltering=false&pageState=(%22StorageObjectListTable%22:(%22f%22:%22%255B%255D%22))

In Kserve triton server, it assumes the path is pointing to a folder with structure similar to tensorflow's savedmodel format. https://console.cloud.google.com/storage/browser/kfserving-examples/models/torchscript?pageState=(%22StorageObjectListTable%22:(%22f%22:%22%255B%255D%22))&prefix=&forceOnObjectsSortingFiltering=false

I think the schemaPath is useful for backward capability since pytorch didn't have a model saving standard, but I feel like this might be too much to add it as part of the storage spec.

We have a conversation on this and the schemaPath should be generic for all frameworks. The definition of the schemaPath is located here and ultimately provide a generic way for any model server to know the schema payload.

Copy link
Member

@njhill njhill left a comment

Choose a reason for hiding this comment

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

Thanks @Tomcli, I made a few comments inline

docs/inferenceservice.md Outdated Show resolved Hide resolved
pkg/predictor_source/inferenceservice_registry.go Outdated Show resolved Hide resolved
pkg/predictor_source/inferenceservice_registry.go Outdated Show resolved Hide resolved
pkg/predictor_source/inferenceservice_registry.go Outdated Show resolved Hide resolved
pkg/predictor_source/inferenceservice_registry.go Outdated Show resolved Hide resolved
Comment on lines 151 to 154
secretKey := inferenceService.ObjectMeta.Annotations[v1beta1.SecretKeyAnnotation]
if schemaPath, ok := inferenceService.ObjectMeta.Annotations[v1beta1.SchemaPathAnnotation]; ok {
p.Spec.SchemaPath = &schemaPath
}
Copy link
Member

Choose a reason for hiding this comment

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

There appears to be duplication here with below. It would be best to move the annotation checks into the ProcessInferenceServiceStorage function. And only need to check for the annotations if the corresponding explicit fields aren't set.

@njhill
Copy link
Member

njhill commented Oct 26, 2021

Re schemaPath addition, that's correct it would apply (potentially) to any kind of model, but might be used differently depending on the corresponding model server / adapter. The idea is to abstract how the input/output schema is provided so that InferenceService creator doesn't need to structure their storage in a server impl-specific way (but they still can do that if desired). This is one of the things we'd like to get thoughts on from others, hopefully on the upcoming community call.

Copy link
Member

@njhill njhill left a comment

Choose a reason for hiding this comment

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

Thanks @Tomcli, sorry for the delay in re-reviewing!

pkg/predictor_source/inferenceservice_registry.go Outdated Show resolved Hide resolved
pkg/predictor_source/inferenceservice_registry.go Outdated Show resolved Hide resolved
pkg/predictor_source/inferenceservice_registry.go Outdated Show resolved Hide resolved
@Tomcli
Copy link
Member Author

Tomcli commented Nov 12, 2021

thanks @njhill for your reviews

@@ -94,3 +94,4 @@ resources:
- ../crd
- ../rbac
- ../manager
namespace: modelmesh-serving
Copy link
Member

Choose a reason for hiding this comment

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

This looks unrelated to the PR?

@njhill
Copy link
Member

njhill commented Nov 16, 2021

@Tomcli are you sure we want to include the new serving.kserve.io_inferenceservices.yaml file at this point (it's huge)?

May be better to omit it until the other kserve changes are ready? The PR could still be merged, I don't think the new logic will break anything when used with the existing CRD... the storage spec will just appear empty.

Copy link
Member

@njhill njhill left a comment

Choose a reason for hiding this comment

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

Hey @Tomcli sorry I noticed a few more things

pkg/predictor_source/inferenceservice_registry.go Outdated Show resolved Hide resolved
pkg/predictor_source/inferenceservice_registry.go Outdated Show resolved Hide resolved
pkg/predictor_source/inferenceservice_registry.go Outdated Show resolved Hide resolved
pkg/predictor_source/inferenceservice_registry.go Outdated Show resolved Hide resolved
pkg/predictor_source/inferenceservice_registry.go Outdated Show resolved Hide resolved
@Tomcli
Copy link
Member Author

Tomcli commented Nov 17, 2021

thanks @njhill for your reviews. I updated based on your comments

@Tomcli
Copy link
Member Author

Tomcli commented Nov 20, 2021

Thanks @njhill I addressed the pointer changes.

Copy link
Member

@njhill njhill left a comment

Choose a reason for hiding this comment

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

Thanks @Tomcli

@kserve-oss-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: njhill, Tomcli

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@njhill njhill changed the title storage phase 1 for inference service reconciler feat: storage phase 1 for inference service reconciler Nov 22, 2021
@njhill
Copy link
Member

njhill commented Nov 22, 2021

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants