Cloud Storage FUSE 的設定檔設定可讓您根據人工智慧或機器學習 (AI/機器學習) 工作負載類型,套用預先定義的最佳化功能組合,用於快取、執行緒和緩衝區空間。設定檔可協助您簡化 Cloud Storage FUSE 設定,輕鬆達成高效能。
如要套用設定檔,請使用 profile 欄位或 --profile 選項,並指定下列其中一個值:aiml-training (訓練工作負載)、aiml-checkpointing (檢查點工作負載) 或 aiml-serving (提供工作負載)。
注意事項
您只能在掛接作業期間設定
--profile選項或profile欄位。如要更新--profile選項或profile欄位,請重新掛接 Cloud Storage FUSE bucket。使用設定檔設定時,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
套用設定檔設定,為工作負載建立檢查點
查核點專用設定檔可大幅縮短儲存數 GB 查核點所需的時間,盡可能減少訓練暫停時間,進而提升大型檔案高處理量寫入作業的效能。
如要套用檢查點專用設定檔,請使用 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
# 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 則會改善資料存取和快取機制,提升 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
# 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