このドキュメントでは、プロファイルに基づく構成を使用して、人工知能(AI)や機械学習(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)エラーが発生する可能性があります。そのため、プロファイルに基づく構成を適用する前に、メモリ容量を確認することをおすすめします。メモリが 1 TiB 未満のマシンでは、OOM エラーの発生確率が高まります。
Cloud Storage FUSE パラメータが複数の方法で構成されている場合、次の優先順位が適用されます(優先順位の高い順に示します)。
gcsfuseコマンドまたは Cloud Storage FUSE 構成ファイルで直接設定された値。- プロファイルで設定された値。プロファイルは、
gcsfuseコマンドの--profileオプションまたは 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
サービング ワークロードにプロファイルに基づく構成を適用する
サービングは、データアクセスとキャッシュ保存メカニズムを改善することで、サービング ワークロードのパフォーマンスを最適化します。
サービング固有のプロファイルを適用するには、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
次のステップ
ハイパフォーマンス マシンタイプの自動構成値について詳細を学習する。