このドキュメントでは、プロファイル ベースの構成を使用して、AI/ML ワークロードの Cloud Storage FUSE の導入を効率化し、パフォーマンスを向上させる方法について説明します。
サービング、チェックポイント、トレーニング ワークロードの Cloud Storage FUSE 構成を効率化するために、profile
フィールドまたは --profile
オプションを使用して、ワークロード タイプに基づいて事前構成されたプロファイルを適用できます。このフィールドまたはオプションを使用すると、キャッシュ保存、スレッド処理、バッファサイズ用に最適化された Cloud Storage FUSE 機能の事前定義済みのセットを指定できます。これにより、トレーニング、チェックポイント、サービングのワークロードで、最小限の労力で高いパフォーマンスを確保できます。プロファイル値はそれぞれ aiml-training
、aiml-checkpointing
、aiml-serving
です。
考慮事項
--profile
オプションまたはprofile
フィールドは、マウント オペレーション中にのみ設定できます。--profile
オプションまたはprofile
フィールドを更新する必要がある場合は、Cloud Storage FUSE バケットを再マウントする必要があります。プロファイル ベースの構成を使用すると、Cloud Storage FUSE はメタデータ キャッシュの容量と有効期間(TTL)を無制限に設定します。つまり、エントリがメタデータ キャッシュから削除されることはありません。仮想マシンのメモリが不足している場合は、メモリ不足(OOM)エラーが発生する可能性があります。そのため、プロファイル ベースの構成を適用する前に、メモリ容量を確認することをおすすめします。OOM エラーは、メモリが 1 TiB 未満のマシンで発生する可能性が高くなります。
プロファイル、検出された高パフォーマンス マシンタイプ、
gcsfuse
コマンド、または Cloud Storage FUSE 構成ファイルを使用して構成値を指定する場合、メソッドは次の順序で優先されます(上位のメソッドは下位のメソッドよりも優先されます)。gcsfuse
コマンドまたは Cloud Storage FUSE 構成ファイルの一部として設定された値。gcsfuse
コマンドの--profiles
オプションの引数として設定された値、または Cloud Storage FUSE 構成ファイルのprofile
フィールドの値。Cloud Storage FUSE がハイ パフォーマンス マシンタイプが使用されていることを検出したときに設定される自動構成値。詳細については、自動構成値をご覧ください。
Google Kubernetes Engine Pod の Cloud Storage FUSE CSI ボリュームは、
profile
フィールドまたは--profile
オプションをサポートしていません。ファイル キャッシュには、一般化できない Cloud Storage FUSE 構成フィールドと Cloud Storage FUSE CLI オプションを使用する必要があるため、プロファイル ベースの構成を使用してファイル キャッシュを有効にすることはできません。サービング、トレーニング、チェックポインティング ワークロードのファイル キャッシュを有効にするには、ファイル キャッシュ オプションまたはフィールドを明示的に構成する必要があります。
トレーニング ワークロードにプロファイルベースの構成を適用する
トレーニング専用のプロファイルは、大規模なデータセットの高スループット読み取りのパフォーマンスを最適化し、Cloud GPU と Cloud TPU ハードウェアがデータを待機しないようにします。
トレーニング固有のプロファイルを適用するには、Cloud Storage FUSE 構成ファイルを使用して profile=aiml-training
を指定するか、Cloud Storage FUSE CLI を使用して --profile=aiml-training
を指定します。次の構成が適用されます。
# Create implicit directories locally when accessed:
- implicit-dirs
# Disable caching for lookups of files or directories that don't exist:
- metadata-cache:negative-ttl-secs:0
# Keep cached metadata (file attributes, types) indefinitely time-wise:
- metadata-cache:ttl-secs:-1
# Allow unlimited size for the file attribute (stat) cache:
- metadata-cache:stat-cache-max-size-mb:-1
# Allow unlimited size for the file/directory type cache:
- metadata-cache:type-cache-max-size-mb:-1
チェックポイント ワークロードにプロファイルベースの構成を適用する
チェックポイント固有のプロファイルは、マルチギガバイトのチェックポイントの保存にかかる時間を大幅に短縮し、トレーニングの一時停止を最小限に抑えることで、大きなファイルの高スループット書き込みのパフォーマンスを最適化します。
トレーニング固有のプロファイルを適用するには、Cloud Storage FUSE 構成ファイルを使用して profile=aiml-checkpointing
を指定するか、Cloud Storage FUSE CLI を使用して --profile=aiml-checkpointing
を指定します。次の構成が適用されます。
# Create implicit directories locally when accessed:
- implicit-dirs
# Disable caching for lookups of files/dirs that don't exist:
- metadata-cache:negative-ttl-secs:0
# Keep cached metadata (file attributes, types) indefinitely time-wise:
- metadata-cache:ttl-secs:-1
# Allow unlimited size for the file attribute (stat) cache:
- metadata-cache:stat-cache-max-size-mb:-1
# Allow unlimited size for the file/directory type cache:
- metadata-cache:type-cache-max-size-mb:-1
# Cache the entire file when any part is read sequentially:
- file-cache:cache-file-for-range-read:true
# Allow renaming directories with a lot of files in non-HNS buckets.
- file-system:rename-dir-limit:200000
サービング ワークロードにプロファイル ベースの構成を適用する
Serving は、データアクセスとキャッシュ保存のメカニズムを改善することで、サービング ワークロードのパフォーマンスを最適化します。
トレーニング固有のプロファイルを適用するには、Cloud Storage FUSE 構成ファイルを使用して profile=aiml-serving
を指定するか、Cloud Storage FUSE CLI を使用して --profile=aiml-serving
を指定します。次の構成が適用されます。
# Create implicit directories locally when accessed:
- implicit-dirs
# Disable caching for lookups of files/dirs that don't exist:
- metadata-cache:negative-ttl-secs:0
# Keep cached metadata (file attributes, types) indefinitely time-wise:
- metadata-cache:ttl-secs:-1
# Allow unlimited size for the file attribute (stat) cache:
- metadata-cache:stat-cache-max-size-mb:-1
# Allow unlimited size for the file/directory type cache:
- metadata-cache:type-cache-max-size-mb:-1
# Cache the entire file when any part is read sequentially:
- file-cache:cache-file-for-range-read:true
# Enable kernel-list-cache to make listing faster as this is a readonly file system hierarchy.
- file-system:kernel-list-cache-ttl-secs:-1
次のステップ
ハイパフォーマンス マシンタイプの自動構成値について学習する。
事前構成済みの GKE YAML ファイルを使用してパフォーマンスを最適化する方法について説明します。