Skip to content

Commit

Permalink
Remove references to Binder notebooks in Ray Tune tutorials (ray-proj…
Browse files Browse the repository at this point in the history
…ect#50621)

## Why are these changes needed?

* deletes the binder/ folder
* deletes all references to launching Binder notebooks
* unhides some important cells while hiding the output of others
* clarifies the pip requirements for Tune tutorials
* adds `.conda` to `.gitignore`

## Related issue number

N/A

## Checks

- [x] I've signed off every commit(by using the -s flag, i.e., `git
commit -s`) in this PR.
- [ ] I've run `scripts/format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [ ] I've added any new APIs to the API Reference. For example, if I
added a
method in Tune, I've added it in `doc/source/tune/api/` under the
           corresponding `.rst` file.
- [ ] I've made sure the tests are passing. Note that there might be a
few flaky tests, see the recent failures at https://flakey-tests.ray.io/
- Testing Strategy
   - [ ] Unit tests
   - [ ] Release tests
   - [ ] This PR is not tested :(

---------

Signed-off-by: Ricardo Decal <rdecal@anyscale.com>
Signed-off-by: 400Ping <43886578+400Ping@users.noreply.github.com>
  • Loading branch information
crypdick authored and 400Ping committed Feb 20, 2025
1 parent baa735b commit 2b1305f
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 70 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ java/**/pom.xml
# python virtual env
venv
.venv
.conda

# pyenv version file
.python-version
Expand Down
6 changes: 0 additions & 6 deletions binder/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions binder/requirements.txt

This file was deleted.

4 changes: 2 additions & 2 deletions doc/source/_templates/template.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"You can hide cells, so that they will toggle when you click on the cell header.\n",
"You can use different `:tags:` like `hide-cell`, `hide-input`, or `hide-output` to hide cell content,\n",
"and you can use `remove-cell`, `remove-input`, or `remove-output` to remove the cell completely when rendered.\n",
"Those cells will still show up in the notebook itself, e.g. when you launch it in binder."
"Those cells will still show up in the notebook itself."
]
},
{
Expand Down Expand Up @@ -151,4 +151,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
2 changes: 1 addition & 1 deletion doc/source/_templates/template.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ checkpoint_path = train_ppo_model()
You can hide cells, so that they will toggle when you click on the cell header.
You can use different `:tags:` like `hide-cell`, `hide-input`, or `hide-output` to hide cell content,
and you can use `remove-cell`, `remove-input`, or `remove-output` to remove the cell completely when rendered.
Those cells will still show up in the notebook itself, e.g. when you launch it in binder.
Those cells will still show up in the notebook itself.

```{code-cell} python3
:tags: [hide-cell]
Expand Down
3 changes: 1 addition & 2 deletions doc/source/ray-contribute/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ comes down to _two types_ of documents:
[key concepts](https://github.com/ray-project/ray/blob/master/doc/source/tune/key-concepts.rst) or
[API documentation](https://github.com/ray-project/ray/blob/master/doc/source/tune/api/api.rst).
- Notebooks, written in `.ipynb` format. All Tune examples are written as notebooks. These notebooks render in
the browser like `.md` or `.rst` files, but have the added benefit of adding launch buttons to the top of the
document, so that users can run the code themselves in either Binder or Google Colab.
the browser like `.md` or `.rst` files, but have the added benefit that users can easily run the code themselves.

## Fixing typos and improving explanations

Expand Down
4 changes: 1 addition & 3 deletions doc/source/tune/examples/ax_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@
"id": "59b1e0d1",
"metadata": {},
"source": [
"Click below to see all the imports we need for this example.\n",
"You can also launch directly into a Binder instance to run this notebook yourself.\n",
"Just click on the rocket symbol at the top of the navigation."
"Click below to see all the imports we need for this example."
]
},
{
Expand Down
37 changes: 8 additions & 29 deletions doc/source/tune/examples/bayesopt_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,19 @@
"\n",
"In this tutorial we introduce BayesOpt, while running a simple Ray Tune experiment. Tune’s Search Algorithms integrate with BayesOpt and, as a result, allow you to seamlessly scale up a BayesOpt optimization process - without sacrificing performance.\n",
"\n",
"BayesOpt is a constrained global optimization package utilizing Bayesian inference on gaussian processes, where the emphasis is on finding the maximum value of an unknown function in as few iterations as possible. BayesOpt's techniques are particularly suited for optimization of high cost functions, situations where the balance between exploration and exploitation is important. Therefore BayesOpt falls in the domain of \"derivative-free\" and \"black-box\" optimization. In this example we minimize a simple objective to briefly demonstrate the usage of BayesOpt with Ray Tune via `BayesOptSearch`, including conditional search spaces. It's useful to keep in mind that despite the emphasis on machine learning experiments, Ray Tune optimizes any implicit or explicit objective. Here we assume `bayesian-optimization==1.2.0` library is installed. To learn more, please refer to [BayesOpt website](https://github.com/fmfn/BayesianOptimization)."
"BayesOpt is a constrained global optimization package utilizing Bayesian inference on gaussian processes, where the emphasis is on finding the maximum value of an unknown function in as few iterations as possible. BayesOpt's techniques are particularly suited for optimization of high cost functions, situations where the balance between exploration and exploitation is important. Therefore BayesOpt falls in the domain of \"derivative-free\" and \"black-box\" optimization. In this example we minimize a simple objective to briefly demonstrate the usage of BayesOpt with Ray Tune via `BayesOptSearch`, including conditional search spaces. It's useful to keep in mind that despite the emphasis on machine learning experiments, Ray Tune optimizes any implicit or explicit objective. Here we assume `bayesian-optimization==1.2.0` library is installed. To learn more, please refer to [BayesOpt website](https://github.com/fmfn/BayesianOptimization).\n",
"\n",
"First, install the pre-requisites for this example."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "7ed16354",
"metadata": {
"tags": [
"remove-cell"
]
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: bayesian-optimization==1.2.0 in /Users/kai/.pyenv/versions/3.7.7/lib/python3.7/site-packages (1.2.0)\n",
"Requirement already satisfied: scikit-learn>=0.18.0 in /Users/kai/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from bayesian-optimization==1.2.0) (0.24.2)\n",
"Requirement already satisfied: numpy>=1.9.0 in /Users/kai/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from bayesian-optimization==1.2.0) (1.21.6)\n",
"Requirement already satisfied: scipy>=0.14.0 in /Users/kai/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from bayesian-optimization==1.2.0) (1.4.1)\n",
"Requirement already satisfied: joblib>=0.11 in /Users/kai/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from scikit-learn>=0.18.0->bayesian-optimization==1.2.0) (1.1.0)\n",
"Requirement already satisfied: threadpoolctl>=2.0.0 in /Users/kai/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from scikit-learn>=0.18.0->bayesian-optimization==1.2.0) (3.0.0)\n",
"\u001b[33mWARNING: There was an error checking the latest version of pip.\u001b[0m\u001b[33m\n",
"\u001b[0m"
]
}
],
"metadata": {},
"outputs": [],
"source": [
"# !pip install ray[tune]\n",
"!pip install bayesian-optimization==1.2.0"
"!pip install -q bayesian-optimization==1.2.0 \"ray[tune]\""
]
},
{
Expand All @@ -49,9 +31,7 @@
"id": "2236f834",
"metadata": {},
"source": [
"Click below to see all the imports we need for this example.\n",
"You can also launch directly into a Binder instance to run this notebook yourself.\n",
"Just click on the rocket symbol at the top of the navigation."
"Click below to see all the imports we need for this example."
]
},
{
Expand Down Expand Up @@ -186,8 +166,7 @@
},
"outputs": [],
"source": [
"# If 1000 samples take too long, you can reduce this number.\n",
"# We override this number here for our smoke tests.\n",
"# We reduce the num samples in this hidden cell for our smoke tests.\n",
"num_samples = 10"
]
},
Expand Down
6 changes: 2 additions & 4 deletions doc/source/tune/examples/bohb_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
}
],
"source": [
"# !pip install ray[tune]\n",
"!pip install ray[tune]\n",
"!pip install ConfigSpace==0.4.18\n",
"!pip install hpbandster==0.7.4"
]
Expand All @@ -89,9 +89,7 @@
"id": "96641e94",
"metadata": {},
"source": [
"Click below to see all the imports we need for this example.\n",
"You can also launch directly into a Binder instance to run this notebook yourself.\n",
"Just click on the rocket symbol at the top of the navigation."
"Click below to see all the imports we need for this example."
]
},
{
Expand Down
13 changes: 3 additions & 10 deletions doc/source/tune/examples/hyperopt_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"- [HyperOpt website](http://hyperopt.github.io/hyperopt)\n",
"\n",
"Necessary requirements:\n",
"- `pip install ray[tune]`\n",
"- `pip install hyperopt==0.2.5`"
"- `pip install ray[tune] hyperopt==0.2.5`"
]
},
{
Expand Down Expand Up @@ -76,9 +75,7 @@
"id": "b8e9e0cd",
"metadata": {},
"source": [
"Click below to see all the imports we need for this example.\n",
"You can also launch directly into a Binder instance to run this notebook yourself.\n",
"Just click on the rocket symbol at the top of the navigation."
"Click below to see all the imports we need for this example."
]
},
{
Expand Down Expand Up @@ -152,11 +149,7 @@
"cell_type": "code",
"execution_count": null,
"id": "33eddcb9",
"metadata": {
"tags": [
"remove-cell"
]
},
"metadata": {},
"outputs": [],
"source": [
"ray.init(configure_logging=False)"
Expand Down
9 changes: 5 additions & 4 deletions doc/source/tune/examples/nevergrad_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"\n",
"Nevergrad provides gradient/derivative-free optimization able to handle noise over the objective landscape, including evolutionary, bandit, and Bayesian optimization algorithms. Nevergrad internally supports search spaces which are continuous, discrete or a mixture of thereof. It also provides a library of functions on which to test the optimization algorithms and compare with other benchmarks.\n",
"\n",
"In this example we minimize a simple objective to briefly demonstrate the usage of Nevergrad with Ray Tune via `NevergradSearch`. It's useful to keep in mind that despite the emphasis on machine learning experiments, Ray Tune optimizes any implicit or explicit objective. Here we assume `nevergrad==0.4.3.post7` library is installed. To learn more, please refer to [Nevergrad website](https://github.com/facebookresearch/nevergrad)."
"In this example we minimize a simple objective to briefly demonstrate the usage of Nevergrad with Ray Tune via `NevergradSearch`. It's useful to keep in mind that despite the emphasis on machine learning experiments, Ray Tune optimizes any implicit or explicit objective. Here we assume `nevergrad==0.4.3.post7` library is installed. To learn more, please refer to [Nevergrad website](https://github.com/facebookresearch/nevergrad).\n",
"\n",
"Necessary requirements:\n",
"- `pip install ray[tune] nevergrad==0.4.3.post7`\n"
]
},
{
Expand Down Expand Up @@ -59,9 +62,7 @@
"id": "66cb8206",
"metadata": {},
"source": [
"Click below to see all the imports we need for this example.\n",
"You can also launch directly into a Binder instance to run this notebook yourself.\n",
"Just click on the rocket symbol at the top of the navigation."
"Click below to see all the imports we need for this example."
]
},
{
Expand Down
8 changes: 3 additions & 5 deletions doc/source/tune/examples/optuna_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@
"id": "467466a3",
"metadata": {},
"source": [
"Click below to see all the imports we need for this example.\n",
"You can also launch directly into a Binder instance to run this notebook yourself.\n",
"Just click on the rocket symbol at the top of the navigation."
"Click below to see all the imports we need for this example."
]
},
{
Expand Down Expand Up @@ -4124,7 +4122,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "ray",
"language": "python",
"name": "python3"
},
Expand All @@ -4138,7 +4136,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.10.16"
},
"orphan": true
},
Expand Down

0 comments on commit 2b1305f

Please sign in to comment.