%3CLINGO-SUB%20id%3D%22lingo-sub-1737491%22%20slang%3D%22en-US%22%3EAzure%20Machine%20Learning's%20native%20support%20for%20MLflow%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1737491%22%20slang%3D%22en-US%22%3E%3CH2%20id%3D%22toc-hId--1241708253%22%20id%3D%22toc-hId--1241708253%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId-1245804580%22%20id%3D%22toc-hId-1245804580%22%3EAzure%20Machine%20Learning%20service%20expands%20support%20for%20MLflow%20(Public%20Preview)%3C%2FH2%3E%0A%3CH3%20id%3D%22toc-hId-1936366054%22%20id%3D%22toc-hId-1936366054%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId-128911591%22%20id%3D%22toc-hId-128911591%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--1678542872%22%20id%3D%22toc-hId--1678542872%22%3EBackground%3C%2FH3%3E%0A%3CP%3E%3CSPAN%3EMany%20data%20scientists%20start%20their%20machine%20learning%20projects%20using%20Jupyter%20notebooks%20or%20editors%20like%20Visual%20Studio%20Code.%20%3C%2FSPAN%3E%3CSPAN%3ETo%20ensure%20models%20can%20be%20used%20in%20production%2C%20it%20is%20essential%20to%20systematically%20track%20all%20aspects%20of%20an%20ML%20workflow%2C%20such%20as%20the%20data%2C%20environment%2C%20code%2C%20and%20models%20produced.%20%3C%2FSPAN%3EThese%20challenges%20with%20reproducibility%20can%20become%20complex%20when%20working%20in%20a%20hybrid%20cloud%20environment%20%E2%80%93%20but%20are%20mitigated%20if%20both%20environments%20conform%20to%20open%20standards.%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-808969961%22%20id%3D%22toc-hId-808969961%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--998484502%22%20id%3D%22toc-hId--998484502%22%3EAzureML%E2%80%99s%20support%20for%20MLflow%3C%2FH3%3E%0A%3CP%3E%3CSPAN%3EAzure%20ML%20now%20supports%20managing%20the%20end%20to%20end%20machine%20learning%20lifecycle%20using%20open%20%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fwww.mlflow.org%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMLflow%3C%2FA%3E%26nbsp%3B%3CSPAN%3Estandards%2C%20enabling%20existing%20workloads%20to%20seamlessly%20move%20from%20local%20execution%20to%20the%20intelligent%20cloud%20%26amp%3B%20edge.%3C%2FSPAN%3E%20%3CSPAN%3EAzure%20Machine%20Learning%20has%20expanded%20support%20for%20running%20machine%20learning%20workflows%20to%20train%2C%20register%20and%20deploy%20models%20via%20native%20integration%20(API%20compatibility)%20with%20MLflow.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ELet%E2%80%99s%20walk%20through%20some%20of%20the%20latest%20enhancements%20to%20the%20Azure%20ML%20and%20MLflow%20interoperability.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1489028331%22%20id%3D%22toc-hId-1489028331%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--318426132%22%20id%3D%22toc-hId--318426132%22%3E%3CSPAN%3EMLflow%20Projects%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.mlflow.org%2Fdocs%2Flatest%2Fprojects.html%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3EMLflow%20Projects%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%3E%26nbsp%3Bprovide%20a%20way%20to%20organize%20and%20describe%20your%20code%20to%20enable%20other%20data%20scientists%20or%20automated%20tools%20to%20run%20it.%20Any%20local%20directory%20or%20Git%20repository%20can%20be%20treated%20as%20an%20MLflow%20project.%20You%20can%20enable%20MLflow's%20tracking%20URI%20and%20logging%20API%2C%20collectively%20known%20as%20MLflow%20Tracking%2C%20to%20connect%20your%20MLflow%20experiments%20and%20Azure%20Machine%20Learning.%20You%20can%20submit%20your%20MLflow%20experiments%20locally%20or%20remotely%20using%20MLflow%20Projects%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3Bwith%20full%20tracking%20support%20in%20AzureML%20by%20setting%20the%20project%20backend%20to%20%E2%80%9Cazureml%E2%80%9D.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EA%20project%20includes%20the%20following%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3EConda%20environment%20specification%20(conda.yaml)%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EAny%20.py%20or%20.sh%20file%20in%20the%20project%20can%20be%20an%20entry%20point%2C%20with%20no%20parameters%20explicitly%20declared.%20When%20you%20run%20the%20command%20with%20a%20set%20of%20parameters%2C%20MLflow%20passes%20each%20parameter%20on%20the%20command%20line%20using%20--key%20%3CVALUE%3E%20syntax.%3C%2FVALUE%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EYou%20specify%20more%20options%20by%20adding%20an%20MLproject%20file%2C%20which%20is%20a%20text%20file%20in%20YAML%20syntax.%20An%20example%20MLproject%20file%20looks%20like%20this%3A%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-yaml%22%3E%3CCODE%3Ename%3A%20tutorial%0Aconda_env%3A%20conda.yaml%0Aentry_points%3A%0A%0A%20%20main%3A%0A%20%20%20%20parameters%3A%0A%20%20%20%20%20%20alpha%3A%20float%0A%20%20%20%20%20%20l1_ratio%3A%20%7Btype%3A%20float%2C%20default%3A%200.1%7D%0A%20%20%20%20command%3A%20%22python%20train.py%20%7Balpha%7D%20%7Bl1_ratio%7D%22%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EHere%E2%80%99s%20an%20example%20set%20up%20for%20a%20local%20run.%20I%E2%80%99ve%20set%20the%20backend%20to%20%3CSTRONG%3E%E2%80%9Cazureml%E2%80%9D%3C%2FSTRONG%3E%20to%20get%20all%20the%20tracking%20support%20and%20error%20logging%20from%20Azure%20ML.%20The%20backend%20config%20object%20is%20used%20to%20store%20necessary%20information%20such%20as%20the%20compute%20target%2C%20local%20managed%20environment%20or%20a%20system%20managed%20environment.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-python%22%3E%3CCODE%3Elocal_env_run%20%3D%20mlflow.projects.run(uri%3D%22.%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20parameters%3D%7B%22alpha%22%3A0.3%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20backend%20%3D%20%22azureml%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20use_conda%3DFalse%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20backend_config%20%3D%20%7B%22USE_CONDA%22%3A%20False%7D)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIn%20the%20image%20below%20you%20can%20see%20that%20Azure%20ML%20automatically%20tags%20the%20run%20with%20MLflow%20related%20metadata%20for%20visibility%20and%20logs%20the%20git%20info.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22shivpat_0-1601595922835.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223593i7B27AE121587D99F%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22shivpat_0-1601595922835.png%22%20alt%3D%22shivpat_0-1601595922835.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EYou%20can%20then%20log%20and%20visualize%20your%20run%20metrics%20in%20Azure%20Machine%20Learning%20Studio%20or%20the%20MLflow%20Experimentation%20UI.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22shivpat_1-1601595922840.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223595i5516EFD1FA6FCF4C%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22shivpat_1-1601595922840.png%22%20alt%3D%22shivpat_1-1601595922840.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20see%20the%20same%20metrics%20in%20the%20Azure%20ML%20studio%20and%20MLflow%20UI.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22shivpat_2-1601595922845.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223594iA1797F37FDF1E8A1%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22shivpat_2-1601595922845.png%22%20alt%3D%22shivpat_2-1601595922845.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--2125880595%22%20id%3D%22toc-hId--2125880595%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--333531241%22%20id%3D%22toc-hId--333531241%22%3E%3CSPAN%3EMLflow%20Model%20Registry%20and%20Deployment%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3EWith%20the%20new%20support%20for%20the%20MLflow%20model%20format%2C%20it%20becomes%20even%20easier%20to%20track%20and%20deploy%20models%20on%20Azure%20ML.%20You%20can%20register%20models%20from%20local%20files%20or%20a%20run%20and%20use%20it%20to%20make%20predictions%20online%20or%20in%20batch%20mode.%26nbsp%3B%3CSPAN%3EBy%20deploying%20models%20as%20a%20web%20service%2C%20you%20can%20apply%20the%20Azure%20Machine%20Learning%20monitoring%20and%20data%20drift%20detection%20functionalities%20to%20your%20production%20models.%20Let's%20look%20at%20an%20example%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFrom%20the%20MLflow%20project%20run%2C%20you%20can%20see%20the%20output%20model%20from%20the%20projects%20run%20is%20registered%20following%20the%20MLflow%20model%20schema.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22shivpat_3-1601595922850.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223596i7EA07E6251EE1537%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22shivpat_3-1601595922850.png%22%20alt%3D%22shivpat_3-1601595922850.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20MLmodel%20file%20contains%20all%20the%20model%20details%20and%20metadata.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22shivpat_4-1601595922854.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223597iF95C07990F608D88%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22shivpat_4-1601595922854.png%22%20alt%3D%22shivpat_4-1601595922854.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20to%20register%2C%20containerize%2C%20and%20deploy%20the%20model%2C%20you%20can%20now%20do%20that%20in%20one%20step.%20Using%20the%20%3CA%20href%3D%22http%3A%2F%2F%2520https%3A%2F%2Fmlflow.org%2Fdocs%2Flatest%2Fmodels.html%23deploy-a-python-function-model-on-microsoft-azure-ml%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Emlflow.azureml.deploy()%20Python%20SDK%20method%3C%2FA%3E%2C%20%26nbsp%3BAzureML%20will%20register%20the%20model%20in%20AzureML%2C%20build%20the%20docker%20container%20and%20deploy%20it%20to%20the%20chosen%20target.%20The%20deployed%20service%20will%20also%20retain%20the%20MLflow%20metadata%20as%20tags%20as%20show%20in%20the%20image%20below.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22shivpat_5-1601595922861.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223598iF1B342BC081A3A4D%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22shivpat_5-1601595922861.png%22%20alt%3D%22shivpat_5-1601595922861.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20the%20continuous%20support%20for%20MLflow%2C%20Azure%20ML%20is%20committed%20to%20being%20interoperable%20with%20Open%20source%20standards%20providing%20flexibility%20for%20users%20to%20work%20on-prem%20or%20on%20the%20cloud.%20To%20get%20more%20details%20about%20the%20Mlflow%20and%20Azure%20ML%20integration%20check%20out%20the%20following%20links%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmachine-learning%2Fhow-to-use-mlflow%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EHow%20to%20use%20MLflow%20with%20Azure%20Machine%20Learning%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FMachineLearningNotebooks%2Ftree%2Fmaster%2Fhow-to-use-azureml%2Ftrack-and-monitor-experiments%2Fusing-mlflow%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EMLflow%20and%20Azure%20Machine%20Learning%20notebook%20examples%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FMachineLearningNotebooks%2Ftree%2Fmaster%2Fhow-to-use-azureml%2Fml-frameworks%2Fusing-mlflow%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EFramework%20Specific%20notebooks%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1737491%22%20slang%3D%22en-US%22%3E%3CP%3EAzure%20Machine%20Learning%20has%20improved%20and%20expanded%20interoperability%20with%20MLflow.%20This%20native%20integration%20makes%20it%20easier%20to%20manage%20your%20machine%20learning%20workloads%20across%20various%20environments%20without%20losing%20artifact%20management%20and%20lineage.%26nbsp%3B%20Take%20a%20look%20at%20the%20latest%20feature%20support%20and%20examples%20to%20start%20using%20MLflow%20with%20Azure%20Machine%20Learning.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22shivpat_0-1601656061925.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F223701i5A1412FCC1532067%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22shivpat_0-1601656061925.png%22%20alt%3D%22shivpat_0-1601656061925.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1737491%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Machine%20Learning%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMachine%20Learning%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMlFlow%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

 

