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

Example of TF Serving with GPU #154

Merged
merged 14 commits into from
Jul 25, 2018
Merged

Example of TF Serving with GPU #154

merged 14 commits into from
Jul 25, 2018

Conversation

lluunn
Copy link
Contributor

@lluunn lluunn commented Jun 27, 2018

#145

python predict.py --utl=XX should work.

Only files need review: README.md and predict.py
visualization_utils.py and standard_fields.py are copied from
https://github.com/tensorflow/models/blob/master/research/object_detection/utils/visualization_utils.py

Next PR should move the python logic into a webapp and deploy it.


This change is Reviewable

@lluunn lluunn changed the title wip don't review Example of TF Serving with GPU Jul 11, 2018
@lluunn
Copy link
Contributor Author

lluunn commented Jul 11, 2018

/retest

@lluunn
Copy link
Contributor Author

lluunn commented Jul 11, 2018

/assign @jlewi
/assign @kunmingg

## Deploy serving component

```
ks init ks-app
Copy link
Contributor

Choose a reason for hiding this comment

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

@texasmichelle
Should we just tell people to refer to the Getting Started guide to create the app and then just tell them to CD to the directory containing their application?

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

```
wget http://download.tensorflow.org/models/object_detection/faster_rcnn_nas_coco_2018_01_28.tar.gz
tar -xzf faster_rcnn_nas_coco_2018_01_28.tar.gz
gsutil cp faster_rcnn_nas_coco_2018_01_28/saved_model/saved_model.pb gs://YOUR_BUCKET/YOUR_MODEL/1/
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we publish the model to gs://kubeflow-examples-data/
so people can just serve it from 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.

pushed

