Welcome to the AML examples!
- An Azure subscription. If you don't have an Azure subscription, create a free account before you begin.
- Familiarity with Python and Azure Machine Learning concepts.
- A terminal and Python >=3.6,<3.9.
Clone this repository and install required packages:
git clone https://github.com/Azure/azureml-examples
cd azureml-examples
pip install --upgrade -r requirements.txt
To create or setup a workspace with the assets used in these examples, run the setup script.
If you do not have an Azure ML Workspace, run
python setup.py --subscription-id $ID
, where$ID
is your Azure subscription id. A resource group, AML Workspace, and other necessary resources will be created in the subscription.If you have an Azure ML Workspace, install the Azure ML CLI and run
az ml folder attach -w $WS -g $RG
, where$WS
and$RG
are the workspace and resource group names.By default,
python setup.py
will not provision all the compute targets needed to run every example in this repository - it will only create standard AML compute targets with auto scaledown and reasonable settings. Some examples will fail with a "compute target not found" error. To create the AKS and specialty AML compute targets, runpython setup.py --create-aks True --create-V100 True
.Run
python setup.py -h
to see other optional arguments.
Tutorials
Jupyter Notebooks
path | description |
---|---|
notebooks/train-lightgbm-local.ipynb | use AML and mlflow to track interactive experimentation in the cloud |
Train
path | compute | environment | description |
---|---|---|---|
examples/train/deepspeed-cifar.py | AML - GPU | docker | train CIFAR-10 using DeepSpeed and PyTorch |
examples/train/fastai-mnist-mlproject.py | AML - CPU | mlproject | train fastai resnet18 model on mnist data via mlflow mlproject |
examples/train/fastai-mnist.py | AML - CPU | conda | train fastai resnet18 model on mnist data |
examples/train/fastai-pets.py | AML - GPU | docker | train fastai resnet34 model on pets data |
examples/train/lightgbm-iris.py | AML - CPU | pip | train a lightgbm model on iris data |
examples/train/pytorch-mnist-mlproject.py | AML - GPU | mlproject | train a pytorch CNN model on mnist data via mlflow mlproject |
examples/train/pytorch-mnist.py | AML - GPU | conda | train a pytorch CNN model on mnist data |
examples/train/sklearn-diabetes-mlproject.py | AML - CPU | mlproject | train sklearn ridge model on diabetes data via mlflow mlproject |
examples/train/sklearn-diabetes.py | AML - CPU | conda | train sklearn ridge model on diabetes data |
examples/train/tensorflow-iris.py | AML - CPU | conda | train tensorflow NN model on iris data |
examples/train/tensorflow-mnist-distributed-horovod.py | AML - GPU | conda | train tensorflow CNN model on mnist data distributed via horovod |
examples/train/tensorflow-mnist-distributed.py | AML - GPU | conda | train tensorflow CNN model on mnist data distributed via tensorflow |
examples/train/tensorflow-mnist.py | AML - GPU | conda | train tensorflow NN model on mnist data |
examples/train/xgboost-iris.py | AML - CPU | pip | train xgboost model on iris data |
Deploy
path | compute | description |
---|---|---|
examples/deploy/pytorch-mnist-aks-cpu.py | AKS - CPU | deploy pytorch CNN model trained on mnist data to AKS |
examples/deploy/sklearn-diabetes-aks-cpu.py | AKS - CPU | deploy sklearn ridge model trained on diabetes data to AKS |
We welcome contributions and suggestions! Please see the contributing guidelines for details.
This project has adopted the Microsoft Open Source Code of Conduct. Please see the code of conduct for details.