From 2bca5fd663c4ea8bcf66e8894a724baf8b09f02d Mon Sep 17 00:00:00 2001 From: He Kaisheng Date: Fri, 4 Sep 2020 00:07:33 +0800 Subject: [PATCH] Add documentation for Mars on Ray (#10468) * Add documentation for Mars on Ray * Update mars_on_ray.rst * refine according to comments Co-authored-by: hekaisheng Co-authored-by: Eric Liang --- doc/source/index.rst | 1 + doc/source/mars-on-ray.rst | 56 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 doc/source/mars-on-ray.rst diff --git a/doc/source/index.rst b/doc/source/index.rst index f0150f41d..20fdb8c85 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -211,6 +211,7 @@ Papers iter.rst pandas_on_ray.rst dask-on-ray.rst + mars-on-ray.rst .. toctree:: :hidden: diff --git a/doc/source/mars-on-ray.rst b/doc/source/mars-on-ray.rst new file mode 100644 index 000000000..ebb297df8 --- /dev/null +++ b/doc/source/mars-on-ray.rst @@ -0,0 +1,56 @@ +Mars on Ray +============ + +.. _`issue on GitHub`: https://github.com/mars-project/mars/issues + + +`Mars`_ Mars is a tensor-based unified framework for large-scale data computation which scales Numpy, Pandas and Scikit-learn. +Mars on Ray makes it easy to scale your programs with a Ray cluster. + +.. note:: + + This API is experimental in Mars. If you encounter any bugs, please file an `issue on GitHub`_. + + +.. _`Mars`: https://docs.pymars.org + + +Installation +------------- +You can simply install Mars via pip: + +.. code-block:: bash + + pip install pymars>=0.6.0a1 + + +Getting started +---------------- + +It's easy to run Mars jobs on a Ray cluster. Use ``from mars.session import new_session`` +and run ``new_session(backend='ray').as_default()``; this will create +a Mars session for Ray as the default session, and then all Mars tasks will be +submitted to Ray. Arguments will be passed to ``ray.init()`` when +creating a Mars session like this: +``new_session(backend='ray', address=
, num_cpus=)``. + + +.. code-block:: python + + from mars.session import new_session + ray_session = new_session(backend='ray').as_default() + + import mars.dataframe as md + import mars.tensor as mt + + t = mt.random.rand(100, 4, chunk_size=30) + df = md.DataFrame(t, columns=list('abcd')) + print(df.describe().execute()) + + +.. warning:: + + `Mars remote API`_ is not available for now. + + +.. _`Mars remote API`: https://docs.pymars.org/en/latest/getting_started/remote.html