From 00e5b0d8b91c7347e7241255c1fa625efc25698e Mon Sep 17 00:00:00 2001 From: "albert.zah" Date: Fri, 19 Jan 2024 08:07:09 +0000 Subject: [PATCH 1/2] docs: improve the documentation framework. --- docs/doc-requirements.txt | 4 ++ docs/source/advanced_topic/architecture.md | 3 ++ docs/source/advanced_topic/index.rst | 15 +++++++ docs/source/advanced_topic/principle.md | 3 ++ docs/source/conf.py | 2 + docs/source/getting_started/index.rst | 15 +++++++ docs/source/getting_started/installation.md | 12 +++++ docs/source/getting_started/quick_start.md | 7 +++ docs/source/index.rst | 45 ++++++++++++++++--- .../tutorials/federated_learning_demo.ipynb | 18 ++++++++ docs/source/tutorials/index.rst | 13 ++++++ .../tutorials/split_learning_demo.ipynb | 18 ++++++++ .../transition_from_ray_to_rayfed.ipynb | 18 ++++++++ docs/source/usage.rst | 27 ----------- 14 files changed, 166 insertions(+), 34 deletions(-) create mode 100644 docs/source/advanced_topic/architecture.md create mode 100644 docs/source/advanced_topic/index.rst create mode 100644 docs/source/advanced_topic/principle.md create mode 100644 docs/source/getting_started/index.rst create mode 100644 docs/source/getting_started/installation.md create mode 100644 docs/source/getting_started/quick_start.md create mode 100644 docs/source/tutorials/federated_learning_demo.ipynb create mode 100644 docs/source/tutorials/index.rst create mode 100644 docs/source/tutorials/split_learning_demo.ipynb create mode 100644 docs/source/tutorials/transition_from_ray_to_rayfed.ipynb delete mode 100644 docs/source/usage.rst diff --git a/docs/doc-requirements.txt b/docs/doc-requirements.txt index 71dc8e93..588edf28 100644 --- a/docs/doc-requirements.txt +++ b/docs/doc-requirements.txt @@ -2,6 +2,10 @@ cloudpickle pickle5==0.0.11; python_version < '3.8' protobuf>=3.9.2,<3.20 +rayfed-nightly +myst-parser==0.18.1 +nbsphinx==0.8.9 +sphinx==5.3.0 # The following dependencies are required for doc-building only. jinja2<3.1.0 diff --git a/docs/source/advanced_topic/architecture.md b/docs/source/advanced_topic/architecture.md new file mode 100644 index 00000000..13dd75f1 --- /dev/null +++ b/docs/source/advanced_topic/architecture.md @@ -0,0 +1,3 @@ +# The architecture of RayFed + +TBD \ No newline at end of file diff --git a/docs/source/advanced_topic/index.rst b/docs/source/advanced_topic/index.rst new file mode 100644 index 00000000..7cf5e60c --- /dev/null +++ b/docs/source/advanced_topic/index.rst @@ -0,0 +1,15 @@ +.. _advanced_topic: + + +Advanced Topic +================= + +The architecture of RayFed is illustrated in the `architecture `_ . +For a deeper understanding of the principles behind RayFed, refer to the `principle `_ . + + +.. toctree:: + :maxdepth: 1 + + architecture + principle \ No newline at end of file diff --git a/docs/source/advanced_topic/principle.md b/docs/source/advanced_topic/principle.md new file mode 100644 index 00000000..59283bed --- /dev/null +++ b/docs/source/advanced_topic/principle.md @@ -0,0 +1,3 @@ +# The principle of RayFed + +TBD \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 219db02f..b0846eb9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -19,6 +19,8 @@ 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode', 'sphinx.ext.extlinks', + 'myst_parser', + 'nbsphinx', ] intersphinx_mapping = { diff --git a/docs/source/getting_started/index.rst b/docs/source/getting_started/index.rst new file mode 100644 index 00000000..8e8e59ae --- /dev/null +++ b/docs/source/getting_started/index.rst @@ -0,0 +1,15 @@ +.. _getting_started: + + +Getting Started +================= + +Please follow the `installation `_ to get RayFed ready. + +Then, we encourage you to check `quick_start `_ and :ref:`tutorials` to play with RayFed. + +.. toctree:: + :maxdepth: 1 + + installation + quick_start \ No newline at end of file diff --git a/docs/source/getting_started/installation.md b/docs/source/getting_started/installation.md new file mode 100644 index 00000000..195d8ad6 --- /dev/null +++ b/docs/source/getting_started/installation.md @@ -0,0 +1,12 @@ +# Installation + +Install it from pypi. + +```shell +pip install -U rayfed +``` + +Install the nightly released version from pypi. + +```shell +pip install -U rayfed-nightly diff --git a/docs/source/getting_started/quick_start.md b/docs/source/getting_started/quick_start.md new file mode 100644 index 00000000..5acfe8ef --- /dev/null +++ b/docs/source/getting_started/quick_start.md @@ -0,0 +1,7 @@ +# Quick Start + +TBD + +## More Examples + +Check out [tutorials](../tutorials/index.rst) to get more examples. \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index 59822d63..cdd82ed4 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,6 +1,16 @@ Welcome to RayFed documentation! =================================== +.. toctree:: + :maxdepth: 2 + :titlesonly: + :hidden: + + getting_started/index + tutorials/index + api + advanced_topic/index + **RayFed** is a multiple parties joint, distributed execution engine based on Ray, to help build your own federated learning frameworks **in minutes**. @@ -12,17 +22,38 @@ RayFed has the following highlight features: 3. Very Restricted and Clear Data Perimeters 4. Very Large Scale Federated Computing and Training -Check out the :doc:`usage` section for further information, including -how to :ref:`installation` the project. +Check out the :ref:`getting_started` section for further information, including +how to install the project. .. note:: This project is under active development. -Contents --------- +Why RayFed +============== +TBD -.. toctree:: +Getting Started +================= + +Please check :ref:`getting_started` for installation and a quick start guide. + + +Tutorials +============== +- :doc:`tutorials/federated_learning_demo` +- :doc:`tutorials/split_learning_demo` +- :doc:`tutorials/transition_from_ray_to_rayfed` + + +API +============== +Check out `api `_ to write your own RayFed programs. + + +Architecture and principle of RayFed +====================================== + +To gain a comprehensive understanding of RayFed's architecture and principles, +we highly recommend reading :ref:`advanced_topic` - usage - api diff --git a/docs/source/tutorials/federated_learning_demo.ipynb b/docs/source/tutorials/federated_learning_demo.ipynb new file mode 100644 index 00000000..069fc583 --- /dev/null +++ b/docs/source/tutorials/federated_learning_demo.ipynb @@ -0,0 +1,18 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Federated learning on RayFed" + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/source/tutorials/index.rst b/docs/source/tutorials/index.rst new file mode 100644 index 00000000..aa97271b --- /dev/null +++ b/docs/source/tutorials/index.rst @@ -0,0 +1,13 @@ +.. _tutorials: + +Tutorials +=============== + +We hope you enjoy these tutorials from RayFed developers. + +.. toctree:: + :maxdepth: 1 + + federated_learning_demo + split_learning_demo + transition_from_ray_to_rayfed \ No newline at end of file diff --git a/docs/source/tutorials/split_learning_demo.ipynb b/docs/source/tutorials/split_learning_demo.ipynb new file mode 100644 index 00000000..fe162930 --- /dev/null +++ b/docs/source/tutorials/split_learning_demo.ipynb @@ -0,0 +1,18 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Split learning on RayFed" + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/source/tutorials/transition_from_ray_to_rayfed.ipynb b/docs/source/tutorials/transition_from_ray_to_rayfed.ipynb new file mode 100644 index 00000000..e742330a --- /dev/null +++ b/docs/source/tutorials/transition_from_ray_to_rayfed.ipynb @@ -0,0 +1,18 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Seamless Federated, Transitioning from Ray to RayFed." + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/source/usage.rst b/docs/source/usage.rst deleted file mode 100644 index 95d8546f..00000000 --- a/docs/source/usage.rst +++ /dev/null @@ -1,27 +0,0 @@ -Usage -===== - -.. _installation: - -Installation ------------- - -To use RayFed, first install it using pip: - -.. code-block:: console - - (.venv) $ pip install -U rayfed - -Starting RayFed ---------------- - -To start a RayFed application, you can use :py:meth:`fed.init` function: - -For example: - ->>> import ray ->>> import fed ->>> ray.init() ->>> fed.init(addresses=addresses, party="Alice", tls_config=tls_config) - -Successfully to connect to current Ray cluster in party `Alice` From 89169988a431de7f825d434641a1930bc2956e47 Mon Sep 17 00:00:00 2001 From: "albert.zah" Date: Fri, 19 Jan 2024 08:22:45 +0000 Subject: [PATCH 2/2] Fix upper cases. --- docs/source/advanced_topic/architecture.md | 2 +- docs/source/advanced_topic/principle.md | 2 +- docs/source/tutorials/federated_learning_demo.ipynb | 2 +- docs/source/tutorials/split_learning_demo.ipynb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/advanced_topic/architecture.md b/docs/source/advanced_topic/architecture.md index 13dd75f1..306e027d 100644 --- a/docs/source/advanced_topic/architecture.md +++ b/docs/source/advanced_topic/architecture.md @@ -1,3 +1,3 @@ -# The architecture of RayFed +# The Architecture of RayFed TBD \ No newline at end of file diff --git a/docs/source/advanced_topic/principle.md b/docs/source/advanced_topic/principle.md index 59283bed..a3690e3d 100644 --- a/docs/source/advanced_topic/principle.md +++ b/docs/source/advanced_topic/principle.md @@ -1,3 +1,3 @@ -# The principle of RayFed +# The Principle of RayFed TBD \ No newline at end of file diff --git a/docs/source/tutorials/federated_learning_demo.ipynb b/docs/source/tutorials/federated_learning_demo.ipynb index 069fc583..6ead86e6 100644 --- a/docs/source/tutorials/federated_learning_demo.ipynb +++ b/docs/source/tutorials/federated_learning_demo.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Federated learning on RayFed" + "# Federated Learning on RayFed" ] } ], diff --git a/docs/source/tutorials/split_learning_demo.ipynb b/docs/source/tutorials/split_learning_demo.ipynb index fe162930..532154fa 100644 --- a/docs/source/tutorials/split_learning_demo.ipynb +++ b/docs/source/tutorials/split_learning_demo.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Split learning on RayFed" + "# Split Learning on RayFed" ] } ],