リアルタイム推論のために Vertex AI にモデルをデプロイしました。オンライン予測リクエスト中に「メモリ不足」エラーが発生します。どうすればよいでしょうか?
正解: B
オプション A は不正解です。オンライン モードの代わりにバッチ予測モードを使用すると、「メモリ不足」エラーは解決されず、予測サービスの待ち時間とスループットが変わります。バッチ予測モードは大規模、非同期、非緊急の予測に適しており、オンライン予測モードは低待ち時間、同期、リアルタイムの予測に適しています1。 オプション B が正解です。インスタンスのバッチを小さくしてリクエストを再度送信すると、予測サービスのメモリ消費量が減り、「メモリ不足」エラーを回避できます。バッチ サイズは、1 つのリクエストで一緒に処理されるインスタンスの数です。バッチ サイズが小さいほど、一度にメモリにロードするデータが少なくなります2。 オプション C は不正解です。予測に使用する前にデータを base64 でエンコードしても、予測サービスのメモリ消費量は減らず、むしろ増えてしまいます。Base64 エンコードはバイナリ データを ASCII 文字として表現する方法で、データのサイズが約 33% 増加します3。Base64 エンコードは、JSON や CSV4 として表現できない画像や音声などの特定のデータ タイプにのみ必要です。 オプション D は不正解です。予測リクエスト数の割り当て増加を申請しても、「メモリ不足」エラーは解決されず、予測サービスに 1 日あたりに送信できるリクエスト数が増えるだけです。割り当てとは、CPU、メモリ、ディスク、ネットワークなどの Google Cloud リソースの使用制限です5。割り当ては予測サービスのパフォーマンスには影響しませんが、サービスの可用性とコストに影響します。 参照: オンライン予測とバッチ予測の選択 オンライン予測入力データ Base64エンコード 予測のためのデータの準備 割り当てと制限
Professional-Machine-Learning-Engineer 試験問題 32
One of your models is trained using data provided by a third-party data broker. The data broker does not reliably notify you of formatting changes in the dat a. You want to make your model training pipeline more robust to issues like this. What should you do?
正解: D
Professional-Machine-Learning-Engineer 試験問題 33
X 線画像が骨折リスクを示しているかどうかを分類することを目的とした ML モデルを開発しています。TPU をアクセラレータとして使用して Vertex AI の Api Resnet アーキテクチャでトレーニングしましたが、トレーニング時間とメモリ使用量に満足していません。トレーニング コードをすばやく反復処理したいのですが、コードの変更は最小限に抑えたいと考えています。また、モデルの精度への影響を最小限に抑えたいと考えています。どうすればよいでしょうか。
正解: B
Professional-Machine-Learning-Engineer 試験問題 34
You have successfully deployed to production a large and complex TensorFlow model trained on tabular data. You want to predict the lifetime value (LTV) field for each subscription stored in the BigQuery table named subscription. subscriptionPurchase in the project named my-fortune500-company-project. You have organized all your training code, from preprocessing data from the BigQuery table up to deploying the validated model to the Vertex AI endpoint, into a TensorFlow Extended (TFX) pipeline. You want to prevent prediction drift, i.e., a situation when afeature data distribution in production changes significantly over time. What should you do?
正解: B
* Option A is incorrect because implementing continuous retraining of the model daily using Vertex AI Pipelines is not the most efficient way to prevent prediction drift. Vertex AI Pipelines is a service that allows you to create and run scalable and portable ML pipelines on Google Cloud1. You can use Vertex AI Pipelines to retrain your model daily using the latest data from the BigQuery table. However, this option may be unnecessary or wasteful, as the data distribution may not change significantly every day, and retraining the model may consume a lot of resources and time. Moreover, this option does not monitor the model performance or detect the prediction drift, which are essential steps for ensuring the quality and reliability of the model. * Option B is correct because adding a model monitoring job where 10% of incoming predictions are sampled 24 hours is the best way to prevent prediction drift. Model monitoring is a service that allows you to track the performance and health of your deployed models over time2. You can use model monitoring to sample a fraction of the incoming predictions and compare them with the ground truth labels, which can be obtained from the BigQuery table or other sources. You can also use model monitoring to compute various metrics, such as accuracy, precision, recall, or F1-score, and set thresholds or alerts for them. By using model monitoring, you can detect and diagnose the prediction drift, and decide when to retrain or update your model. Sampling 10% of the incoming predictions every 24 hours is a reasonable choice, as it balances the trade-off between the accuracy and the cost of the monitoring job. * Option C is incorrect because adding a model monitoring job where 90% of incoming predictions are sampled 24 hours is not a optimal way to prevent prediction drift. This option has the same advantages as option B, as it uses model monitoring to track the performance and health of the deployed model. However, this option is not cost-effective, as it samples a very large fraction of the incoming predictions, which may incur a lot of storage and processing costs. Moreover, this option may not improve the accuracy of the monitoring job significantly, as sampling 10% of the incoming predictions may already provide a representative sample of the data distribution. * Option D is incorrect because adding a model monitoring job where 10% of incoming predictions are sampled every hour is not a necessary way to prevent prediction drift. This option also has the same advantages as option B, as it uses model monitoring to track the performance and health of the deployed model. However, this option may be excessive, as it samples the incoming predictions too frequently, which may not reflect the actual changes in the data distribution. Moreover, this option may incur more storage and processing costs than option B, as it generates more samples and metrics. References: * Vertex AI Pipelines documentation * Model monitoring documentation * [Prediction drift] * [TensorFlow Extended documentation] * [BigQuery documentation] * [Vertex AI documentation]