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

[Tune][Doc] Restructure API reference #32311

Merged
merged 27 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f72240c
Change directory from api_docs -> api
justinvyu Feb 8, 2023
4c54757
gitignore for autogenerated api refs
justinvyu Feb 8, 2023
d08c28f
Restructure + update trainable api refs
justinvyu Feb 8, 2023
a740de3
update tune execution
justinvyu Feb 8, 2023
0e37dfb
update search space + searchers
justinvyu Feb 8, 2023
994b554
Add TuneConfig to execution api ref section
justinvyu Feb 8, 2023
0a30fe5
Update schedulers
justinvyu Feb 8, 2023
d686153
update reporters, results, stoppers
justinvyu Feb 8, 2023
f8ea993
update syncing, logging, sklearn
justinvyu Feb 8, 2023
1d1e9a3
update integrations
justinvyu Feb 8, 2023
745654d
Update sync config ref
justinvyu Feb 8, 2023
82b88f6
Fix invalid link refs
justinvyu Feb 9, 2023
93503c8
Strip parent modules for integrations section
justinvyu Feb 9, 2023
223964f
Add noindex for session apis in tune
justinvyu Feb 9, 2023
d5fb516
Add callbacks api section
justinvyu Feb 9, 2023
4d6ee1d
Add some misc improvements
justinvyu Feb 9, 2023
7d095f9
Move placement group ref + split trainable utilities into categories
justinvyu Feb 9, 2023
4dabaf0
Don't have special case for doc/clusters gitignore
justinvyu Feb 9, 2023
930e2f2
Add some stuff to tune internals
justinvyu Feb 9, 2023
4892f93
Merge branch 'master' of https://github.com/ray-project/ray into tune…
justinvyu Feb 9, 2023
8c69afd
Fix result grid section title
justinvyu Feb 9, 2023
79c2cca
Set noindex on the air package ref for now
justinvyu Feb 9, 2023
eb3bf64
Fix optuna link
justinvyu Feb 9, 2023
032e7b4
Merge branch 'master' of https://github.com/ray-project/ray into tune…
justinvyu Feb 9, 2023
aaffb05
Replace tune-sample-docs ref with tune-search-spaces
justinvyu Feb 10, 2023
31ece63
Revert sklearn.rst change
justinvyu Feb 10, 2023
cfb0cf3
Merge branch 'master' of https://github.com/ray-project/ray into tune…
justinvyu Feb 10, 2023
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ scripts/nodes.txt
/doc/_build
/doc/source/_static/thumbs
/doc/source/tune/generated_guides/
/doc/source/*/api/doc/
/doc/source/cluster/running-applications/job-submission/doc/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be combined somehow? Special case for the newly added cluster autogenerated files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c21 should we conform to one structure? Though it does mess with backwards compatibility for this job submission page.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think we should conform to one structure (non-blocking for this PR). Let me take a look how easy the change is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was also a discussion about whether we should do reference/api or api/doc as the standard.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also looks like I can use /doc/source/**/doc as wildcard for nested dirs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked to @jjyao separately. We can use api/doc here. To rename to reference/api, we plan to have a separate discussion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just keep in mind that api leads to shorter URLs, too. but consistency is more important


# User-specific stuff:
.idea/**/workspace.xml
Expand Down
2 changes: 1 addition & 1 deletion doc/source/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ parts:
- file: tune/examples/exercises
title: "Exercises"
- file: tune/faq
- file: tune/api_docs/overview.rst
- file: tune/api/api.rst
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking, are you keeping Tune Internals and Tune Client API unchanged intentionally?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, for Tune Internals, I wasn't sure how to list out all members/methods with their docstrings if I used autosummary. And since that section is not really meant for external users to search for and use as API calls, I decided to leave it fully expanded.

For Tune Client, there was only 1 class, and I think it is fine as is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, though we should probably move Callback and PlacementGroupFactory out of Tune Internals.

