Package: ray-on-aml
Ray on Azure MLray-on-aml version 1.1.8 or lower supports Spark fromraydpwith Delta Lake, Synapse JDBC and latest pyspark 3.2.1. Checkoutspark examplesGPU & custom base image for interactive use: if you have GPU compute cluster, then either use ray_on_aml.getRay(gpu_support=True) which internally uses mcr.microsoft.com/azureml/openmpi4.1.0-cuda11.1-cudnn8-ubuntu18.04:20211221.v1 as base image. You can supply your own base image with ray_on_aml.getRay(base_image="YOUR_OWN_BASE_IMAGE")VSCode is now supported. You can run interactive notebook with VSCode.This package simplifies setup of core Ray and Ray's components such as Dask on Ray, Ray tune,Ray rrlib, Ray serve and Spark in Azure ML.
It also comes with supports for high performance data access to Azure data sources such as Azure Storage, Delta Lake , Synapse SQL.
It supports both interactive and job uses.ArchitectureSetup & Quick Start Guide1. Prepare Azure ML environmentFor interactive mode, setup a compute cluster and a compute instance in the same VNET.Checklist[ ] Azure Machine Learning Workspace[ ] Virtual network/Subnet[ ] Create Compute Instance in the Virtual Network[ ] Create Compute Cluster in the same Virtual Network2. Select kernelUse a python 3.7+ conda environment from(Jupyter) Notebookin Azure Machine Learning Studio.3. Install librarypipinstall--upgraderay-on-amlInstalling this library will also installray[tune]==1.12.0,  ray[serve]==1.12.0, pyarrow>= 5.0.0, dask[complete]==2021.12.0, adlfs==2021.10.0, fsspec==2021.10.1, xgboost_ray==0.1.8, fastparquet==0.7.24. Run ray-on-amlRun in interactive mode in a Compute Instance notebookfromray_on_aml.coreimportRay_On_AMLws=Workspace.from_config()ray_on_aml=Ray_On_AML(ws=ws,compute_cluster="Name_of_Compute_Cluster",maxnode=3)ray=ray_on_aml.getRay()# may take 7 mintues or longer.Check the AML run under ray_on_aml experiment for cluster status.Note that by default,the library sets up your current compute instance as Ray head and all nodes in the remote compute cluster as workers.
If you want to use  one of the nodes in the remote AML compute cluster as head node and the remaining are worker nodes, simply passci_is_head=Falsetoray_on_aml.getRay().
To install additional library, useadditional_pip_packagesandadditional_conda_packagesparameters.
The ray cluster will request 5 nodes from AML ifmaxnodeis not specified.ray_on_aml=Ray_On_AML(ws=ws,compute_cluster="Name_of_Compute_Cluster",additional_pip_packages=\['torch==1.10.0','torchvision','sklearn'])For use in an Azure ML job, include ray_on_aml as a pip dependency and inside your script, do this to get ray
Remember to use RunConfiguration(communicator='OpenMpi') in your AML job's ScriptRunConfig so that ray-on-aml can work correctly.fromray_on_aml.coreimportRay_On_AMLray_on_aml=Ray_On_AML()ray=ray_on_aml.getRay()ifray:#in the headnodepass#logic to use Ray for distributed ML training, tunning or distributed data transformation with Daskelse:print("in worker node")5. Ray DashboardThe easiest way to view Ray dashboard is using the connection fromVSCode for Azure ML.
Open VSCode to your Compute Instance then open a terminal, typehttp://127.0.0.1:8265/then ctrl+click to open the Ray Dashboard.This trick tells VScode to forward port to your local machine without having to setup ssh port forwarding using VScode's extension on the CI.6. Shutdown ray clusterTo shutdown cluster,  run following.ray_on_aml.shutdown()7. Customize Ray version and the library's base configurationsInteractive cluster: There are two arguments in Ray_On_AML() class initilization to specify base configuration for the library with following default values.Ray_On_AML(ws=ws,compute_cluster="Name_of_Compute_Cluster",base_conda_dep=['adlfs==2021.10.0','pip==21.3.1'],\base_pip_dep=['ray[tune]==1.12.0','ray[rllib]==1.12.0','ray[serve]==1.12.0','xgboost_ray==0.1.6','dask==2021.12.0',\'pyarrow >= 5.0.0','fsspec==2021.10.1','fastparquet==0.7.2','tabulate==0.8.9'])You can change ray and other libraries versions. Do this with extreme care as it may result in conflicts impacting intended features of the package.
If you change ray version here, you will need to manually re-install the ray library at the compute instance to match with the custom version of the cluster in case the compute instance is the head node.
AML Job cluster: If you need to customize your ray version, you can do so by adding ray dependency after ray-on-aml. The reason is ray-on-aml comes with some recent ray version. It needs to be overidden. For example if you need ray 0.8.7, you can do like following in your job's env.yml file-ray-on-aml==0.1.8-ray[rllib,tune,serve]==0.8.7Check outRLlib example with customized ray versionto learn more8. Quick start examplesCheck outquick start examplesto learn moreContributingThis project welcomes contributions and suggestions.  Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visithttps://cla.opensource.microsoft.com.When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.This project has adopted theMicrosoft Open Source Code of Conduct.
For more information see theCode of Conduct FAQor
contactopencode@microsoft.comwith any additional questions or comments.TrademarksThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
trademarks or logos is subject to and must followMicrosoft's Trademark & Brand Guidelines.
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.SecurityMicrosoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which includeMicrosoft,Azure,DotNet,AspNet,Xamarin, andour GitHub organizations.If you believe you have found a security vulnerability in any Microsoft-owned repository that meetsMicrosoft's definition of a security vulnerability, please report it to us as described below.Reporting Security IssuesPlease do not report security vulnerabilities through public GitHub issues.Instead, please report them to the Microsoft Security Response Center (MSRC) athttps://msrc.microsoft.com/create-report.If you prefer to submit without logging in, send email tosecure@microsoft.com.  If possible, encrypt your message with our PGP key; please download it from theMicrosoft Security Response Center PGP Key page.You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found atmicrosoft.com/msrc.Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)Full paths of source file(s) related to the manifestation of the issueThe location of the affected source code (tag/branch/commit or direct URL)Any special configuration required to reproduce the issueStep-by-step instructions to reproduce the issueProof-of-concept or exploit code (if possible)Impact of the issue, including how an attacker might exploit the issueThis information will help us triage your report more quickly.If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit ourMicrosoft Bug Bounty Programpage for more details about our active programs.Preferred LanguagesWe prefer all communications to be in English.PolicyMicrosoft follows the principle ofCoordinated Vulnerability Disclosure.