Skip to content

Commit 39d7767

Browse files
committed
Add GPU to ClusterConfiguration
1 parent f69d5e4 commit 39d7767

13 files changed

+26
-17
lines changed

demo-notebooks/additional-demos/hf_interactive.ipynb

+2-1
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,13 @@
9393
"# The SDK will try to find the name of your default local queue based on the annotation \"kueue.x-k8s.io/default-queue\": \"true\" unless you specify the local queue manually below\n",
9494
"cluster = Cluster(ClusterConfiguration(name='hfgputest', \n",
9595
" namespace=\"default\", # Update to your namespace\n",
96+
" head_gpus=1, # For GPU enabled workloads set the head_gpus and num_gpus\n",
97+
" num_gpus=1,\n",
9698
" num_workers=1,\n",
9799
" min_cpus=8, \n",
98100
" max_cpus=8, \n",
99101
" min_memory=16, \n",
100102
" max_memory=16, \n",
101-
" num_gpus=4,\n",
102103
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
103104
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
104105
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",

demo-notebooks/additional-demos/local_interactive.ipynb

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@
5555
"\n",
5656
"cluster = Cluster(ClusterConfiguration(namespace=namespace,\n",
5757
" name=cluster_name,\n",
58+
" head_gpus=0, # For GPU enabled workloads set the head_gpus and num_gpus\n",
59+
" num_gpus=0,\n",
5860
" num_workers=1,\n",
5961
" min_cpus=1,\n",
6062
" max_cpus=1,\n",
6163
" min_memory=4,\n",
6264
" max_memory=4,\n",
63-
" num_gpus=0,\n",
6465
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
6566
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
6667
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",

demo-notebooks/additional-demos/ray_job_client.ipynb

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@
4646
"cluster = Cluster(ClusterConfiguration(\n",
4747
" name='jobtest',\n",
4848
" namespace='default', # Update to your namespace\n",
49+
" head_gpus=0, # For GPU enabled workloads set the head_gpus and num_gpus\n",
50+
" num_gpus=0,\n",
4951
" num_workers=2,\n",
5052
" min_cpus=1,\n",
5153
" max_cpus=1,\n",
5254
" min_memory=4,\n",
5355
" max_memory=4,\n",
54-
" num_gpus=0,\n",
5556
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
5657
" write_to_file=False # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
5758
"))"

demo-notebooks/guided-demos/0_basic_ray.ipynb

+3-2
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,15 @@
6161
"# Create and configure our cluster object\n",
6262
"# The SDK will try to find the name of your default local queue based on the annotation \"kueue.x-k8s.io/default-queue\": \"true\" unless you specify the local queue manually below\n",
6363
"cluster = Cluster(ClusterConfiguration(\n",
64-
" name='raytest',\n",
64+
" name='raytest', \n",
6565
" namespace='default', # Update to your namespace\n",
66+
" head_gpus=0, # For GPU enabled workloads set the head_gpus and num_gpus\n",
67+
" num_gpus=0,\n",
6668
" num_workers=2,\n",
6769
" min_cpus=1,\n",
6870
" max_cpus=1,\n",
6971
" min_memory=4,\n",
7072
" max_memory=4,\n",
71-
" num_gpus=0,\n",
7273
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
7374
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
7475
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",

demo-notebooks/guided-demos/1_cluster_job_client.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@
4545
"cluster = Cluster(ClusterConfiguration(\n",
4646
" name='jobtest',\n",
4747
" namespace='default', # Update to your namespace\n",
48+
" head_gpus=1, # For GPU enabled workloads set the head_gpus and num_gpus\n",
49+
" num_gpus=1,\n",
4850
" num_workers=2,\n",
4951
" min_cpus=1,\n",
5052
" max_cpus=1,\n",
5153
" min_memory=4,\n",
5254
" max_memory=4,\n",
53-
" num_gpus=1,\n",
54-
" head_gpus=1,\n",
5555
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
5656
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
5757
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",

demo-notebooks/guided-demos/2_basic_interactive.ipynb

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@
6262
"cluster = Cluster(ClusterConfiguration(\n",
6363
" name=cluster_name,\n",
6464
" namespace=namespace,\n",
65+
" head_gpus=1, # For GPU enabled workloads set the head_gpus and num_gpus\n",
66+
" num_gpus=1,\n",
6567
" num_workers=2,\n",
6668
" min_cpus=2,\n",
6769
" max_cpus=2,\n",
6870
" min_memory=8,\n",
6971
" max_memory=8,\n",
70-
" num_gpus=1,\n",
7172
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
7273
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
7374
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",

