[
https://issues.apache.org/jira/browse/BEAM-9421?focusedWorklogId=404325&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-404325
]
ASF GitHub Bot logged work on BEAM-9421:
----------------------------------------
Author: ASF GitHub Bot
Created on: 16/Mar/20 23:23
Start Date: 16/Mar/20 23:23
Worklog Time Spent: 10m
Work Description: aaltay commented on pull request #11075: [BEAM-9421]
Website section that describes getting predictions using AI Platform Prediciton
URL: https://github.com/apache/beam/pull/11075#discussion_r393365169
##########
File path: website/src/documentation/patterns/ai-platform.md
##########
@@ -0,0 +1,87 @@
+---
+layout: section
+title: "AI Platform integration patterns"
+section_menu: section-menu/documentation.html
+permalink: /documentation/patterns/ai-platform/
+---
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# AI Platform integration patterns
+
+This page describes common patterns in pipelines with Google AI Platform
transforms.
+
+<nav class="language-switcher">
+ <strong>Adapt for:</strong>
+ <ul>
+ <li data-type="language-java">Java SDK</li>
+ <li data-type="language-py" class="active">Python SDK</li>
+ </ul>
+</nav>
+
+## Getting predictions
+
+This section shows how to use a cloud-hosted machine learning model to make
predictions about new data using Google Cloud AI Platform Prediction within
Beam's pipeline.
+
+[tfx_bsl](https://github.com/tensorflow/tfx-bsl) is a library that provides
`RunInference` Beam's PTransform. `RunInference` is a PTransform able to
perform two types of inference. One of them can use a service endpoint. When
using a service endpoint, the transform takes a PCollection of type
`tf.train.Example` and, for each element, sends a request to Google Cloud AI
Platform Prediction service. The transform produces a PCollection of type
`PredictLog` which contains predictions.
+
+Before getting started, deploy a machine learning model to the cloud. The
cloud service manages the infrastructure needed to handle prediction requests
in both efficient and scalable way. Only Tensorflow models are supported. For
more information, see [Exporting a SavedModel for
prediction](https://cloud.google.com/ai-platform/prediction/docs/exporting-savedmodel-for-prediction).
Review comment:
Beam does not have hooks for job start and job finish. One way to emulate
those would be using an airflow wrapper to run some setup and cleanup tasks
before and after a task. I do not believe we have a recommendation here but an
example pattern might be useful (@rezarokni -- in case this will be a good
pattern to add to the backlog.)
For this version, it is probably fine to assume that the life cycle of the
model will be managed by the user separately. For a next phase, we can try to
build a graph similar to IOs (like BQ IO) to execute a certain setup and clean
task in a single worker. (Although we cannot guarantee that it will not be
retried)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 404325)
Time Spent: 3h 20m (was: 3h 10m)
> AI Platform pipeline patterns
> -----------------------------
>
> Key: BEAM-9421
> URL: https://issues.apache.org/jira/browse/BEAM-9421
> Project: Beam
> Issue Type: Sub-task
> Components: website
> Reporter: Kamil Wasilewski
> Assignee: Kamil Wasilewski
> Priority: Major
> Labels: pipeline-patterns
> Time Spent: 3h 20m
> Remaining Estimate: 0h
>
> New pipeline patterns should be contributed to the Beam's website in order to
> demonstrate how newly implemented Google Cloud AI PTransforms can be used in
> pipelines.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)