Skip to content

Commit a90e61f

Browse files
MichaelCliffordanishasthana
authored andcommitted
update sdk and demos to ray 2.5
1 parent ec6c787 commit a90e61f

15 files changed

+48
-56
lines changed

custom-nb-image/imagestream.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ metadata:
2121
annotations:
2222
opendatahub.io/notebook-image-name:
2323
"CodeFlare Notebook"
24-
opendatahub.io/notebook-image-desc: "Custom Jupyter notebook image with CodeFlare SDK, Python 3.8, Ray 2.1.0 and PyTorch 1.12.1"
24+
opendatahub.io/notebook-image-desc: "Custom Jupyter notebook image with CodeFlare SDK, Python 3.8, Ray 2.5.0 and PyTorch 1.12.1"
2525
spec:
2626
lookupPolicy:
2727
local: true

custom-nb-image/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ python-json-logger==2.0.4; python_version >= '3.5'
157157
pytz==2022.2.1
158158
pyyaml==6.0; python_version >= '3.6'
159159
pyzmq==24.0.1; python_version >= '3.6'
160-
ray[default]==2.1.0
160+
ray[default]==2.5.0
161161
requests-oauthlib==1.3.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
162162
requests==2.28.1; python_version >= '3.7' and python_version < '4'
163163
rsa==4.9; python_version >= '3.6'

demo-notebooks/batch-job/batch_mnist_ray.ipynb