I think it would make sense to move PlacementGroupFactory directly into the Trainable Utilities section, next to with_resources.

Callback is a bit strange... it's a public tune API, which exposes internals about the trials, and is used by air.RunConfig... we should probably revisit this down the line.

Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved Callback + PGF to better places.


- file: serve/index
title: Ray Serve
Expand Down
2 changes: 1 addition & 1 deletion doc/source/ray-references/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ API References
../ray-air/package-ref.rst
../data/api/api.rst
../train/api.rst
../tune/api_docs/overview.rst
../tune/api/api.rst
../serve/package-ref.rst
../rllib/package_ref/index.rst
../workflows/api/api.rst
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
43 changes: 43 additions & 0 deletions doc/source/tune/api/execution.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Tune Execution (Tuner)
======================

.. _tune-run-ref:

Tuner
-----

.. currentmodule:: ray.tune

.. autosummary::
:toctree: doc/

Tuner
Tuner.fit

Tuner Configuration
~~~~~~~~~~~~~~~~~~~

.. autosummary::
:toctree: doc/

TuneConfig

Restoring a Tuner
~~~~~~~~~~~~~~~~~

.. autosummary::
:toctree: doc/

Tuner.restore
Tuner.can_restore
Tuner.get_results
justinvyu marked this conversation as resolved.
Show resolved Hide resolved


tune.run_experiments
--------------------

.. autosummary::
:toctree: doc/

run_experiments
Experiment
105 changes: 105 additions & 0 deletions doc/source/tune/api/integration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
.. _tune-integration:

External library integrations for Ray Tune (tune.integration)
=============================================================

.. currentmodule:: ray

Comet (tune.integration.comet)
-------------------------------------------

:ref:`See here for an example. <tune-comet-ref>`

.. autosummary::
:toctree: doc/

air.integrations.comet.CometLoggerCallback
:noindex:

.. _tune-integration-keras:

Keras (tune.integration.keras)
------------------------------------------------------

.. autosummary::
:toctree: doc/

tune.integration.keras.TuneReportCallback
tune.integration.keras.TuneReportCheckpointCallback


.. _tune-integration-mlflow:

MLflow (tune.integration.mlflow)
--------------------------------

:ref:`See here for an example. <tune-mlflow-ref>`

.. autosummary::
:toctree: doc/

air.integrations.mlflow.MLflowLoggerCallback
:noindex:
air.integrations.mlflow.setup_mlflow


.. _tune-integration-mxnet:

MXNet (tune.integration.mxnet)
------------------------------

.. autosummary::
:toctree: doc/

tune.integration.mxnet.TuneReportCallback
tune.integration.mxnet.TuneCheckpointCallback


.. _tune-integration-pytorch-lightning:

PyTorch Lightning (tune.integration.pytorch_lightning)
------------------------------------------------------

.. autosummary::
:toctree: doc/

tune.integration.pytorch_lightning.TuneReportCallback
tune.integration.pytorch_lightning.TuneReportCheckpointCallback

.. _tune-integration-wandb:

Weights and Biases (tune.integration.wandb)
-------------------------------------------

:ref:`See here for an example. <tune-wandb-ref>`

.. autosummary::
:toctree: doc/

air.integrations.wandb.WandbLoggerCallback
:noindex:
air.integrations.wandb.setup_wandb


.. _tune-integration-xgboost:

XGBoost (tune.integration.xgboost)
----------------------------------

.. autosummary::
:toctree: doc/

tune.integration.xgboost.TuneReportCallback
tune.integration.xgboost.TuneReportCheckpointCallback


.. _tune-integration-lightgbm:

LightGBM (tune.integration.lightgbm)
------------------------------------

.. autosummary::
:toctree: doc/

tune.integration.lightgbm.TuneReportCallback
tune.integration.lightgbm.TuneReportCheckpointCallback
Original file line number Diff line number Diff line change
Expand Up @@ -31,40 +31,54 @@ relevant ones (like accuracy, loss, etc.).
.. image:: ../images/ray-tune-viskit.png