demo-notebooks/guided-demos/notebook-ex-outputs/0_basic_ray.ipynb

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,13 @@
7171
"cluster = Cluster(ClusterConfiguration(\n",
7272
" name='raytest',\n",
7373
" namespace='default', # Update to your namespace\n",
74+
" head_gpus=0, # For GPU enabled workloads set the head_gpus and num_gpus\n",
75+
" num_gpus=0,\n",
7476
" num_workers=2,\n",
7577
" min_cpus=1,\n",
7678
" max_cpus=1,\n",
7779
" min_memory=4,\n",
7880
" max_memory=4,\n",
79-
" num_gpus=0,\n",
8081
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
8182
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
8283
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",

demo-notebooks/guided-demos/notebook-ex-outputs/1_cluster_job_client.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@
4545
"cluster = Cluster(ClusterConfiguration(\n",
4646
" name='jobtest',\n",
4747
" namespace='default', # Update to your namespace\n",
48+
" head_gpus=1, # For GPU enabled workloads set the head_gpus and num_gpus\n",
49+
" num_gpus=1,\n",
4850
" num_workers=2,\n",
4951
" min_cpus=1,\n",
5052
" max_cpus=1,\n",
5153
" min_memory=4,\n",
5254
" max_memory=4,\n",
53-
" num_gpus=1,\n",
54-
" head_gpus=1,\n",
5555
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
5656
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
5757
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",

demo-notebooks/guided-demos/notebook-ex-outputs/2_basic_interactive.ipynb

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,13 @@
7070
"cluster = Cluster(ClusterConfiguration(\n",
7171
" name=cluster_name,\n",
7272
" namespace=namespace,\n",
73+
" head_gpus=1, # For GPU enabled workloads set the head_gpus and num_gpus\n",
74+
" num_gpus=1,\n",
7375
" num_workers=2,\n",
7476
" min_cpus=2,\n",
7577
" max_cpus=2,\n",
7678
" min_memory=8,\n",
7779
" max_memory=8,\n",
78-
" num_gpus=1,\n",
7980
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
8081
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
8182
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",

demo-notebooks/guided-demos/preview_nbs/0_basic_ray.ipynb

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,13 @@
6363
"cluster = Cluster(ClusterConfiguration(\n",
6464
" name='raytest',\n",
6565
" namespace='default', # Update to your namespace\n",
66+
" head_gpus=0, # For GPU enabled workloads set the head_gpus and num_gpus\n",
67+
" num_gpus=0,\n",
6668
" num_workers=2,\n",
6769
" min_cpus=1,\n",
6870
" max_cpus=1,\n",
6971
" min_memory=4,\n",
7072
" max_memory=4,\n",
71-
" num_gpus=0,\n",
7273
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
7374
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
7475
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",

demo-notebooks/guided-demos/preview_nbs/1_cluster_job_client.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@
4545
"cluster = Cluster(ClusterConfiguration(\n",
4646
" name='jobtest',\n",
4747
" namespace='default', # Update to your namespace\n",
48+
" head_gpus=1, # For GPU enabled workloads set the head_gpus and num_gpus\n",
49+
" num_gpus=1,\n",
4850
" num_workers=2,\n",
4951
" min_cpus=1,\n",
5052
" max_cpus=1,\n",
5153
" min_memory=4,\n",
5254
" max_memory=4,\n",
53-
" num_gpus=1,\n",
54-
" head_gpus=1,\n",
5555
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
5656
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources\n",
5757
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",

demo-notebooks/guided-demos/preview_nbs/2_basic_interactive.ipynb

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@
6262
"cluster = Cluster(ClusterConfiguration(\n",
6363
" name=cluster_name,\n",
6464
" namespace=namespace,\n",
65+
" head_gpus=1, # For GPU enabled workloads set the head_gpus and num_gpus\n",
66+
" num_gpus=1,\n",
6567
" num_workers=2,\n",
6668
" min_cpus=2,\n",
6769
" max_cpus=2,\n",
6870
" min_memory=8,\n",
6971
" max_memory=8,\n",
70-
" num_gpus=1,\n",
7172
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
7273
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
7374
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",

docs/cluster-configuration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ cluster = Cluster(ClusterConfiguration(
1212
head_cpus=1, # Default 2
1313
head_memory=1, # Default 8
1414
head_gpus=0, # Default 0
15+
num_gpus=0, # Default 0
1516
num_workers=1, # Default 1
1617
min_cpus=1, # Default 1
1718
max_cpus=1, # Default 1
1819
min_memory=2, # Default 2
1920
max_memory=2, # Default 2
20-
num_gpus=0, # Default 0
2121
mcad=True, # Default True
2222
image="quay.io/project-codeflare/ray:latest-py39-cu118", # Mandatory Field
2323
machine_types=["m5.xlarge", "g4dn.xlarge"],

0 commit comments

Comments
 (0)