Azure Machine Learning service expands support for MLflow (Public Preview)

 

 

Background

Many data scientists start their machine learning projects using Jupyter notebooks or editors like Visual Studio Code. To ensure models can be used in production, it is essential to systematically track all aspects of an ML workflow, such as the data, environment, code, and models produced. These challenges with reproducibility can become complex when working in a hybrid cloud environment – but are mitigated if both environments conform to open standards.

 

AzureML’s support for MLflow

Azure ML now supports managing the end to end machine learning lifecycle using open MLflow standards, enabling existing workloads to seamlessly move from local execution to the intelligent cloud & edge. Azure Machine Learning has expanded support for running machine learning workflows to train, register and deploy models via native integration (API compatibility) with MLflow.

Let’s walk through some of the latest enhancements to the Azure ML and MLflow interoperability.

 

MLflow Projects

MLflow Projects provide a way to organize and describe your code to enable other data scientists or automated tools to run it. Any local directory or Git repository can be treated as an MLflow project. You can enable MLflow's tracking URI and logging API, collectively known as MLflow Tracking, to connect your MLflow experiments and Azure Machine Learning. You can submit your MLflow experiments locally or remotely using MLflow Projects with full tracking support in AzureML by setting the project backend to “azureml”.

 

A project includes the following:

  • Conda environment specification (conda.yaml)
  • Any .py or .sh file in the project can be an entry point, with no parameters explicitly declared. When you run the command with a set of parameters, MLflow passes each parameter on the command line using --key <value> syntax.
  • You specify more options by adding an MLproject file, which is a text file in YAML syntax. An example MLproject file looks like this:

 

 

 

 

