Skip to content
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

[ci] remove pins in runtime_env usage in train examples #49772

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,6 @@
"5. [Generate text from prompt](#gptj-predict)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Uncomment and run the following line in order to install all the necessary dependencies (this notebook was tested with `accelerate=0.18.0`, `transformers==4.26.0`, `deepspeed==0.12.3`):"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"! pip install \"datasets\" \"evaluate\" \"accelerate==0.18.0\" \"transformers==4.26.0\" \"torch>=1.12.0\" \"deepspeed==0.12.3\""
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down Expand Up @@ -83,36 +67,33 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We will use `ray.init()` to initialize a local cluster. By default, this cluster will be comprised of only the machine you are running this notebook on. You can also run this notebook on an Anyscale cluster.\n",
"Uncomment and run the following line in order to install all the necessary dependencies. Make sure that these packages are installed on every node in your cluster.\n",
"\n",
"We define a {ref}`runtime environment <runtime-environments>` to ensure that the Ray workers have access to all the necessary packages. You can omit the `runtime_env` argument if you have all of the packages already installed on each node in your cluster."
"One way to do this is to define a {ref}`runtime environment <runtime-environments>`. You can omit the `runtime_env` argument if you have all of the packages already installed on each node in your cluster (e.g. on the Docker image you are using)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# ! pip install \"datasets\" \"evaluate\" \"accelerate\" \"transformers\" \"torch\" \"deepspeed\"\n",
"\n",
"import ray\n",
"\n",
"ray.init(\n",
" runtime_env={\n",
" \"pip\": [\n",
" \"datasets\",\n",
" \"evaluate\",\n",
" # The latest combination accelerate==0.25.0, transformers==4.36.0, deepspeed==0.12.4\n",
" # has issues with DeepSpeed process group initialization,\n",
" # and will result in a batch_size validation problem.\n",
" # TODO(ml-team): get rid of the pins once the issue is fixed.\n",
" \"accelerate==0.18.0\",\n",
" \"transformers==4.26.0\",\n",
" \"torch>=1.12.0\",\n",
" \"deepspeed==0.12.3\",\n",
" ],\n",
" },\n",
" # Uncomment below if you need to install the dependencies on each node.\n",
" # runtime_env={\n",
" # \"pip\": [\n",
" # \"datasets\",\n",
" # \"evaluate\",\n",
" # \"accelerate\",\n",
" # \"transformers\",\n",
" # \"torch\",\n",
" # \"deepspeed\",\n",
" # ],\n",
" # },\n",
")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"We define a runtime environment to ensure that the Ray workers have access to all necessary packages. If you have already included these dependencies in your Docker image or installed them on each node, you can ignore the `runtime_env` argument.\n",
"\n",
"```{note}\n",
"Note that the codebases of `transformers`, `accelerate`, and `deepspeed` are all rapidly changing, so we have pinned the package versions here to ensure testing stability. You can try other version combinations and feel free to report any issues you encounter.\n",
"Note that the codebases of `transformers`, `accelerate`, and `deepspeed` are all rapidly changing, so you may need to try different version combinations and feel free to report any issues you encounter. See below for the versions we tested this example with.\n",
"```"
]
},
Expand All @@ -92,19 +92,29 @@
"MODEL_NAME = \"lmsys/vicuna-13b-v1.3\"\n",
"\n",
"ray.init(\n",
" runtime_env={\n",
" \"pip\": [\n",
" \"datasets==2.13.1\",\n",
" \"torch>=1.13.0\",\n",
" \"deepspeed==0.12.3\",\n",
" \"accelerate==0.20.3\",\n",
" \"transformers==4.30.2\",\n",
" \"lightning==2.0.3\",\n",
" ],\n",
" }\n",
" # Uncomment below if you need to install the dependencies on each node.\n",
" # runtime_env={\n",
" # \"pip\": [\n",
" # \"datasets\",\n",
" # \"torch\",\n",
" # \"deepspeed\",\n",
" # \"accelerate\",\n",
" # \"transformers\",\n",
" # \"lightning\",\n",
" # ],\n",
" # }\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip freeze | grep -E \"datasets|torch|deepspeed|accelerate|transformers|lightning\""
]
},
{
"attachments": {},
"cell_type": "markdown",
Expand Down