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

tidy: Clean up various adapter/puller logic #33

Merged
merged 2 commits into from
Sep 20, 2022
Merged

Conversation

njhill
Copy link
Member

@njhill njhill commented Sep 15, 2022

Motivation

While working on adding built-in adapter support for torchserve, I noticed various things to be added/tidied in the adapter logic.

Note that there's still a lot of simplification that could be done - in particular de-duplication and unification of common logic between the different adapters.

Modifications

  • Move logic for resolving gRPC endpoint from ServingRuntime endpoint into a utility function
  • Change adapterConfig.RootModelDir to reference the subdir containing the adapted model files/dirs
  • Create the adapter model subdir when the adapter is first created
  • Change the initial gRPC connection to the model server(s) to be non-blocking and remove connection test from that context - the runtimeStatus func will be called subsequently to determine when the connection/server is ready
  • Add logic to RuntimeStatus impls and puller to clean up local storage when called (per the SPI contract)
  • Add/clean-up some logging, particularly related to adaptModelLayout logic
  • Inline some if assignments :)

Motivation

While working on adding built-in adapter support for torchserve, I noticed various things to be added/tidied in the adapter logic.

Note that there's still a lot of simplification that could be done - de-duplicating/unifying common logic between the different adapters.

Modifications

- Move logic for resolving gRPC endpoint from ServingRuntime endpoint into a utility function
- Change adapterConfig.RootModelDir to reference the subdir containing the _adapted_ model files/dirs
- Create the adapter model subdir when the adapter is first created
- Change the initial gRPC connection to the model server(s) to be non-blocking and remove connection test from that context - the runtimeStatus func will be called subsequently to determine when the connection/server is ready
- Add logic to RuntimeStatus impls and puller to clean up local storage when called (per the SPI contract)
- Add/clean-up some logging, particularly related to adaptModelLayout logic
- Inline some if assignments :)

Result

Signed-off-by: Nick Hill <[email protected]>
Copy link
Contributor

@chinhuang007 chinhuang007 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @njhill !

@kserve-oss-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@chinhuang007
Copy link
Contributor

/lgtm

@kserve-oss-bot kserve-oss-bot merged commit f4c43a3 into main Sep 20, 2022
@njhill njhill deleted the adapter-cleanup branch September 20, 2022 18:25
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.

3 participants