>> You're not going to want to miss this episode
of The AI show where we talk about
the new Azure Machine Learning CLI version
2 and SDK v2 with my friend Bala,
make sure you tune in.
[MUSIC].
>> Hello and welcome to this wonderful episode of the AI show.
We're going to talk about the new
Azure Machine Learning CLI version
2 and SDK version 2.
I've got my friend Bala. Bala,
want to tell us where you are and what you do?
>> Hey, Fred,
my name is Bala Venkatraman.
I am a PM in the Azure Machine Learning Team and we're currently
working on releasing the SDK and CLI for our customers.
>> We've had an SDK and a CLI since the dawn of humankind,
or at least the dawn of Azure machine
learning humankind. What's new?
>> I'm going to show you something,
what's new in the CLI and SDK v2.
Currently the new CLI we have supports a whole bigger range of
surface area across the Azure machine
learning and what's new with this
is with the new CLI you can
do Azure machine learning with a language of your choice.
You don't have to learn any new language.
We support Python,
we support R we support Java,
Julia or C# so no pressures,
no need to learn a new language and since we are doing
the CLI we do with command lines and
supports pretty much every operation in
Azure Machine Learning automation and
deployment becomes much more easier.
Now we have also
some new features which comes with CLI v2, which is,
our managed inferencing and reusable components for
our pipeline so that you don't have to keep
writing components again and again.
Now what do we get with the SDK v2?
We've got all this goodness in CLI v2,
we want to make sure that all this goodness is passed on to
the Python SDK v2 as well.
Python SDK v2 has all this consistency and
support which we have in CLI v2 but also we've
now improved the Python SDK so that
we have Python functions which help us to build
any workflow and this also helps us to
go from simple to complex tasks a lot more easily than before.
>> This is amazing, can you show us?
I'd love to see like some of the new things in there.
>> Of course, let's do some show and tell.
To start with, let's look at the command line.
Here is what is the az ml or the new CLI shows.
This shows us the list of commands,
what we could do with az ml --help.
Now let's look at one of the things here which is job.
Let's see what we could do with jobs so let me type
az ml job --help and it shows us that,
hey, this is what a job means and you can do archive,
cancel, create, download,
list, restore, shows, stream, update.
A bunch of stuff, Pretty simple.
Now we saw another thing,
let's look at another example.
az ml let's say model --help and there you go.
With model, it tells us what the model is and what can we do?
Archive, create, download,
list, restore, show, update.
If you can see, we can do pretty
much most of the same things across
all assets in a consistent way job or model or many other things.
That brings the consistency part into the CLI and it's easy you
don't have to keep learning new things over and over again for
every new asset you try to work with in Azure Machine Learning.
>> Bala, it's been really cool so far,
I love learning about the commands,
az ml and it's cool that you can look through it.
You get any other help with the command line stuff?
>> Yes, I use this cool tool called
Visual Studio Code while you can do YAML in anything.
I prefer using Visual Studio Code because it
has these awesome features like auto-compute and what not.
Let's say I want to use a compute,
I go here and I press "Control space" and it shows me, hey,
these are the bunch of stuff I have so I can use
this compute and I want an environment and I
can do a controlled space here and it gives me a bunch of
curated environments in my stuff and let's say,
I'm not playing nice with it I just used
input and it gives me a squiggly line saying it's
not okay so which means I actually mean
input so it allows me autocomplete
and it gives syntax corrections and
IntelliSense right here so I love the VS code for that.
>> Before we get to it, because I want to make
sure that there's clarity.
This YAML is stuff that you pass into
the command line that describes the job; is that right?
>> Yes, that is correct.
>> Well, let's go take a look at a job real quick.
>> Okay. Now, this command job,
I say that, hey,
I have some source files in this director's SRC.
I want to run this command,
which is python main.py and I want to pass one parameter,
which is a diabetic csv parameter and
the input for that parameter is this.
Now I've defined this input here,
which I'm saying is a file and it's available in this box.
I want to run it in this environment,
I want to run using this compute and display
name and experiment name, simple YAML file.
Now since I am in Visual Studio Code,
I can just click this button here,
which is the execute YAML
and it's going to just execute the YAML or I
could also just say az ml job
create --file and this job.yaml so both ways are okay.
The Visual Studio Code just
makes it easier by clicking this button.
Now I'm running this command for a python job.
I could run the similar command for odd as well.
So this is what that thing does.
Pretty much everything is the same codes
and source inputs are this,
our environment is this
the only thing which is different is, hey,
command unscript this file and this data.
Very simple, pretty much the same way of
running commands for both Python or
R. That brings us how easy the language
is and not just single jobs,
the next one is a pipeline.
I have multiple jobs here.
Say I have a prep job,
I have a transformed job and I have a train job and predict job.
All of them are defined in pretty much the same way.
Type, input, output, environment, compute,
and what is a command and I run them also using
the same way az ml job create this pipeline.yaml.
Now when I run these on the browser, after they run,
what happens is let's look at the diabetes example what
we run it completed with these inputs which
you saw I provided the YAML file with our example also run
the same way and the pipeline which
I told you had five steps run like this.
>> Interesting, this is cool because it allows you to
declaratively describe machine learning things and,
look, I have said this for many years.
ML apps isn't a product,
it's the union of people and process and
product and you're saying that here with the CLI,
you can probably put this into
a GitHub action or
whatever workflow thing that you want to do for your job.
>> Yes, absolutely.
>> That's cool. Tell us about the SDK.
Anything to show us there?
>> Yes. Now I have an SDK,
what I want to show are two things here.
First is how simple it is for the SDK,
the SDK I am creating a command which is
a command job which you saw in
this diabetes and let's look at the SDK now.
The SDK also constructs
the command in a very, very similar fashion.
It has a code, it has a command of the inputs,
environment, compute, display,
and then you run it saying that my ml,
client, creator or update job.
Very similar function,
you create a function and run it.
The good part is,
if I want to create a pipeline with multiple steps,
it is exactly the same way.
So in this example I have to commands,
one is a trained command, which,
like I showed you, I'm creating the same way.
A command and code and everything and then I have a coded command,
which also I do the same way.
Now, how do I build a pipeline?
I say, hey, I have this new DSL functionality
in Azure ML and I say this is my pipeline.
This is my two steps and the first step is the train command,
which I created with these inputs.
The second step is
the pretty command which I created with these inputs.
So anyone who is a lover of Python and loves
Python functions can see that this
is just a very simple way of doing it.
So I can have two Python functions and say this is my pipeline,
and then what do I do?
I just do it the same way.
Hey ml client jobs create this pipeline.
That's it, the SDK it's improved
in the sense that it's more Python
friendly and it is very consistent with the CLI.
It's easy for people to move across
the CLI and SDK depending on where you want to go.
>> Look, I may pretend that I haven't done some of this stuff,
but I've been using Azure Machine Learning for years and to me,
and this is the first time I've seen the new version of the SDK,
it's really cool that the way the SDK is organized almost looks
exactly like the YAML in
the sense that you could interchange them,
you could use the nouns or you could use the verbs from the SDK.
I guess a good question is when would
you suggest using one versus the other?
>> Let's look at that,
the SDK and YAML are both extremely good things in your arsenal.
The SDK is suitable when you are agnostic to languages.
You're not necessarily a lover of one language,
but you want to stick with your old language
but want to use Azure ML so
that that is a very great fit for a CLI scenario, I am sorry.
The CLI is suitable when you don't
want to stick to a particular language,
but you want to be able to use any one
of these languages like Python and R,
Java, Julia or C#.
The CLI is also really suitable for
production workflows where you just want to have
simple command lines and
have automation and deployment, it's very lightweight.
The Python SDK v2 is suitable obviously for all Python lovers,
it's good for development,
especially python lovers who want to
use it for development can use it.
They can build simple commands or
a chain of command using python like functions,
and it helps you to move from
smaller to bigger easily like I showed you just
build command after command and then hook them up together.
If you are a python lover and
want some of those really cool stuff,
what we've offered in terms of Pythonic way of doing things,
stick to Python SDK v2,
but if you are not necessarily hard code on
Python and want to do
a lot of automation and lightweight deployments,
CLI is the thing for you and you could also
move from SDK v2 for development and once
you have all your stuff since we are
very similar in how we construct stuff,
you can convert the SDK Python functions
into YAML file and use them in
production as well so that's an option too.
>> Really cool, I love all of it,
I love the choices that you have when you do this.
Thanks so much for spending some time with this Bala.
Question, where can people go to find out more?
>> The CLI is available in aka.ms/amlcliv2 and
for SDK you can go to aka.ms/amlsdkv2.
>> Fantastic, I'll put those links up again,
amlcliv2 and then sdkv2.
Thanks so much for spending some time with us,
my friend. It's been a pleasure.
>> Thanks for having me.
>> We've been learning all about
the new Azure Machine Learning CLI v2 and SDK v2 on the AI Show.
Thank you so much for watching and
hopefully we'll see you next time. Take care.
[MUSIC]