Hello from Munich and welcome to 'This is My Architecture'.
Today I'm joined by Christian from BASF Digital Farming.
Hi, Christian.
Hey David, Thanks for having me.
Sure.
Christian, can you tell me about BASF Digital Farming?
Sure.
At BASF Digital Farming,
we develop soft and hardware solutions
for farmers to help feed the world more sustainably,
and improve farmers' bottom line.
Okay, great.
So what's the solution we're going to talk about today?
We are talking about a nifty little tool that we call XAMD,
for cross account model deployment,
that has been first developed for xarvio SCOUTING,
our image recognition app,
to help you identify diseases, weeds, and many more.
It has been downloaded by more than 6.5 million users
from over 100 countries.
Okay, that's quiet the scale.
Yes.
And when you say cross account model deployment, right,
we're talking about machine learning.
So you use machine learning
to build these applications for your customers.
So let's dive into the architecture
and talk first about how you build models.
So can you tell me about that process?
Yeah.
Our data scientists
use SageMaker
to create ML models.
These models are then basically done in automated pipelines
that then register a model
into SageMaker Model Registry.
Okay.
And from there, right,
your main challenge was, I assume, like productionizing these models, right?
And, we have here three different accounts,
which is a data science account, the QA account, the prod account,
So what were the challenges you faced there trying to productionize these?
Yeah, so, once we had a validated model, the question was,
how can we actually deploy such models
across the different accounts?
From a data science to a QA,
to a production account, for example, for scouting.
And we wanted to have a reliable mechanism
to do the cross account model deployment.
And that's where we ended up developing XAMD.
Okay, XAMD, which stands for cross account model deployment.
So can you go a little bit more into detail,
what exactly is XAMD and what does it do?
XAMD is a serverless application that is deployed by our admins.
It basically updates and provisions resources
so that you can transition a SageMaker model,
through different stages.
And it heavily relies on API Gateways,
that we call 'deployment APIs' then,
and Step Functions.
So once you invoke the deployment API,
the Step Function will then fetch the model artifacts
and deploy through the different accounts.
Okay, got it.
Okay, so workflow wise, right.
The data scientist registers the model in the model registry.
Then what happens next?
So data scientists come and go to the model registry.
They approve the models in the registry,
which then basically notifies our ML engineers
responsible for operationalization in all of our production models.
So these ML engineers then invoke the deployment API of XAMD.
Which then basically fetches
the model artifact from here,
and deploys it to the SageMaker endpoint in the QA account first.
Okay, awesome.
And XAMD basically takes care of that all in the background, right?
Yeah.
So in the QA account, I assume you do like additional testing
for load and accuracy, right?
Mm-Hmm, that's what we do.
So yeah, the user suspects of flow tests are performed.
Once these are done,
then the ML engineer
invokes XAMD again,
but now in the production account, which then fetches the model artifact
from the QA account,
and deploys it to the prod account.
All right, and from there, it's basically available to the clients
we have here on the bottom, right?
So how do they get access to the prediction that is served
in the production endpoint?
So there's a rest interface
between our SageMaker model endpoint
and the scouting production account.
So once a farmer takes a photo with our Scouting app,
this image is then posted against the SageMaker endpoint
and the prediction is created, that is fed back to the scouting middleware,
which is then also served to our customers.
Okay, great.
Yeah, I really like the way you productionized machine learning here
with using this cross model deployment framework.
I would like to ask,
do you want to share a few piece of information
around the journey or the evolution of how you got to where you are today?
So we came from a very manual and inefficient process
of deploying models through the different accounts.
And XAMD just gives us an ability
to increase the resilience and reliability of this process
through well-defined APIs.
Got it.
Yeah. thanks so much, Christian for sharing that.
Thanks for having me. Sure.
Well, thank you for watching 'This is My Architecture'.