Skip to content

update sdk and demos to ray 2.5 #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 10, 2023
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
2 changes: 1 addition & 1 deletion custom-nb-image/imagestream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ metadata:
annotations:
opendatahub.io/notebook-image-name:
"CodeFlare Notebook"
opendatahub.io/notebook-image-desc: "Custom Jupyter notebook image with CodeFlare SDK, Python 3.8, Ray 2.1.0 and PyTorch 1.12.1"
opendatahub.io/notebook-image-desc: "Custom Jupyter notebook image with CodeFlare SDK, Python 3.8, Ray 2.5.0 and PyTorch 1.12.1"
spec:
lookupPolicy:
local: true
Expand Down
2 changes: 1 addition & 1 deletion custom-nb-image/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ python-json-logger==2.0.4; python_version >= '3.5'
pytz==2022.2.1
pyyaml==6.0; python_version >= '3.6'
pyzmq==24.0.1; python_version >= '3.6'
ray[default]==2.1.0
ray[default]==2.5.0
requests-oauthlib==1.3.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
requests==2.28.1; python_version >= '3.7' and python_version < '4'
rsa==4.9; python_version >= '3.6'
Expand Down
5 changes: 2 additions & 3 deletions demo-notebooks/batch-job/batch_mnist_ray.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
" min_memory=16,\n",
" max_memory=16,\n",
" gpu=4,\n",
" image=\"quay.io/project-codeflare/ray:2.5.0-py38-cu116\",\n",
" instascale=True, # Can be set to false if scaling not needed\n",
" machine_types=[\"m5.xlarge\", \"g4dn.xlarge\"] # Can be removed if above is false\n",
"))"
Expand All @@ -88,7 +89,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "657ebdfb",
"metadata": {},
Expand Down Expand Up @@ -222,7 +222,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "b3a55fe4",
"metadata": {},
Expand Down Expand Up @@ -5224,7 +5223,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "sdktest",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
8 changes: 3 additions & 5 deletions demo-notebooks/guided-demos/0_basic_ray.ipynb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"id": "8d4a42f6",
"metadata": {},
Expand Down Expand Up @@ -65,6 +64,7 @@
" max_cpus=1,\n",
" min_memory=4,\n",
" max_memory=4,\n",
" image=\"quay.io/project-codeflare/ray:2.5.0-py38-cu116\",\n",
" gpu=0,\n",
" instascale=False\n",
"))"
Expand All @@ -90,7 +90,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "657ebdfb",
"metadata": {},
Expand Down Expand Up @@ -129,7 +128,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "b3a55fe4",
"metadata": {},
Expand Down Expand Up @@ -178,7 +176,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -192,7 +190,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.8.13"
},
"vscode": {
"interpreter": {
Expand Down
10 changes: 3 additions & 7 deletions demo-notebooks/guided-demos/1_basic_instascale.ipynb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"id": "9865ee8c",
"metadata": {},
Expand Down Expand Up @@ -38,7 +37,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "bc27f84c",
"metadata": {},
Expand All @@ -64,13 +62,13 @@
" min_memory=8,\n",
" max_memory=8,\n",
" gpu=1,\n",
" image=\"quay.io/project-codeflare/ray:2.5.0-py38-cu116\",\n",
" instascale=True, # InstaScale now enabled, will scale OCP cluster to guarantee resource request\n",
" machine_types=[\"m5.xlarge\", \"g4dn.xlarge\"] # Head, worker AWS machine types desired\n",
"))"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "12eef53c",
"metadata": {},
Expand All @@ -91,7 +89,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "6abfe904",
"metadata": {},
Expand Down Expand Up @@ -130,7 +127,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "c883caea",
"metadata": {},
Expand All @@ -151,7 +147,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -165,7 +161,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.8.13"
},
"vscode": {
"interpreter": {
Expand Down
14 changes: 3 additions & 11 deletions demo-notebooks/guided-demos/2_basic_jobs.ipynb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"id": "464af595",
"metadata": {},
Expand Down Expand Up @@ -38,7 +37,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "bc27f84c",
"metadata": {},
Expand All @@ -64,6 +62,7 @@
" min_memory=4,\n",
" max_memory=4,\n",
" gpu=0,\n",
" image=\"quay.io/project-codeflare/ray:2.5.0-py38-cu116\",\n",
" instascale=False\n",
"))"
]
Expand Down Expand Up @@ -91,7 +90,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "33663f47",
"metadata": {},
Expand All @@ -110,7 +108,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "83d77b74",
"metadata": {},
Expand All @@ -134,7 +131,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "5b9ae53a",
"metadata": {},
Expand Down Expand Up @@ -163,7 +159,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "5af8cd32",
"metadata": {},
Expand All @@ -182,7 +177,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "31096641",
"metadata": {},
Expand Down Expand Up @@ -211,7 +205,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "0837e43b",
"metadata": {},
Expand Down Expand Up @@ -240,7 +233,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "aebf376a",
"metadata": {},
Expand Down Expand Up @@ -271,7 +263,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -285,7 +277,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.8.13"
},
"vscode": {
"interpreter": {
Expand Down
5 changes: 3 additions & 2 deletions demo-notebooks/guided-demos/3_basic_interactive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
" min_memory=8,\n",
" max_memory=8,\n",
" gpu=1,\n",
" image=\"quay.io/project-codeflare/ray:2.5.0-py38-cu116\",\n",
" instascale=True,\n",
" machine_types=[\"m5.xlarge\", \"g4dn.xlarge\"]\n",
" \n",
Expand Down Expand Up @@ -275,7 +276,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -289,7 +290,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.8.13"
},
"vscode": {
"interpreter": {
Expand Down
1 change: 1 addition & 0 deletions demo-notebooks/guided-demos/4_gpt.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
" min_memory=8,\n",
" max_memory=8,\n",
" gpu=1,\n",
" image=\"quay.io/project-codeflare/ray:2.5.0-py38-cu116\",\n",
" instascale=True,\n",
" machine_types=[\"m5.xlarge\", \"g4dn.xlarge\"],\n",
"))"
Expand Down
20 changes: 14 additions & 6 deletions demo-notebooks/interactive/hf_interactive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,17 @@
],
"source": [
"# Create our cluster and submit appwrapper\n",
"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\"]))"
"cluster = Cluster(ClusterConfiguration(name='hfgputest', \n",
" namespace=\"default\",\n",
" min_worker=1, \n",
" max_worker=1, \n",
" min_cpus=8, \n",
" max_cpus=8, \n",
" min_memory=16, \n",
" max_memory=16, \n",
" gpu=4,\n",
" image=\"quay.io/project-codeflare/ray:2.5.0-py38-cu116\",\n",
" instascale=True, machine_types=[\"m5.xlarge\", \"p3.8xlarge\"]))"
]
},
{
Expand All @@ -108,7 +118,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "657ebdfb",
"metadata": {},
Expand Down Expand Up @@ -189,7 +198,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "477ac246",
"metadata": {},
Expand Down Expand Up @@ -309,7 +317,7 @@
"# establish connection to ray cluster\n",
"\n",
"#install additionall libraries that will be required for this training\n",
"runtime_env = {\"pip\": [\"transformers\", \"datasets\", \"evaluate\"]}\n",
"runtime_env = {\"pip\": [\"transformers\", \"datasets\", \"evaluate\", \"pyarrow<7.0.0\", \"accelerate\"]}\n",
"\n",
"ray.init(address=f'{ray_cluster_uri}', runtime_env=runtime_env)\n",
"\n",
Expand Down Expand Up @@ -1443,7 +1451,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.9.7 64-bit",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -1457,7 +1465,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.8.13"
},
"vscode": {
"interpreter": {
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ keywords = ['codeflare', 'python', 'sdk', 'client', 'batch', 'scale']
python = "^3.7"
openshift-client = "1.0.18"
rich = "^12.5"
ray = {version = "2.1.0", extras = ["default"]}
kubernetes = ">= 25.3.0, < 27"
ray = {version = "2.5.0", extras = ["default"]}
kubernetes = "25.3.0"
codeflare-torchx = "0.6.0.dev0"
cryptography = "40.0.2"

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
openshift-client==1.0.18
rich==12.5.1
ray[default]==2.1.0
ray[default]==2.5.0
kubernetes>=25.3.0,<27
codeflare-torchx==0.6.0.dev0
2 changes: 1 addition & 1 deletion src/codeflare_sdk/cluster/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ class ClusterConfiguration:
template: str = f"{dir}/templates/base-template.yaml"
instascale: bool = False
envs: dict = field(default_factory=dict)
image: str = "ghcr.io/foundation-model-stack/base:ray2.1.0-py38-gpu-pytorch1.12.0cu116-20221213-193103"
image: str = "quay.io/project-codeflare/ray:2.5.0-py38-cu116"
local_interactive: bool = False
image_pull_secrets: list = field(default_factory=list)
Loading