TBXLogger
---------
.. currentmodule:: ray

.. autoclass:: ray.tune.logger.TBXLoggerCallback
Tune Built-in Loggers
---------------------

JsonLogger
----------
.. autosummary::
:toctree: doc/

.. autoclass:: ray.tune.logger.JsonLoggerCallback
tune.logger.JsonLoggerCallback
tune.logger.CSVLoggerCallback
tune.logger.TBXLoggerCallback

CSVLogger
---------

.. autoclass:: ray.tune.logger.CSVLoggerCallback

MLFlowLogger
------------
MLFlow Integration: MLFlowLoggerCallback
----------------------------------------

Tune also provides a logger for `MLflow <https://mlflow.org>`_.
You can install MLflow via ``pip install mlflow``.
You can see the :doc:`tutorial here </tune/examples/tune-mlflow>`.

WandbLogger
-----------
.. autosummary::
:toctree: doc/

air.integrations.mlflow.MLflowLoggerCallback

Wandb Integration: WandbLoggerCallback
--------------------------------------

Tune also provides a logger for `Weights & Biases <https://www.wandb.ai/>`_.
You can install Wandb via ``pip install wandb``.
You can see the :doc:`tutorial here </tune/examples/tune-wandb>`
You can see the :doc:`tutorial here </tune/examples/tune-wandb>`.

.. autosummary::
:toctree: doc/

air.integrations.wandb.WandbLoggerCallback

.. _logger-interface:

LoggerCallback
--------------
LoggerCallback Interface
------------------------

.. autosummary::
:toctree: doc/

.. autoclass:: ray.tune.logger.LoggerCallback
:members: log_trial_start, log_trial_restore, log_trial_save, log_trial_result, log_trial_end
tune.logger.LoggerCallback
tune.logger.LoggerCallback.log_trial_start
tune.logger.LoggerCallback.log_trial_restore
tune.logger.LoggerCallback.log_trial_save
tune.logger.LoggerCallback.log_trial_result
tune.logger.LoggerCallback.log_trial_end
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,26 @@ The default reporting style can also be overridden more broadly by extending the
results = tuner.fit()


CLIReporter
-----------
.. currentmodule:: ray.tune

.. autoclass:: ray.tune.CLIReporter
:members: add_metric_column
Reporter Interface (tune.ProgressReporter)
------------------------------------------

JupyterNotebookReporter
-----------------------
.. autosummary::
:toctree: doc/

ProgressReporter
ProgressReporter.report
ProgressReporter.should_report

.. autoclass:: ray.tune.JupyterNotebookReporter
:members: add_metric_column

Tune Built-in Reporters
-----------------------

ProgressReporter
----------------
.. autosummary::
:toctree: doc/

.. autoclass:: ray.tune.ProgressReporter
:members:
CLIReporter
CLIReporter.add_metric_column
JupyterNotebookReporter
JupyterNotebookReporter.add_metric_column
40 changes: 40 additions & 0 deletions doc/source/tune/api/result_grid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.. _tune-analysis-docs:

.. _result-grid-docstring:

ResultGrid (tune.ResultGrid)
============================

.. currentmodule:: ray

.. autosummary::
:toctree: doc/

tune.ResultGrid
tune.ResultGrid.get_best_result
tune.ResultGrid.get_dataframe

.. _result-docstring:

Result (air.Result)
-------------------

.. autosummary::
:toctree: doc/

air.Result

.. _exp-analysis-docstring:

ExperimentAnalysis (tune.ExperimentAnalysis)
--------------------------------------------

.. note::

An experiment analysis is the output of the ``tune.run`` API.
It's now recommended to use ``Tuner.fit``, which outputs a ``ResultGrid`` object.

.. autosummary::
:toctree: doc/

tune.ExperimentAnalysis
Loading