Skip to content

Commit 4aa1576

Browse files
authored
Merge pull request GoogleCloudPlatform#4441 from samskillman/gcs-fuse-optimization
Add optimized gcsfuse configurations to A3 Ultra and A4 blueprints.
2 parents 56d66ac + c356ac6 commit 4aa1576

9 files changed

Lines changed: 245 additions & 4 deletions

File tree

examples/machine-learning/a3-ultragpu-8g/README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ see:
66

77
[Create A3 Ultra Slurm Cluster](https://cloud.google.com/ai-hypercomputer/docs/create/create-slurm-cluster)
88

9+
### Cloud Storage FUSE
10+
11+
This blueprint includes four Cloud Storage FUSE mounts to provide a simple and scalable way
12+
to manage data.
13+
14+
1. `/gcs` is a general purpose mount that can be used for shared tools and data.
15+
1. `/gcs-checkpoints` is an optimized mount for writing and reading checkpoints. It
16+
uses the local SSD for caching and enables parallel downloads to improve
17+
performance.
18+
1. `/gcs-training-data` is an optimized mount for reading training data. It can
19+
be further tuned if the training data fits fully within the local ssd
20+
storage.
21+
1. `/gcs-model-serving` is an optimized mount for serving models, which
22+
downloads model weights in parallel to local ssd.
23+
924
## VMs without scheduler
1025

1126
To test workloads directly on A3 Ultra VMs, you can deploy the [a3ultra-vm.yaml]:
@@ -24,8 +39,10 @@ Cluster toolkit also supports DWS Flex-Start, Spot VMs, as well as reservations
2439
[For more information on DWS Flex-Start in Slurm](https://github.com/GoogleCloudPlatform/cluster-toolkit/blob/main/docs/slurm-dws-flex.md)
2540
[For more information on Spot VMs](https://cloud.google.com/compute/docs/instances/spot)
2641

27-
We provide ways to enable the alternative provisioning models in the `a3ultra-slurm-deployment.yaml` file.
42+
We provide ways to enable the alternative provisioning models in the
43+
`a3ultra-slurm-deployment.yaml` file.
2844

29-
To make use of these other models, replace `a3u_reservation_name` in the deployment file with the variable of choice below.
45+
To make use of these other models, replace `a3u_reservation_name` in the
46+
deployment file with the variable of choice below.
3047

3148
`a3u_enable_spot_vm: true` for spot or `a3u_dws_flex_enabled: true` for DWS Flex-Start.

examples/machine-learning/a3-ultragpu-8g/a3ultra-slurm-blueprint.yaml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ deployment_groups:
246246
source_image_project_id: [$(vars.base_image.project)]
247247
image_family: $(vars.instance_image.family)
248248
omit_external_ip: false
249+
249250
# Unattended upgrades are disabled in this blueprint so that software does not
250251
# get updated daily and lead to potential instability in the cluster environment.
251252
#
@@ -355,6 +356,98 @@ deployment_groups:
355356
# outputs:
356357
# - network_storage
357358

359+
# The following four modules create and mount a Cloud Storage Bucket with
360+
# gcsfuse. They are optional but recommended for many use cases.
361+
# (Optional) The following creates a GCS bucket that will be mounted
362+
# using gcsfuse. If you prefer to use a pre-existing bucket, use the
363+
# modules/file-system/pre-existing-network-storage module.
364+
- id: gcs_bucket
365+
source: community/modules/file-system/cloud-storage-bucket
366+
settings:
367+
enable_hierarchical_namespace: true
368+
local_mount: /gcs
369+
random_suffix: true
370+
mount_options: "implicit-dirs,\
371+
metadata-cache-negative-ttl-secs=0,\
372+
metadata-cache-ttl-secs=-1,\
373+
stat-cache-max-size-mb=-1,\
374+
type-cache-max-size-mb=-1,\
375+
enable-streaming-writes=true,\
376+
dir-mode=777,\
377+
file-mode=777,\
378+
allow_other"
379+
380+
# (Optional) Create a mount-point optimized for checkpoint writing/reading Uses
381+
# local-ssd for and enables parallel downloads. For more information on
382+
# these flags, see
383+
# https://github.com/GoogleCloudPlatform/gcsfuse/tree/master/samples/gcsfuse_config
384+
- id: gcs_checkpoints
385+
source: modules/file-system/pre-existing-network-storage
386+
settings:
387+
remote_mount: $(gcs_bucket.gcs_bucket_name)
388+
local_mount: /gcs-checkpoints
389+
fs_type: gcsfuse
390+
mount_options: "implicit-dirs,\
391+
metadata-cache-negative-ttl-secs=0,\
392+
metadata-cache-ttl-secs=-1,\
393+
stat-cache-max-size-mb=-1,\
394+
type-cache-max-size-mb=-1,\
395+
file-cache-max-size-mb=-1,\
396+
file-cache-cache-file-for-range-read=true,\
397+
file-cache-enable-parallel-downloads=true,\
398+
cache-dir=/mnt/localssd,\
399+
enable-streaming-writes=true,\
400+
dir-mode=777,\
401+
file-mode=777,\
402+
allow_other"
403+
404+
# (Optional) Create a mount-point optimized for reading training data.
405+
# For more information on these flags, see
406+
# https://github.com/GoogleCloudPlatform/gcsfuse/tree/master/samples/gcsfuse_config
407+
# If your training dataset fits on localssd, then you may want to enable file
408+
# cache as well, which is done by adding
409+
# cache-dir=/mnt/localssd,\
410+
# file-cache-max-size-mb=<DATASET_SIZE>,\
411+
# file-cache-cache-file-for-range-read=true,\
412+
# to the mount_options.
413+
- id: gcs_training_data
414+
source: modules/file-system/pre-existing-network-storage
415+
settings:
416+
remote_mount: $(gcs_bucket.gcs_bucket_name)
417+
local_mount: /gcs-training-data
418+
fs_type: gcsfuse
419+
mount_options: "implicit-dirs,\
420+
metadata-cache-negative-ttl-secs=0,\
421+
metadata-cache-ttl-secs=-1,\
422+
stat-cache-max-size-mb=-1,\
423+
type-cache-max-size-mb=-1,\
424+
enable-streaming-writes=true,\
425+
dir-mode=777,\
426+
file-mode=777,\
427+
allow_other"
428+
429+
# (Optional) Create a mount-point optimized for model serving.
430+
# For more information on these flags, see
431+
# https://github.com/GoogleCloudPlatform/gcsfuse/tree/master/samples/gcsfuse_config
432+
- id: gcs_model_serving
433+
source: modules/file-system/pre-existing-network-storage
434+
settings:
435+
remote_mount: $(gcs_bucket.gcs_bucket_name)
436+
local_mount: /gcs-model-serving
437+
fs_type: gcsfuse
438+
mount_options: "implicit-dirs,\
439+
cache-dir=/mnt/localssd,\
440+
metadata-cache-negative-ttl-secs=0,\
441+
metadata-cache-ttl-secs=-1,\
442+
stat-cache-max-size-mb=-1,\
443+
type-cache-max-size-mb=-1,\
444+
file-cache-max-size-mb=-1,\
445+
file-cache-cache-file-for-range-read=true,\
446+
file-cache-enable-parallel-downloads=true,\
447+
dir-mode=777,\
448+
file-mode=777,\
449+
allow_other"
450+
358451
- group: cluster
359452
modules:
360453
- id: a3ultra_startup
@@ -371,6 +464,12 @@ deployment_groups:
371464
"data-root": "$(vars.local_ssd_mountpoint)/docker"
372465
}
373466
runners:
467+
- $(gcs_checkpoints.client_install_runner)
468+
- $(gcs_checkpoints.mount_runner)
469+
- $(gcs_training_data.client_install_runner)
470+
- $(gcs_training_data.mount_runner)
471+
- $(gcs_model_serving.client_install_runner)
472+
- $(gcs_model_serving.mount_runner)
374473
- type: data
375474
destination: /etc/enroot/enroot.conf
376475
content: |
@@ -567,6 +666,7 @@ deployment_groups:
567666
- a3_ultra_partition
568667
- slurm_login
569668
- homefs
669+
- gcs_bucket
570670
settings:
571671
enable_controller_public_ips: true
572672
disk_type: pd-extreme

examples/machine-learning/a4-highgpu-8g/README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ see:
66

77
[Create an AI-optimized Slurm cluster](https://cloud.google.com/ai-hypercomputer/docs/create/create-slurm-cluster)
88

9+
### Cloud Storage FUSE
10+
11+
This blueprint includes four Cloud Storage FUSE mounts to provide a simple and scalable way
12+
to manage data.
13+
14+
1. `/gcs` is a general purpose mount that can be used for shared tools and data.
15+
1. `/gcs-checkpoints` is an optimized mount for writing and reading checkpoints. It
16+
uses the local SSD for caching and enables parallel downloads to improve
17+
performance.
18+
1. `/gcs-training-data` is an optimized mount for reading training data. It can
19+
be further tuned if the training data fits fully within the local ssd
20+
storage.
21+
1. `/gcs-model-serving` is an optimized mount for serving models, which
22+
downloads model weights in parallel to local ssd.
23+
924
## A4-High VMs
1025

1126
### Build the Cluster Toolkit gcluster binary
@@ -66,9 +81,11 @@ Cluster toolkit also supports DWS Flex-Start, Spot VMs, as well as reservations
6681
[For more information on DWS Flex-Start in Slurm](https://github.com/GoogleCloudPlatform/cluster-toolkit/blob/main/docs/slurm-dws-flex.md)
6782
[For more information on Spot VMs](https://cloud.google.com/compute/docs/instances/spot)
6883
69-
We provide ways to enable the alternative provisioning models in the `a4high-slurm-deployment.yaml` file.
84+
We provide ways to enable the alternative provisioning models in the
85+
`a4high-slurm-deployment.yaml` file.
7086

71-
To make use of these other models, replace `a4h_reservation_name` in the deployment file with the variable of choice below.
87+
To make use of these other models, replace `a4h_reservation_name` in the
88+
deployment file with the variable of choice below.
7289

7390
`a4h_enable_spot_vm: true` for spot or `a4h_dws_flex_enabled: true` for DWS Flex-Start.
7491

examples/machine-learning/a4-highgpu-8g/a4high-slurm-blueprint.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,98 @@ deployment_groups:
356356
# outputs:
357357
# - network_storage
358358

359+
# The following four modules create and mount a Cloud Storage Bucket with
360+
# gcsfuse. They are optional but recommended for many use cases.
361+
# (Optional) The following creates a GCS bucket that will be mounted
362+
# using gcsfuse. If you prefer to use a pre-existing bucket, use the
363+
# modules/file-system/pre-existing-network-storage module.
364+
- id: gcs_bucket
365+
source: community/modules/file-system/cloud-storage-bucket
366+
settings:
367+
enable_hierarchical_namespace: true
368+
local_mount: /gcs
369+
random_suffix: true
370+
mount_options: "implicit-dirs,\
371+
metadata-cache-negative-ttl-secs=0,\
372+
metadata-cache-ttl-secs=-1,\
373+
stat-cache-max-size-mb=-1,\
374+
type-cache-max-size-mb=-1,\
375+
enable-streaming-writes=true,\
376+
dir-mode=777,\
377+
file-mode=777,\
378+
allow_other"
379+
380+
# (Optional) Create a mount-point optimized for checkpoint writing/reading Uses
381+
# local-ssd for and enables parallel downloads. For more information on
382+
# these flags, see
383+
# https://github.com/GoogleCloudPlatform/gcsfuse/tree/master/samples/gcsfuse_config
384+
- id: gcs_checkpoints
385+
source: modules/file-system/pre-existing-network-storage
386+
settings:
387+
remote_mount: $(gcs_bucket.gcs_bucket_name)
388+
local_mount: /gcs-checkpoints
389+
fs_type: gcsfuse
390+
mount_options: "implicit-dirs,\
391+
metadata-cache-negative-ttl-secs=0,\
392+
metadata-cache-ttl-secs=-1,\
393+
stat-cache-max-size-mb=-1,\
394+
type-cache-max-size-mb=-1,\
395+
file-cache-max-size-mb=-1,\
396+
file-cache-cache-file-for-range-read=true,\
397+
file-cache-enable-parallel-downloads=true,\
398+
cache-dir=/mnt/localssd,\
399+
enable-streaming-writes=true,\
400+
dir-mode=777,\
401+
file-mode=777,\
402+
allow_other"
403+
404+
# (Optional) Create a mount-point optimized for reading training data.
405+
# For more information on these flags, see
406+
# https://github.com/GoogleCloudPlatform/gcsfuse/tree/master/samples/gcsfuse_config
407+
# If your training dataset fits on localssd, then you may want to enable file
408+
# cache as well, which is done by adding
409+
# cache-dir=/mnt/localssd,\
410+
# file-cache-max-size-mb=<DATASET_SIZE>,\
411+
# file-cache-cache-file-for-range-read=true,\
412+
# to the mount_options.
413+
- id: gcs_training_data
414+
source: modules/file-system/pre-existing-network-storage
415+
settings:
416+
remote_mount: $(gcs_bucket.gcs_bucket_name)
417+
local_mount: /gcs-training-data
418+
fs_type: gcsfuse
419+
mount_options: "implicit-dirs,\
420+
metadata-cache-negative-ttl-secs=0,\
421+
metadata-cache-ttl-secs=-1,\
422+
stat-cache-max-size-mb=-1,\
423+
type-cache-max-size-mb=-1,\
424+
enable-streaming-writes=true,\
425+
dir-mode=777,\
426+
file-mode=777,\
427+
allow_other"
428+
429+
# (Optional) Create a mount-point optimized for model serving.
430+
# For more information on these flags, see
431+
# https://github.com/GoogleCloudPlatform/gcsfuse/tree/master/samples/gcsfuse_config
432+
- id: gcs_model_serving
433+
source: modules/file-system/pre-existing-network-storage
434+
settings:
435+
remote_mount: $(gcs_bucket.gcs_bucket_name)
436+
local_mount: /gcs-model-serving
437+
fs_type: gcsfuse
438+
mount_options: "implicit-dirs,\
439+
cache-dir=/mnt/localssd,\
440+
metadata-cache-negative-ttl-secs=0,\
441+
metadata-cache-ttl-secs=-1,\
442+
stat-cache-max-size-mb=-1,\
443+
type-cache-max-size-mb=-1,\
444+
file-cache-max-size-mb=-1,\
445+
file-cache-cache-file-for-range-read=true,\
446+
file-cache-enable-parallel-downloads=true,\
447+
dir-mode=777,\
448+
file-mode=777,\
449+
allow_other"
450+
359451
- group: cluster
360452
modules:
361453
- id: a4high_startup
@@ -372,6 +464,12 @@ deployment_groups:
372464
"data-root": "$(vars.local_ssd_mountpoint)/docker"
373465
}
374466
runners:
467+
- $(gcs_checkpoints.client_install_runner)
468+
- $(gcs_checkpoints.mount_runner)
469+
- $(gcs_training_data.client_install_runner)
470+
- $(gcs_training_data.mount_runner)
471+
- $(gcs_model_serving.client_install_runner)
472+
- $(gcs_model_serving.mount_runner)
375473
- type: data
376474
destination: /etc/enroot/enroot.conf
377475
content: |
@@ -573,6 +671,7 @@ deployment_groups:
573671
- a4high_partition
574672
- slurm_login
575673
- homefs
674+
- gcs_bucket
576675
settings:
577676
enable_controller_public_ips: true
578677
disk_type: pd-extreme

tools/cloud-build/daily-tests/builds/ml-a3-ultragpu-slurm.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
---
1616
tags:
1717
- m.custom-image
18+
- m.cloud-storage-bucket
19+
- m.pre-existing-network-storage
1820
- m.filestore
1921
- m.gpu-rdma-vpc
2022
- m.schedmd-slurm-gcp-v6-controller

tools/cloud-build/daily-tests/builds/ml-a4-highgpu-slurm-flex.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
---
1616
tags:
1717
- m.custom-image
18+
- m.cloud-storage-bucket
19+
- m.pre-existing-network-storage
1820
- m.filestore
1921
- m.gpu-rdma-vpc
2022
- m.schedmd-slurm-gcp-v6-controller

tools/cloud-build/daily-tests/builds/ml-a4-highgpu-slurm.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
---
1616
tags:
1717
- m.custom-image
18+
- m.cloud-storage-bucket
19+
- m.pre-existing-network-storage
1820
- m.filestore
1921
- m.gpu-rdma-vpc
2022
- m.schedmd-slurm-gcp-v6-controller

tools/cloud-build/daily-tests/tests/ml-a3-ultragpu-slurm.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ custom_vars:
4040
- a3ultra
4141
mounts:
4242
- /home
43+
- /gcs
4344
cli_deployment_vars:
4445
region: "{{ region }}"
4546
zone: "{{ zone }}"

tools/cloud-build/daily-tests/tests/ml-a4-highgpu-slurm.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ custom_vars:
4040
- a4high
4141
mounts:
4242
- /home
43+
- /gcs
4344
cli_deployment_vars:
4445
region: "{{ region }}"
4546
zone: "{{ zone }}"

0 commit comments

Comments
 (0)