Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions demo-notebooks/additional-demos/hf_interactive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
"\n",
"NOTE: The default images used by the CodeFlare SDK for creating a RayCluster resource depend on the installed Python version:\n",
"\n",
"- For Python 3.11: 'quay.io/modh/ray:2.47.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.47.1-py312-cu128'\n",
"- For Python 3.11: 'quay.io/modh/ray:2.52.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.52.1-py312-cu128'\n",
"\n",
"If you prefer to use a custom Ray image that better suits your needs, you can specify it in the image field to override the default."
]
Expand All @@ -86,18 +86,21 @@
"# Create our cluster and submit\n",
"# 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",
"cluster_name= \"hfgputest\"\n",
"cluster = Cluster(ClusterConfiguration(name=cluster_name, \n",
" head_extended_resource_requests={'nvidia.com/gpu':1}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests\n",
" worker_extended_resource_requests={'nvidia.com/gpu':1},\n",
" num_workers=1,\n",
" worker_cpu_requests=8, \n",
" worker_cpu_limits=8, \n",
" worker_memory_requests=16, \n",
" worker_memory_limits=16, \n",
" # image=\"\", # Optional Field \n",
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",
" ))"
"cluster = Cluster(ClusterConfiguration(\n",
" name=cluster_name, \n",
" head_memory_requests=6,\n",
" head_memory_limits=8,\n",
" head_extended_resource_requests={'nvidia.com/gpu':1}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests\n",
" worker_extended_resource_requests={'nvidia.com/gpu':1},\n",
" num_workers=1,\n",
" worker_cpu_requests=8, \n",
" worker_cpu_limits=8, \n",
" worker_memory_requests=16, \n",
" worker_memory_limits=16, \n",
" # image=\"\", # Optional Field \n",
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",
"))"
]
},
{
Expand Down
30 changes: 16 additions & 14 deletions demo-notebooks/additional-demos/local_interactive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"\n",
"NOTE: The default images used by the CodeFlare SDK for creating a RayCluster resource depend on the installed Python version:\n",
"\n",
"- For Python 3.11: 'quay.io/modh/ray:2.47.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.47.1-py312-cu128'\n",
"- For Python 3.11: 'quay.io/modh/ray:2.52.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.52.1-py312-cu128'\n",
"\n",
"If you prefer to use a custom Ray image that better suits your needs, you can specify it in the image field to override the default."
]
Expand All @@ -57,18 +57,20 @@
"cluster_name = \"hfgputest-1\"\n",
"\n",
"cluster = Cluster(ClusterConfiguration(\n",
" name=cluster_name,\n",
" head_extended_resource_requests={'nvidia.com/gpu':0}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests\n",
" worker_extended_resource_requests={'nvidia.com/gpu':0},\n",
" num_workers=1,\n",
" worker_cpu_requests=1,\n",
" worker_cpu_limits=1,\n",
" worker_memory_requests=4,\n",
" worker_memory_limits=4,\n",
" # image=\"\", # Optional Field \n",
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",
" ))"
" name=cluster_name,\n",
" head_memory_requests=6,\n",
" head_memory_limits=8,\n",
" head_extended_resource_requests={'nvidia.com/gpu':0}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests\n",
" worker_extended_resource_requests={'nvidia.com/gpu':0},\n",
" num_workers=1,\n",
" worker_cpu_requests=1,\n",
" worker_cpu_limits=1,\n",
" worker_memory_requests=4,\n",
" worker_memory_limits=6,\n",
" # image=\"\", # Optional Field \n",
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",
"))"
]
},
{
Expand Down
8 changes: 5 additions & 3 deletions demo-notebooks/additional-demos/ray_job_client.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"\n",
"NOTE: The default images used by the CodeFlare SDK for creating a RayCluster resource depend on the installed Python version:\n",
"\n",
"- For Python 3.11: 'quay.io/modh/ray:2.47.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.47.1-py312-cu128'\n",
"- For Python 3.11: 'quay.io/modh/ray:2.52.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.52.1-py312-cu128'\n",
"\n",
"If you prefer to use a custom Ray image that better suits your needs, you can specify it in the image field to override the default."
]
Expand All @@ -59,13 +59,15 @@
"# 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",
"cluster = Cluster(ClusterConfiguration(\n",
" name='jobtest',\n",
" head_memory_requests=6,\n",
" head_memory_limits=8,\n",
" head_extended_resource_requests={'nvidia.com/gpu':0}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests\n",
" worker_extended_resource_requests={'nvidia.com/gpu':0},\n",
" num_workers=2,\n",
" worker_cpu_requests=1,\n",
" worker_cpu_limits=1,\n",
" worker_memory_requests=4,\n",
" worker_memory_limits=4,\n",
" worker_memory_limits=6,\n",
" # image=\"\", # Optional Field \n",
" write_to_file=False # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",
Expand Down
10 changes: 5 additions & 5 deletions demo-notebooks/guided-demos/0_basic_ray.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"\n",
"NOTE: The default images used by the CodeFlare SDK for creating a RayCluster resource depend on the installed Python version:\n",
"\n",
"- For Python 3.11: 'quay.io/modh/ray:2.47.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.47.1-py312-cu128'\n",
"- For Python 3.11: 'quay.io/modh/ray:2.52.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.52.1-py312-cu128'\n",
"\n",
"If you prefer to use a custom Ray image that better suits your needs, you can specify it in the image field to override the default."
]
Expand All @@ -68,15 +68,15 @@
" name='raytest', \n",
" head_cpu_requests='500m',\n",
" head_cpu_limits='500m',\n",
" head_memory_requests=2,\n",
" head_memory_limits=2,\n",
" head_memory_requests=5,\n",
" head_memory_limits=8,\n",
" head_extended_resource_requests={'nvidia.com/gpu':0}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests\n",
" worker_extended_resource_requests={'nvidia.com/gpu':0},\n",
" num_workers=2,\n",
" worker_cpu_requests='250m',\n",
" worker_cpu_limits=1,\n",
" worker_memory_requests=4,\n",
" worker_memory_limits=4,\n",
" worker_memory_limits=6,\n",
" # image=\"\", # Optional Field \n",
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",
Expand Down
10 changes: 5 additions & 5 deletions demo-notebooks/guided-demos/1_cluster_job_client.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"\n",
"NOTE: The default images used by the CodeFlare SDK for creating a RayCluster resource depend on the installed Python version:\n",
"\n",
"- For Python 3.11: 'quay.io/modh/ray:2.47.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.47.1-py312-cu128'\n",
"- For Python 3.11: 'quay.io/modh/ray:2.52.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.52.1-py312-cu128'\n",
"\n",
"If you prefer to use a custom Ray image that better suits your needs, you can specify it in the image field to override the default."
]
Expand All @@ -61,15 +61,15 @@
" name='jobtest',\n",
" head_cpu_requests=1,\n",
" head_cpu_limits=1,\n",
" head_memory_requests=4,\n",
" head_memory_limits=4,\n",
" head_memory_requests=6,\n",
" head_memory_limits=8,\n",
" head_extended_resource_requests={'nvidia.com/gpu':1}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests\n",
" worker_extended_resource_requests={'nvidia.com/gpu':1},\n",
" num_workers=2,\n",
" worker_cpu_requests='250m',\n",
" worker_cpu_limits=1,\n",
" worker_memory_requests=4,\n",
" worker_memory_limits=4,\n",
" worker_memory_limits=6,\n",
" # image=\"\", # Optional Field \n",
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",
Expand Down
6 changes: 3 additions & 3 deletions demo-notebooks/guided-demos/2_basic_interactive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"\n",
"NOTE: The default images used by the CodeFlare SDK for creating a RayCluster resource depend on the installed Python version:\n",
"\n",
"- For Python 3.11: 'quay.io/modh/ray:2.47.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.47.1-py312-cu128'\n",
"- For Python 3.11: 'quay.io/modh/ray:2.52.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.52.1-py312-cu128'\n",
"\n",
"If you prefer to use a custom Ray image that better suits your needs, you can specify it in the image field to override the default."
]
Expand All @@ -67,7 +67,7 @@
" head_cpu_requests=1,\n",
" head_cpu_limits=1,\n",
" head_memory_requests=6,\n",
" head_memory_limits=6,\n",
" head_memory_limits=8,\n",
" head_extended_resource_requests={'nvidia.com/gpu':1}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests\n",
" worker_extended_resource_requests={'nvidia.com/gpu':1},\n",
" num_workers=2,\n",
Expand Down
12 changes: 6 additions & 6 deletions demo-notebooks/guided-demos/3_widget_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"\n",
"NOTE: The default images used by the CodeFlare SDK for creating a RayCluster resource depend on the installed Python version:\n",
"\n",
"- For Python 3.11: 'quay.io/modh/ray:2.47.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.47.1-py312-cu128'\n",
"- For Python 3.11: 'quay.io/modh/ray:2.52.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.52.1-py312-cu128'\n",
"\n",
"If you prefer to use a custom Ray image that better suits your needs, you can specify it in the image field to override the default."
]
Expand All @@ -68,15 +68,15 @@
" name='widgettest',\n",
" head_cpu_requests='500m',\n",
" head_cpu_limits='500m',\n",
" head_memory_requests=2,\n",
" head_memory_limits=2,\n",
" head_memory_requests=6,\n",
" head_memory_limits=8,\n",
" head_extended_resource_requests={'nvidia.com/gpu':0}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests\n",
" worker_extended_resource_requests={'nvidia.com/gpu':0},\n",
" num_workers=2,\n",
" worker_cpu_requests='250m',\n",
" worker_cpu_limits=1,\n",
" worker_memory_requests=2,\n",
" worker_memory_limits=2,\n",
" worker_memory_requests=4,\n",
" worker_memory_limits=6,\n",
" # image=\"\", # Optional Field\n",
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources\n",
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",
Expand Down
12 changes: 8 additions & 4 deletions demo-notebooks/guided-demos/4_rayjob_existing_cluster.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,17 @@
"source": [
"cluster = Cluster(ClusterConfiguration(\n",
" name='rayjob-cluster',\n",
" head_extended_resource_requests={'nvidia.com/gpu':0},\n",
" worker_extended_resource_requests={'nvidia.com/gpu':0},\n",
" head_cpu_requests=1,\n",
" head_cpu_limits=1,\n",
" head_memory_requests=6,\n",
" head_memory_limits=8,\n",
" head_extended_resource_requests={'nvidia.com/gpu':1},\n",
" worker_extended_resource_requests={'nvidia.com/gpu':1},\n",
" num_workers=2,\n",
" worker_cpu_requests=1,\n",
" worker_cpu_requests='250m',\n",
" worker_cpu_limits=1,\n",
" worker_memory_requests=4,\n",
" worker_memory_limits=4,\n",
" worker_memory_limits=6,\n",
"\n",
"))\n",
"\n",
Expand Down
4 changes: 3 additions & 1 deletion demo-notebooks/guided-demos/5_submit_rayjob_cr.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@
"outputs": [],
"source": [
"cluster_config = ManagedClusterConfig(\n",
" head_memory_requests=6,\n",
" head_memory_limits=8,\n",
" num_workers=2,\n",
" worker_cpu_requests=1,\n",
" worker_cpu_limits=1,\n",
" worker_memory_requests=4,\n",
" worker_memory_limits=4,\n",
" worker_memory_limits=6,\n",
" head_accelerators={'nvidia.com/gpu': 0},\n",
" worker_accelerators={'nvidia.com/gpu': 0},\n",
")"
Expand Down
12 changes: 0 additions & 12 deletions demo-notebooks/guided-demos/mnist_fashion.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@
from ray.train import ScalingConfig


def get_dataset():
return datasets.FashionMNIST(
root="/tmp/data",
train=True,
download=True,
transform=ToTensor(),
)


class NeuralNetwork(nn.Module):
def __init__(self):
super().__init__()
Expand Down Expand Up @@ -84,9 +75,6 @@ def train_func_distributed():
resources_per_worker={
"CPU": 1,
},
trainer_resources={
"CPU": 0,
},
),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"\n",
"NOTE: The default images used by the CodeFlare SDK for creating a RayCluster resource depend on the installed Python version:\n",
"\n",
"- For Python 3.11: 'quay.io/modh/ray:2.47.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.47.1-py312-cu128'\n",
"- For Python 3.11: 'quay.io/modh/ray:2.52.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.52.1-py312-cu128'\n",
"\n",
"If you prefer to use a custom Ray image that better suits your needs, you can specify it in the image field to override the default."
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"\n",
"NOTE: The default images used by the CodeFlare SDK for creating a RayCluster resource depend on the installed Python version:\n",
"\n",
"- For Python 3.11: 'quay.io/modh/ray:2.47.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.47.1-py312-cu128'\n",
"- For Python 3.11: 'quay.io/modh/ray:2.52.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.52.1-py312-cu128'\n",
"\n",
"If you prefer to use a custom Ray image that better suits your needs, you can specify it in the image field to override the default."
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"\n",
"NOTE: The default images used by the CodeFlare SDK for creating a RayCluster resource depend on the installed Python version:\n",
"\n",
"- For Python 3.11: 'quay.io/modh/ray:2.47.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.47.1-py312-cu128'\n",
"- For Python 3.11: 'quay.io/modh/ray:2.52.1-py311-cu121'\n",
"- For Python 3.12: 'quay.io/modh/ray:2.52.1-py312-cu128'\n",
"\n",
"If you prefer to use a custom Ray image that better suits your needs, you can specify it in the image field to override the default."
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ spec:
value: /home/ray/workspace/tls/server.key
- name: RAY_TLS_CA_CERT
value: /home/ray/workspace/tls/ca.crt
image: quay.io/modh/ray:2.47.1-py311-cu121
image: quay.io/modh/ray:2.52.1-py311-cu121
imagePullPolicy: Always
lifecycle:
preStop:
Expand All @@ -108,7 +108,7 @@ spec:
memory: 8G
nvidia.com/gpu: 0
imagePullSecrets: []
rayVersion: 2.47.1
rayVersion: 2.52.1
workerGroupSpecs:
- groupName: small-group-interactivetest
maxReplicas: 2
Expand Down Expand Up @@ -147,7 +147,7 @@ spec:
value: /home/ray/workspace/tls/server.key
- name: RAY_TLS_CA_CERT
value: /home/ray/workspace/tls/ca.crt
image: quay.io/modh/ray:2.47.1-py311-cu121
image: quay.io/modh/ray:2.52.1-py311-cu121
lifecycle:
preStop:
exec:
Expand Down
6 changes: 3 additions & 3 deletions demo-notebooks/guided-demos/notebook-ex-outputs/jobtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ spec:
value: /home/ray/workspace/tls/server.key
- name: RAY_TLS_CA_CERT
value: /home/ray/workspace/tls/ca.crt
image: quay.io/modh/ray:2.47.1-py311-cu121
image: quay.io/modh/ray:2.52.1-py311-cu121
imagePullPolicy: Always
lifecycle:
preStop:
Expand All @@ -97,7 +97,7 @@ spec:
memory: 8G
nvidia.com/gpu: 0
imagePullSecrets: []
rayVersion: 2.47.1
rayVersion: 2.52.1
workerGroupSpecs:
- groupName: small-group-jobtest
maxReplicas: 2
Expand Down Expand Up @@ -127,7 +127,7 @@ spec:
value: /home/ray/workspace/tls/server.key
- name: RAY_TLS_CA_CERT
value: /home/ray/workspace/tls/ca.crt
image: quay.io/modh/ray:2.47.1-py311-cu121
image: quay.io/modh/ray:2.52.1-py311-cu121
lifecycle:
preStop:
exec:
Expand Down
Loading