name: tutorial
conda_env: conda.yaml
entry_points:

  main:
    parameters:
      alpha: float
      l1_ratio: {type: float, default: 0.1}
    command: "python train.py {alpha} {l1_ratio}"

 

 

 

 

Here’s an example set up for a local run. I’ve set the backend to “azureml” to get all the tracking support and error logging from Azure ML. The backend config object is used to store necessary information such as the compute target, local managed environment or a system managed environment. 

 

 

 

local_env_run = mlflow.projects.run(uri=".",
                                    parameters={"alpha":0.3},
                                    backend = "azureml",
                                    use_conda=False,
                                    backend_config = {"USE_CONDA": False})
                                    

 

 

 

In the image below you can see that Azure ML automatically tags the run with MLflow related metadata for visibility and logs the git info.

 

shivpat_0-1601595922835.png

 

 

You can then log and visualize your run metrics in Azure Machine Learning Studio or the MLflow Experimentation UI.

 

shivpat_1-1601595922840.png

 

 

You can see the same metrics in the Azure ML studio and MLflow UI. 

 

shivpat_2-1601595922845.png

 

MLflow Model Registry and Deployment

With the new support for the MLflow model format, it becomes even easier to track and deploy models on Azure ML. You can register models from local files or a run and use it to make predictions online or in batch mode. By deploying models as a web service, you can apply the Azure Machine Learning monitoring and data drift detection functionalities to your production models. Let's look at an example:

 

From the MLflow project run, you can see the output model from the projects run is registered following the MLflow model schema.

 

shivpat_3-1601595922850.png

 

 

The MLmodel file contains all the model details and metadata.

 

shivpat_4-1601595922854.png

 

 

If you want to register, containerize, and deploy the model, you can now do that in one step. Using the mlflow.azureml.deploy() Python SDK method,  AzureML will register the model in AzureML, build the docker container and deploy it to the chosen target. The deployed service will also retain the MLflow metadata as tags as show in the image below.

 

 

shivpat_5-1601595922861.png

 

 

With the continuous support for MLflow, Azure ML is committed to being interoperable with Open source standards providing flexibility for users to work on-prem or on the cloud. To get more details about the Mlflow and Azure ML integration check out the following links:

How to use MLflow with Azure Machine Learning 

MLflow and Azure Machine Learning notebook examples 

Framework Specific notebooks