model1: {
cloud: 'gcp',
deployHttpProxy: true,
gcpCredentialSecretName: 'kai-sa',
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you using the GCP secret kai-sa? I believe the GKE deploy secrets will create the secret user-sa does that work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was reading model in my bucket. user-sa should work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you change the default parameters to be parameters that will work for users here and below.

@@ -0,0 +1,46 @@
import argparse
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a CLI for the example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, see README: python predict.py --url=YOUR_KF_HOST/models/coco

@@ -0,0 +1,2 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets not check in your environment.
I'd suggest adding it to the .gitignore file so it doesn't get checked in.

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.
But it's still in app.yaml. Not sure if there is a good way to avoid that.

@jlewi
Copy link
Contributor

jlewi commented Jul 13, 2018

This is great.

@texasmichelle Any overall guidance about how we should be structuring the examples?

@lluunn
Copy link
Contributor Author

lluunn commented Jul 13, 2018

@jlewi Thanks, PTAL

@jlewi
Copy link
Contributor

jlewi commented Jul 16, 2018

It looks like someone started checking in an object detection model here
https://github.com/kubeflow/examples/tree/master/object_detection

Is this the same example? Should we move it into that directory?

@lluunn
Copy link
Contributor Author

lluunn commented Jul 18, 2018

Filed #185

@texasmichelle
Copy link
Member

See comments on #185

@jlewi
Copy link
Contributor

jlewi commented Jul 19, 2018

The consensus on #185 seems to be to having a single object_detection model.

Lunkai do you want to move these files into that directory? Maybe you replace what's in object_detection/tf-serving? And maybe combine the READMEs?

@texasmichelle does that work for you?

@lluunn
Copy link
Contributor Author

lluunn commented Jul 20, 2018

I think it's a little awkward to move this into object_detection now as that example currently uses many yaml and doesn't have a ks-app.
Should we either leave this PR here (or checked in for now) and then combine these two after we fix the issues in the object_detection/?

@jlewi
Copy link
Contributor

jlewi commented Jul 20, 2018

Why can't you make it a subdirectory of object_detection?

e.g.

object_detection/tf_serving/ks-app

@jlewi
Copy link
Contributor

jlewi commented Jul 20, 2018

Do we even need the YAML file that's currently in object_detection/tf-serving? What is that file doing that your example isn't?

@lluunn
Copy link
Contributor Author

lluunn commented Jul 20, 2018

moved. I put the ks-app at the object_detection as I think other yaml files will be moved to the app too.


## Setup

If you followed previous steps to train the model, skip to deploy [section](#deploy-serving-component).
Copy link
Member

Choose a reason for hiding this comment

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

The setup steps feel out of place here, since the title is Serving an object detection model with GPU. Could you integrate them with the other markdown files in this example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think some users might only interested in trying out serving. This provides the steps to do if they skip the training part. And the first line is tell them to skip this if they've done training.

Does it make sense?

@texasmichelle
Copy link
Member

What is inputs.json for? It is the last remaining file in gpu_serving and needs to be filed somewhere in object_detection if it is used for the example.

@lluunn
Copy link
Contributor Author

lluunn commented Jul 20, 2018

removed inputs.json. That's missed when moving.

Copy link
Contributor

@jlewi jlewi left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 17 files reviewed, 5 unresolved discussions (waiting on @jlewi, @lluunn, @texasmichelle, and @cwbeitel)


gpu_serving/predict.py, line 1 at r4 (raw file):

Previously, lluunn (Lun-Kai Hsu) wrote…

Yes, see README: python predict.py --url=YOUR_KF_HOST/models/coco

Can you add a doc string for the module explaining that.y


gpu_serving/README.md, line 25 at r4 (raw file):

Previously, lluunn (Lun-Kai Hsu) wrote…

Done

Why don't they use they ksonnet app in the examples directory and just create a new enviornment?

@jlewi
Copy link
Contributor

jlewi commented Jul 22, 2018

Took another look. I think only significant comment I have is whether we should be telling users to use the ksonnet app provided in the example and just adding and environment to it rather than creating a new app.

My thinking is that based on other examples we will want to provide the app as an easy way of making a whole bunch of resources that are part of the example available to users.

Copy link
Contributor Author

@lluunn lluunn left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 17 files reviewed, 5 unresolved discussions (waiting on @jlewi, @lluunn, @texasmichelle, and @cwbeitel)


gpu_serving/predict.py, line 1 at r4 (raw file):

Previously, jlewi (Jeremy Lewi) wrote…

Can you add a doc string for the module explaining that.y

done


gpu_serving/README.md, line 25 at r4 (raw file):

Previously, jlewi (Jeremy Lewi) wrote…

Why don't they use they ksonnet app in the examples directory and just create a new enviornment?

Modified the instruction to cd to app without ks init.

@lluunn
Copy link
Contributor Author

lluunn commented Jul 23, 2018

Modify the instruction to tell user to cd to that ks app instead of ks init. PTAL, thanks

Copy link
Contributor

@jlewi jlewi left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 17 files reviewed, 2 unresolved discussions (waiting on @jlewi, @texasmichelle, and @cwbeitel)


gpu_serving/object-detection-app/components/params.libsonnet, line 9 at r4 (raw file):

Previously, jlewi (Jeremy Lewi) wrote…

Can you change the default parameters to be parameters that will work for users here and below.

The default secret is "user-gcp-sa"

@jlewi
Copy link
Contributor

jlewi commented Jul 24, 2018

I had one minor comment abou the default value for the GCP secret name but other than that this LGTM.

Copy link
Contributor Author

@lluunn lluunn left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 17 files reviewed, 2 unresolved discussions (waiting on @jlewi, @texasmichelle, and @cwbeitel)


gpu_serving/object-detection-app/components/params.libsonnet, line 9 at r4 (raw file):

Previously, jlewi (Jeremy Lewi) wrote…

The default secret is "user-gcp-sa"

Done.

@lluunn
Copy link
Contributor Author

lluunn commented Jul 24, 2018

Done. Thanks

Copy link
Contributor

@jlewi jlewi left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 17 files reviewed, 1 unresolved discussion (waiting on @texasmichelle and @cwbeitel)

@jlewi
Copy link
Contributor

jlewi commented Jul 25, 2018

/lgtm
/approve
/hold for @texasmichelle

@texasmichelle I know your busy with NEXT do you want @lluunn to wait until you can take another look?

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jlewi

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

@k8s-ci-robot k8s-ci-robot merged commit 1746820 into kubeflow:master Jul 25, 2018
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.

5 participants