2022-05-10 11:06:43 -07:00
.. _air:
2022-06-06 15:15:11 -07:00
Ray AI Runtime (AIR)
====================
2022-03-21 17:20:45 -07:00
Ray AI Runtime (AIR) is an open-source toolkit for building end-to-end ML applications. By leveraging Ray and its library ecosystem, it brings scalability and programmability to ML platforms.
2022-06-06 15:15:11 -07:00
.. tip ::
**Getting involved with Ray AIR.** Fill out `this short form <https://forms.gle/wCCdbaQDtgErYycT6> `__ to get involved. We'll be holding office hours, development sprints, and other activities as we get closer to the Ray AIR Beta/GA release. Join us!
2022-05-13 01:29:59 -07:00
.. image :: images/ai_runtime.jpg
2022-03-21 17:20:45 -07:00
The main focuses of the Ray AI Runtime:
* Ray AIR focuses on providing the compute layer for ML workloads.
* It is designed to interoperate with other systems for storage and metadata needs.
2022-06-06 15:15:11 -07:00
Ray AIR consists of 5 key components:
2022-03-21 17:20:45 -07:00
2022-06-06 15:15:11 -07:00
- Data processing (:ref: `Ray Data <datasets>` )
- Model Training (:ref: `Ray Train <train-docs>` )
- Reinforcement Learning (:ref: `Ray RLlib <rllib-index>` )
- Hyperparameter Tuning (:ref: `Ray Tune <tune-main>` )
- Model Serving (:ref: `Ray Serve <rayserve>` ).
2022-03-21 17:20:45 -07:00
Users can use these libraries interchangeably to scale different parts of standard ML workflows.
2022-06-06 15:15:11 -07:00
To get started, install Ray AIR via `` pip install -U "ray[air]" ``
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
Quick Start
-----------
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
.. tabbed :: XGBoost
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
Preprocess your data with a `` Preprocessor `` .
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
.. literalinclude :: doc_code/xgboost_starter.py
:language: python
:start-after: __air_xgb_preprocess_start__
:end-before: __air_xgb_preprocess_end__
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
Train a model with an `` XGBoostTrainer `` .
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
.. literalinclude :: doc_code/xgboost_starter.py
:language: python
:start-after: __air_xgb_train_start__
:end-before: __air_xgb_train_end__
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
Use the trained model for batch prediction with a `` BatchPredictor `` .
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
.. literalinclude :: doc_code/xgboost_starter.py
:language: python
:start-after: __air_xgb_batchpred_start__
:end-before: __air_xgb_batchpred_end__
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
.. tabbed :: Pytorch
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
Create your dataset.
2022-04-29 23:31:54 +02:00
2022-05-13 01:29:59 -07:00
.. literalinclude :: doc_code/pytorch_starter.py
:language: python
:start-after: __air_pytorch_preprocess_start__
:end-before: __air_pytorch_preprocess_end__
2022-04-12 00:11:42 +02:00
2022-05-13 01:29:59 -07:00
Train a model with a `` TorchTrainer `` .
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
.. literalinclude :: doc_code/pytorch_starter.py
:language: python
:start-after: __air_pytorch_train_start__
:end-before: __air_pytorch_train_end__
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
.. tabbed :: Tensorflow
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
Create your `` Ray Dataset `` .
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
.. literalinclude :: doc_code/tf_starter.py
:language: python
:start-after: __air_tf_preprocess_start__
:end-before: __air_tf_preprocess_end__
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
Train a model with a `` TensorflowTrainer `` .
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
.. literalinclude :: doc_code/tf_starter.py
:language: python
:start-after: __air_tf_train_start__
:end-before: __air_tf_train_end__
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
Use the trained model for batch prediction with a `` BatchPredictor `` .
2022-04-13 08:58:08 +01:00
2022-05-13 01:29:59 -07:00
.. literalinclude :: doc_code/tf_starter.py
:language: python
:start-after: __air_tf_batchpred_start__
:end-before: __air_tf_batchpred_end__
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
See the :ref: `Key Concepts <air-key-concepts>` for more that Ray AIR has to offer.
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
Why Ray AIR?
------------
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
There are so many machine learning frameworks, platforms, and tools nowadays. What makes Ray AIR different?
2022-04-12 00:11:42 +02:00
2022-05-13 01:29:59 -07:00
We believe Ray AIR provides unique value deriving from Ray.
2022-04-29 23:31:54 +02:00
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
.. dropdown :: Seamless development to production
:animate: fade-in-slide-down
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
Ray AIR reduces development friction going from development to production. Unlike in other frameworks, scaling Ray applications from a laptop to large clusters doesn't require a separate way of running -- the same code scales up seamlessly.
This means data scientists and ML practitioners spend less time fighting YAMLs and refactoring code. Smaller teams and companies that don’ t have the resources to invest heavily on MLOps can now deploy ML models at a much faster rate with Ray AIR.
2022-03-29 11:33:14 -07:00
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
.. dropdown :: Multi-cloud and Framework-interoperable
:animate: fade-in-slide-down
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
Ray AIR is multi-cloud and framework-interoperable. The Ray compute layer and libraries freely operate with Cloud platforms and frameworks in the ecosystem, reducing lock-in to any particular choices of ML tech.
Ex: why framework interoperability is unique to Ray--- it's easy to run Torch distributed or elastic Horovod within Ray, but not vice versa.
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
.. dropdown :: Future-proof via flexibility and scalability
:animate: fade-in-slide-down
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
Ray's scalability and flexibility makes Ray AIR future-proof. Advanced serving pipelines, elastic training, online learning, reinforcement learning applications are being built and scaled today on Ray. Common patterns are being incorporated into libraries like Ray Serve.
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
Next Steps
----------
2022-03-21 17:20:45 -07:00
2022-05-13 01:29:59 -07:00
- :ref: `air-key-concepts`
2022-06-03 21:53:44 +01:00
- `Examples <https://github.com/ray-project/ray/tree/master/python/ray/air/examples> `__
2022-05-13 01:29:59 -07:00
- :ref: `Deployment Guide <air-deployment>`
- :ref: `API reference <air-api-ref>`
2022-03-21 17:20:45 -07:00