+2-3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
" min_memory=16,\n",
6464
" max_memory=16,\n",
6565
" gpu=4,\n",
66+
" image=\"rayproject/ray:2.5.0-py38-cu116\",\n",
6667
" instascale=True, # Can be set to false if scaling not needed\n",
6768
" machine_types=[\"m5.xlarge\", \"g4dn.xlarge\"] # Can be removed if above is false\n",
6869
"))"
@@ -88,7 +89,6 @@
8889
]
8990
},
9091
{
91-
"attachments": {},
9292
"cell_type": "markdown",
9393
"id": "657ebdfb",
9494
"metadata": {},
@@ -222,7 +222,6 @@
222222
]
223223
},
224224
{
225-
"attachments": {},
226225
"cell_type": "markdown",
227226
"id": "b3a55fe4",
228227
"metadata": {},
@@ -5224,7 +5223,7 @@
52245223
],
52255224
"metadata": {
52265225
"kernelspec": {
5227-
"display_name": "sdktest",
5226+
"display_name": "Python 3 (ipykernel)",
52285227
"language": "python",
52295228
"name": "python3"
52305229
},

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"cells": [
33
{
4-
"attachments": {},
54
"cell_type": "markdown",
65
"id": "8d4a42f6",
76
"metadata": {},
@@ -65,6 +64,7 @@
6564
" max_cpus=1,\n",
6665
" min_memory=4,\n",
6766
" max_memory=4,\n",
67+
" image=\"rayproject/ray:2.5.0-py38-cu116\",\n",
6868
" gpu=0,\n",
6969
" instascale=False\n",
7070
"))"
@@ -90,7 +90,6 @@
9090
]
9191
},
9292
{
93-
"attachments": {},
9493
"cell_type": "markdown",
9594
"id": "657ebdfb",
9695
"metadata": {},
@@ -129,7 +128,6 @@
129128
]
130129
},
131130
{
132-
"attachments": {},
133131
"cell_type": "markdown",
134132
"id": "b3a55fe4",
135133
"metadata": {},
@@ -178,7 +176,7 @@
178176
],
179177
"metadata": {
180178
"kernelspec": {
181-
"display_name": "Python 3",
179+
"display_name": "Python 3 (ipykernel)",
182180
"language": "python",
183181
"name": "python3"
184182
},
@@ -192,7 +190,7 @@
192190
"name": "python",
193191
"nbconvert_exporter": "python",
194192
"pygments_lexer": "ipython3",
195-
"version": "3.9.13"
193+
"version": "3.8.13"
196194
},
197195
"vscode": {
198196
"interpreter": {

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

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"cells": [
33
{
4-
"attachments": {},
54
"cell_type": "markdown",
65
"id": "9865ee8c",
76
"metadata": {},
@@ -38,7 +37,6 @@
3837
]
3938
},
4039
{
41-
"attachments": {},
4240
"cell_type": "markdown",
4341
"id": "bc27f84c",
4442
"metadata": {},
@@ -64,13 +62,13 @@
6462
" min_memory=8,\n",
6563
" max_memory=8,\n",
6664
" gpu=1,\n",
65+
" image=\"rayproject/ray:2.5.0-py38-cu116\",\n",
6766
" instascale=True, # InstaScale now enabled, will scale OCP cluster to guarantee resource request\n",
6867
" machine_types=[\"m5.xlarge\", \"g4dn.xlarge\"] # Head, worker AWS machine types desired\n",
6968
"))"
7069
]
7170
},
7271
{
73-
"attachments": {},
7472
"cell_type": "markdown",
7573
"id": "12eef53c",
7674
"metadata": {},
@@ -91,7 +89,6 @@
9189
]
9290
},
9391
{
94-
"attachments": {},
9592
"cell_type": "markdown",
9693
"id": "6abfe904",
9794
"metadata": {},
@@ -130,7 +127,6 @@
130127
]
131128
},
132129
{
133-
"attachments": {},
134130
"cell_type": "markdown",
135131
"id": "c883caea",
136132
"metadata": {},
@@ -151,7 +147,7 @@
151147
],
152148
"metadata": {
153149
"kernelspec": {
154-
"display_name": "Python 3",
150+
"display_name": "Python 3 (ipykernel)",
155151
"language": "python",
156152
"name": "python3"
157153
},
@@ -165,7 +161,7 @@
165161
"name": "python",
166162
"nbconvert_exporter": "python",
167163
"pygments_lexer": "ipython3",
168-
"version": "3.9.13"
164+
"version": "3.8.13"
169165
},
170166
"vscode": {
171167
"interpreter": {

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

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"cells": [
33
{
4-
"attachments": {},
54
"cell_type": "markdown",
65
"id": "464af595",
76
"metadata": {},
@@ -38,7 +37,6 @@
3837
]
3938
},
4039
{
41-
"attachments": {},
4240
"cell_type": "markdown",
4341
"id": "bc27f84c",
4442
"metadata": {},
@@ -64,6 +62,7 @@
6462
" min_memory=4,\n",
6563
" max_memory=4,\n",
6664
" gpu=0,\n",
65+
" image=\"rayproject/ray:2.5.0-py38-cu116\",\n",
6766
" instascale=False\n",
6867
"))"
6968
]
@@ -91,7 +90,6 @@
9190
]
9291
},
9392
{
94-
"attachments": {},
9593
"cell_type": "markdown",
9694
"id": "33663f47",
9795
"metadata": {},
@@ -110,7 +108,6 @@
110108
]
111109
},
112110
{
113-
"attachments": {},
114111
"cell_type": "markdown",
115112
"id": "83d77b74",
116113
"metadata": {},
@@ -134,7 +131,6 @@
134131
]
135132
},
136133
{
137-
"attachments": {},
138134
"cell_type": "markdown",
139135
"id": "5b9ae53a",
140136
"metadata": {},
@@ -163,7 +159,6 @@
163159
]
164160
},
165161
{
166-
"attachments": {},
167162
"cell_type": "markdown",
168163
"id": "5af8cd32",
169164
"metadata": {},
@@ -182,7 +177,6 @@
182177
]
183178
},
184179
{
185-
"attachments": {},
186180
"cell_type": "markdown",
187181
"id": "31096641",
188182
"metadata": {},
@@ -211,7 +205,6 @@
211205
]
212206
},
213207
{
214-
"attachments": {},
215208
"cell_type": "markdown",
216209
"id": "0837e43b",
217210
"metadata": {},
@@ -240,7 +233,6 @@
240233
]
241234
},
242235
{
243-
"attachments": {},
244236
"cell_type": "markdown",
245237
"id": "aebf376a",
246238
"metadata": {},
@@ -271,7 +263,7 @@
271263
],
272264
"metadata": {
273265
"kernelspec": {
274-
"display_name": "Python 3",
266+
"display_name": "Python 3 (ipykernel)",
275267
"language": "python",
276268
"name": "python3"
277269
},
@@ -285,7 +277,7 @@
285277
"name": "python",
286278
"nbconvert_exporter": "python",
287279
"pygments_lexer": "ipython3",
288-
"version": "3.9.13"
280+
"version": "3.8.13"
289281
},
290282
"vscode": {
291283
"interpreter": {

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
" min_memory=8,\n",
6363
" max_memory=8,\n",
6464
" gpu=1,\n",
65+
" image=\"rayproject/ray:2.5.0-py38-cu116\",\n",
6566
" instascale=True,\n",
6667
" machine_types=[\"m5.xlarge\", \"g4dn.xlarge\"]\n",
6768
" \n",
@@ -275,7 +276,7 @@
275276
],
276277
"metadata": {
277278
"kernelspec": {
278-
"display_name": "Python 3",
279+
"display_name": "Python 3 (ipykernel)",
279280
"language": "python",
280281
"name": "python3"
281282
},
@@ -289,7 +290,7 @@
289290
"name": "python",
290291
"nbconvert_exporter": "python",
291292
"pygments_lexer": "ipython3",
292-
"version": "3.9.13"
293+
"version": "3.8.13"
293294
},
294295
"vscode": {
295296
"interpreter": {

demo-notebooks/guided-demos/4_gpt.ipynb

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
" min_memory=8,\n",
4646
" max_memory=8,\n",
4747
" gpu=1,\n",
48+
" image=\"rayproject/ray:2.5.0-py38-cu116\",\n",
4849
" instascale=True,\n",
4950
" machine_types=[\"m5.xlarge\", \"g4dn.xlarge\"],\n",
5051
"))"

demo-notebooks/interactive/hf_interactive.ipynb

+14-6
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,17 @@
8686
],
8787
"source": [
8888
"# Create our cluster and submit appwrapper\n",
89-
"cluster = Cluster(ClusterConfiguration(name='hfgputest', min_worker=1, max_worker=1, min_cpus=8, max_cpus=8, min_memory=16, max_memory=16, gpu=4, instascale=True, machine_types=[\"m5.xlarge\", \"p3.8xlarge\"]))"
89+
"cluster = Cluster(ClusterConfiguration(name='hfgputest', \n",
90+
" namspace=\"default,\"\n",
91+
" min_worker=1, \n",
92+
" max_worker=1, \n",
93+
" min_cpus=8, \n",
94+
" max_cpus=8, \n",
95+
" min_memory=16, \n",
96+
" max_memory=16, \n",
97+
" gpu=4,\n",
98+
" image=\"rayproject/ray:2.5.0-py38-cu116\",\n",
99+
" instascale=True, machine_types=[\"m5.xlarge\", \"p3.8xlarge\"]))"
90100
]
91101
},
92102
{
@@ -108,7 +118,6 @@
108118
]
109119
},
110120
{
111-
"attachments": {},
112121
"cell_type": "markdown",
113122
"id": "657ebdfb",
114123
"metadata": {},
@@ -189,7 +198,6 @@
189198
]
190199
},
191200
{
192-
"attachments": {},
193201
"cell_type": "markdown",
194202
"id": "477ac246",
195203
"metadata": {},
@@ -309,7 +317,7 @@
309317
"# establish connection to ray cluster\n",
310318
"\n",
311319
"#install additionall libraries that will be required for this training\n",
312-
"runtime_env = {\"pip\": [\"transformers\", \"datasets\", \"evaluate\"]}\n",
320+
"runtime_env = {\"pip\": [\"transformers\", \"datasets\", \"evaluate\", \"pyarrow<7.0.0\", \"accelerate\"]}\n",
313321
"\n",
314322
"ray.init(address=f'{ray_cluster_uri}', runtime_env=runtime_env)\n",
315323
"\n",
@@ -1443,7 +1451,7 @@
14431451
],
14441452
"metadata": {
14451453
"kernelspec": {
1446-
"display_name": "Python 3.9.7 64-bit",
1454+
"display_name": "Python 3 (ipykernel)",
14471455
"language": "python",
14481456
"name": "python3"
14491457
},
@@ -1457,7 +1465,7 @@
14571465
"name": "python",
14581466
"nbconvert_exporter": "python",
14591467
"pygments_lexer": "ipython3",
1460-
"version": "3.9.13"
1468+
"version": "3.8.13"
14611469
},
14621470
"vscode": {
14631471
"interpreter": {

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ keywords = ['codeflare', 'python', 'sdk', 'client', 'batch', 'scale']
2323
python = "^3.7"
2424
openshift-client = "1.0.18"
2525
rich = "^12.5"
26-
ray = {version = "2.1.0", extras = ["default"]}
27-
kubernetes = ">= 25.3.0, < 27"
26+
ray = {version = "2.5.0", extras = ["default"]}
27+
kubernetes = "25.3.0"
2828
codeflare-torchx = "0.6.0.dev0"
2929
cryptography = "40.0.2"
3030

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
openshift-client==1.0.18
22
rich==12.5.1
3-
ray[default]==2.1.0
3+
ray[default]==2.5.0
44
kubernetes>=25.3.0,<27
55
codeflare-torchx==0.6.0.dev0

src/codeflare_sdk/cluster/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ class ClusterConfiguration:
4747
template: str = f"{dir}/templates/base-template.yaml"
4848
instascale: bool = False
4949
envs: dict = field(default_factory=dict)
50-
image: str = "ghcr.io/foundation-model-stack/base:ray2.1.0-py38-gpu-pytorch1.12.0cu116-20221213-193103"
50+
image: str = "rayproject/ray:2.5.0-py38-cu116"
5151
local_interactive: bool = False
5252
image_pull_secrets: list = field(default_factory=list)

0 commit comments

Comments
 (0)