2 つのステップを含む Vertex Al パイプラインを作成しました。最初のステップでは、10 TB のデータを約 1 時間で前処理し、その結果を Cloud Storage バケットに保存します。2 番目のステップでは、処理されたデータを使用してモデルをトレーニングします。さまざまなアルゴリズムをテストできるように、モデルのコードを更新する必要があります。パイプラインの実行時間とコストを削減すると同時に、パイプラインの変更を最小限に抑えたいと考えています。どうすればよいですか?
正解: D
パイプラインの実行時間とコストを削減し、パイプラインの変更を最小限に抑える最適なオプションは、パイプライン ジョブのキャッシュを有効にし、モデルのトレーニング ステップのキャッシュを無効にすることです。このオプションを使用すると、Vertex AI Pipelines のパワーとシンプルさを活用して、データ前処理ステップの出力を再利用し、不要な再計算を回避できます。Vertex AI Pipelines は、Vertex AI を使用して機械学習ワークフローをオーケストレーションできるサービスです。Vertex AI Pipelines は、カスタム Docker イメージで前処理とトレーニングのステップを実行し、機械学習モデルを評価、デプロイ、および監視できます。キャッシュは、パイプライン ステップの出力を保存して再利用し、入力パラメータとコードが変更されていない場合はステップの実行をスキップできる Vertex AI Pipelines の機能です。キャッシュを使用すると、同じ入力とコードで同じステップを再実行する必要がないため、パイプラインの実行時間とコストを削減できます。また、パイプライン ステップやパラメータを追加または削除する必要がないため、パイプラインの変更を最小限に抑えることもできます。パイプライン ジョブのキャッシュを有効にし、モデル トレーニング ステップのキャッシュを無効にすると、2 つのステップを含む Vertex AI パイプラインを作成できます。最初のステップでは、10 TB のデータを前処理し、約 1 時間で完了して、結果を Cloud Storage バケットに保存します。2 番目のステップでは、処理されたデータを使用してモデルをトレーニングします。モデルのコードを更新してさまざまなアルゴリズムをテストできるようにし、キャッシュを有効にしてパイプライン ジョブを実行できます。パイプライン ジョブは、キャッシュからデータ前処理ステップの出力を再利用し、ステップの実行をスキップします。パイプライン ジョブは、更新されたコードを使用してモデル トレーニング ステップを実行し、ステップのキャッシュを無効にします。このようにして、パイプラインの実行時間とコストを削減しながら、パイプラインの変更を最小限に抑えることができます1。
他のオプションは、次の理由によりオプション D ほど優れていません。
* Option A: Adding a pipeline parameter and an additional pipeline step, depending on the parameter value, the pipeline step conducts or skips data preprocessing and starts model training, would require more skills and steps than enabling caching for the pipeline job, and disabling caching for the model training step. A pipeline parameter is a variable that can be used to control the input or output of a pipeline step. A pipeline parameter can help you customize the pipeline logic and behavior, and experiment with different values. An additional pipeline step is a new instance of a pipeline component that can perform a part of the pipeline workflow, such as data preprocessing or model training. An additional pipeline step can help you extend the pipeline functionality and complexity, and handle different scenarios. However, adding a pipeline parameter and an additional pipeline step, depending on the parameter value, the pipeline step conducts or skips data preprocessing and starts model training, would require more skills and steps than enabling caching for the pipeline job, and disabling caching for the model training step. You would need to write code, define the pipeline parameter, create the additional pipeline step, implement the conditional logic, and compile and run the pipeline. Moreover, this option would not reuse the output of the data preprocessing step from the cache, but rather from the Cloud Storage bucket, which can increase the data transfer and access costs1.
* Option B: Creating another pipeline without the preprocessing step, and hardcoding the preprocessed Cloud Storage file location for model training, would require more skills and steps than enabling caching for the pipeline job, and disabling caching for the model training step. A pipeline without the preprocessing step is a pipeline that only includes the model training step, and uses the preprocessed data from the Cloud Storage bucket as the input. A pipeline without the preprocessing step can help you avoid running the data preprocessing step every time, and reduce the pipeline execution time and cost.
However, creating another pipeline without the preprocessing step, and hardcoding the preprocessed Cloud Storage file location for model training, would require more skills and steps than enabling caching for the pipeline job, and disabling caching for the model training step. You would need to write code, create a new pipeline, remove the preprocessing step, hardcode the Cloud Storage file location, and compile and run the pipeline. Moreover, this option would not reuse the output of the data preprocessing step from the cache, but rather from the Cloud Storage bucket, which can increase the data transfer and access costs. Furthermore, this option would create another pipeline, which can increase the maintenance and management costs1.
* オプション C: コンピューティング最適化マシン ファミリからより多くの CPU と RAM を搭載したマシンをデータ前処理ステップ用に構成すると、パイプラインの実行時間とコストは削減されず、パイプラインの変更も最小限に抑えられますが、パイプラインの実行コストと複雑さは増加します。コンピューティング最適化マシン ファミリからより多くの CPU と RAM を搭載したマシンは、CPU コアとメモリの比率が高い仮想マシンであり、コンピューティング集約型のワークロードに対して高いパフォーマンスとスケーラビリティを提供できます。コンピューティング最適化マシン ファミリからより多くの CPU と RAM を搭載したマシンを使用すると、データ前処理ステップを最適化し、パイプラインの実行時間を短縮できます。ただし、コンピューティング最適化マシン ファミリからより多くの CPU と RAM を搭載したマシンを構成すると、パイプラインの実行時間が短縮されます。
* ファミリのデータ前処理ステップでは、パイプラインの実行時間とコストは削減されず、パイプラインの変更も最小限に抑えられますが、パイプラインの実行コストと複雑さは増加します。コードを記述し、データ前処理ステップのマシン タイプ パラメータを構成し、パイプラインをコンパイルして実行する必要があります。また、このオプションではパイプラインの実行コストが増加します。コンピューティング最適化マシン ファミリの CPU と RAM が多いマシンは、他のマシン ファミリの CPU と RAM が少ないマシンよりも高価だからです。さらに、このオプションでは、キャッシュからのデータ前処理ステップの出力が再利用されず、毎回データ前処理ステップが再実行されるため、パイプラインの実行時間とコストが増加する可能性があります1。
参考文献:
* Google Cloud 認定資格の準備: 機械学習エンジニア、コース 3: 本番環境 ML システム、第 3 週: MLOps
* Google Cloud Professional Machine Learning Engineer 試験ガイド、セクション 3: 本番環境での ML モデルのスケーリング、3.2 ML ワークフローの自動化
* 公式 Google Cloud Certified Professional Machine Learning Engineer 学習ガイド、第 6 章:
プロダクション ML システム、セクション 6.4: ML ワークフローの自動化
* Vertex AI パイプライン
* キャッシュ
* パイプラインパラメータ
* 機械の種類