Latest / Agentic Conversations (formally mlops.community) / MLOps.community #4 - Building an ML platform @SurveyMonkey with Shubhi Jain
Transcript
- 0:06Hey everybody, thanks for tuning in to another episode of our ml
- 0:10Ops Community. Meetups I wanted to let you know
- 0:13about a few things. Before we start off this
- 0:14episode, we have a slack community that you can join.
- 0:19You just need to go to ml Ops dot community, and you'll find
- 0:22the link to that there. We talked about everything and
- 0:26anything, ml Ops related. And the last thing is that we
- 0:30are going to be opening up office hours.
- 0:35This is a place where anyone can come in and talk about what
- 0:39they're doing around ml Ops and get help from the community if
- 0:43anyone needs it. So, jump in the slack, you'll
- 0:46see all the updates about our office hours.
- 0:58Alright, here we go with another episode of our ml Ops community.
- 1:04Podcast for this installment, we're joined by Shuba Jane a
- 1:09machine-learning engineer at Survey Monkey.
- 1:12And as you'll hear in the show, he was an integral part of the
- 1:17team that helped build out the machine learning platform at
- 1:21SurveyMonkey. And if you like the way that he
- 1:24breaks things down and explains all of these Concepts, I invite
- 1:29you to check out some of the content that he has on YouTube
- 1:33and I'll leave some links to To his videos in the show notes,
- 1:38just another thing. Before we get started, we had
- 1:41some great questions from the audience on this last meet up.
- 1:46And if you'd like to be in the live recording so that you can
- 1:51ask questions and hear it firsthand.
- 1:54I'll leave a link to where you can register for that in the
- 1:59show notes. We'd love to have you.
- 2:02The last thing is that if If you want to be a guest you feel like
- 2:08you got something to say or you know, someone that would be a
- 2:11great guest, please, reach out to us and we'll make something
- 2:16happen. Alright, without further Ado,
- 2:20here is shoe BJ. And thank you for joining us
- 2:26today. We've got a very special guest
- 2:31on. This is our fourth time, our
- 2:33fourth go around, and I think it just keeps getting better.
- 2:38We were joined by Shuba Jane and I want to give you a big thanks
- 2:42for coming and talking with us. We originally chatted I think it
- 2:48was at the end of last year and we talked about what you've been
- 2:52doing a survey monkey with the ml plan.
- 2:55Form there and how how you set things up and I'm so when we
- 3:00started this ml Ops Community, I thought it would be great to
- 3:04chat with you again and get your opinion on just ml Ops and ml
- 3:10Platforms in general. Because I knew you would have
- 3:13good information to share and knowledge to pass on to the
- 3:16community. So, let's go ahead and jump
- 3:21right into it. We kind of or I've been Starting
- 3:26from the beginning and asking people are guests, how they got
- 3:32into technology where that came from.
- 3:36So if you could just tell us who beat a few things about how you
- 3:41started in into tech and and where it's gone from there, it
- 3:46sounds great. Thanks so much to meet Russ for
- 3:47having me on here today. And yeah, it's a great question.
- 3:51Start us off. So, I grew up in the bay.
- 3:55They area. So super fortunate to be
- 3:57surrounded by Tech my family, like my parents lunch, my
- 4:02cousin's much, my friends kind of grew up in this in this area
- 4:06as well, where we started working in Tech very early on
- 4:10and, you know, you're really surrounded by it in the Bay
- 4:12Area. You see it.
- 4:13Everywhere you drive by down some highways, you take any you?
- 4:20You're talking to folks and Tech is everywhere.
- 4:23And so how I really got started. It on this journey for myself is
- 4:27and back in school I started attending some hackathons so you
- 4:32know it was a really great space for me to learn new
- 4:35technologies. Learn what this building culture
- 4:37is like what things you can really build using software and
- 4:42from there I didn't and I never really stopped.
- 4:46I went and studied computer science in college.
- 4:49Did my undergrad and my bachelor's at Caltech?
- 4:53Then from there I ended up joining Very small start-up
- 4:56working as an analytics engineer, where I did a lot of
- 4:59what you would call classical data, engineering stuff.
- 5:02But given that it was a start-up.
- 5:04And, you know, we were just 20 people, I did it up doing quite
- 5:07a bit of machine learning and machine learning infrastructure
- 5:10as well. From there, I, my current role
- 5:14where I work at SurveyMonkey as a machine-learning engineer, but
- 5:18along the way, I've done a bunch of passion projects inside
- 5:21projects, some Consulting work where I had the opportunity to
- 5:27help build out, various aspects of ml platforms or help build
- 5:32that. For variety of customers and
- 5:37clients both within the financial space as well as in
- 5:40the tech space. So kind of going and looking at
- 5:44various organizations that are different stages within their
- 5:47journey of tech as well as data science and machine learning, I
- 5:51think has been really eye-opening and I've had the
- 5:54opportunity to understand what really I can do to make to
- 6:00support that organization to do well for whatever they're really
- 6:03looking to do. At that time and it's been
- 6:07exciting and I'm really looking forward to seeing what comes
- 6:09next. No, this is a rapidly changing
- 6:11field. You learn some new things every
- 6:13single day, every single week. So it's been great completely
- 6:17along those lines. When you joined SurveyMonkey,
- 6:21had they already had something in place for an ml platform.
- 6:27Or was that starting from scratch?
- 6:29Where did that come from? That's a great question.
- 6:31So, I joined about three months after After we decided as a team
- 6:37that, oh, yeah, we need to have like a platform in place.
- 6:40So, at that time, what we had was essentially microservices
- 6:46for each use case. So, whenever we wanted to
- 6:50develop a new machine learning use case, Some data scientists
- 6:55or ml engineer would start developing a model.
- 6:57And once we were ready with that model, we went and said, okay,
- 7:01let's let's productionize it. Like if we need something real
- 7:04time, let's let's wrap it around in a, in a micro service.
- 7:08Let's talk Horizon and let's deploy it and SurveyMonkey.
- 7:11Given that we're pretty old software company.
- 7:13We've been around since 99. We have pretty standard
- 7:18processes for setting up. Microservices, that's not very
- 7:21hard, but Around April, of 2018 is when we realized, hey, you
- 7:27know, there are some unique requirements for our machine
- 7:31learning microservices that other teams don't really have to
- 7:34deal with and that's where we decided.
- 7:36Hey, we need to have a platform for this.
- 7:38We have some special requirements that allow us to
- 7:44look at this in a greater scope and realize there are a lot of
- 7:47different aspects like retraining models feedback
- 7:50pipelines where data is coming. From various things like that,
- 7:55that made us sit back and say, oh yeah, we need something else.
- 7:58Besides the process that we have set up right now.
- 8:01And so when you were looking at what you needed, how did you go
- 8:06through this build verse by process?
- 8:08Because I know a lot of companies are looking at.
- 8:11Should we get a third project party or should we jump on it
- 8:15and start to build it ourselves? Yeah, always the first question
- 8:18you want to ask. I think we also asked ourselves
- 8:21the same question too. And I think what really helped
- 8:25us figure out whether we should build or buy is we turn to our
- 8:31team? We say like, hey, you know, if
- 8:33we had the ideal platform where every problem that we're facing
- 8:36today and maybe for the foreseeable future has taken
- 8:39care of what would that look like?
- 8:40What would the requirements for that?
- 8:42Look like. And so, we had, I remember
- 8:45something like a Multi-day brainstorming session where
- 8:49we're all just sitting down and writing like, okay, in the ideal
- 8:52world. I break this down into we, we
- 8:56broke it down into three groups or three pillars and I actually
- 9:00realized that these three pillars aligns really closely.
- 9:03What with what Phil had talked about last week on this, I meet
- 9:07up as well which is we talked about the data side, then we
- 9:10talked about the services and the serving side and last we
- 9:14talked about the management side.
- 9:16Although those three pillars are not the exact same words that
- 9:21say fill, it shows. I think he is where data
- 9:23software and governance. I think they match up pretty
- 9:28closely though. And for each of those, we ended
- 9:31up defining. Okay?
- 9:32What are our requirements? You know, for data, we need some
- 9:35way for our data, scientists to easily find data within our
- 9:39organization. We need some way for us to
- 9:42reduce training serving, skew. We need real time live updates
- 9:46for a E-learning features then on the serving side, we needed
- 9:50ways to have feedback pipelines, be built out either real time
- 9:54or, you know, in a slower batch. Moving way we needed to record
- 9:58every single prediction that took place or inference across
- 10:01all of our models, as well as be able to handle that within our
- 10:05a/b testing and and experimental platform.
- 10:09And then on the management side, being able to manage all
- 10:12versions of new models that are coming out all model, And then
- 10:17all sorts of data that's coming through this.
- 10:19And so, as we started writing everything down, we said, okay,
- 10:23you know, there is not one platform that can do all of this
- 10:25for us and then it becomes a question.
- 10:31We stitching things well given the way that development moves
- 10:36in this kind of space how it's so rapid, you know, we might
- 10:39choose that we're going to go with this platform today for the
- 10:41data side but then tomorrow we might see, it's not compatible
- 10:44with our upgrades on the serving size Side or on the management
- 10:47side. And so, that's where we sat back
- 10:50and said, okay, I think it makes sense to build here.
- 10:53And we had the expertise in-house, which was really great
- 10:57for us to convert some of our general software Engineers into
- 11:01machine learning engineers and data scientists that could help
- 11:06us build this out from within. And, you know, we did some
- 11:09hiring of course, but I think largely, we did have great
- 11:13experience within the organization and And I'm
- 11:16wondering how big was the team that embarked on this journey,
- 11:22which big question? I think.
- 11:23So we have we had like four or five data scientists and 526
- 11:32machine learning engineers and just to be really specific the
- 11:36difference between these two groups of people are data
- 11:40scientists and our team are primarily responsible for
- 11:43developing machine learning models whereas machine Earning
- 11:46Engineers are primarily responsible for developing
- 11:49machine, learning services. So all the deployment side of
- 11:52things, sometimes they'll be some overlap because people have
- 11:55some expertise as well and just because as projects grow and
- 11:59expand that could be something there.
- 12:01But largely speaking, that's the breakdown.
- 12:06And actually since then we haven't grown too much, I want
- 12:11to say we probably added one more one or two more data
- 12:14scientists or one or two more machine learning engineers.
- 12:16But our output capacity has definitely grown to the point
- 12:20where, you know, we had a handful of ml use cases back in
- 12:242018 and that's exploded to the point where, you know, during
- 12:29the 30s and 40s where it would take us on the order of say, six
- 12:35to eight months to have one use case from inception or like
- 12:38ideation to out there and production.
- 12:41But now it's on the order of like Salem where we can get
- 12:44something out there and get the ball rolling.
- 12:46Which is really great. Yeah.
- 12:48So what you've what the work you put in paid off sounds like oh
- 12:53yeah yeah and there's definitely room for improvement, you know.
- 12:55It's an iterative process but we're really happy to see how
- 12:59we've been able to really accelerate or velocity when it
- 13:02comes to all these kinds of projects completely.
- 13:05So last question before we jump into the actual Frameworks and
- 13:10whatever, all of the infrastructure and how you're
- 13:12doing it as far as upkeep goes. Yeah.
- 13:17How, how does that play out and how is it?
- 13:21The machine learning Engineers that are doing that and how much
- 13:26of your time or the machine learning Engineers time is spent
- 13:30on just making sure everything runs properly.
- 13:33The yeah, I think that's definitely really important to
- 13:36know, especially for, like, teams that may not have like
- 13:38dedicated platform oriented teams or they don't want to be
- 13:42want to have folks that are dedicated necessarily to manage
- 13:45the platform. I want to say that in terms of
- 13:48upkeep, there's not a lot because we want our platform to
- 13:53work for us, you know, it's it's really the whole game is
- 13:57automate automate. Automate I think though that
- 14:01there is some time that's dedicated to adding new features
- 14:05or new capabilities to the platform, and that's really an
- 14:07iterative process. And, you know, each, we like to
- 14:10break apart our development Cycles into quarters and then
- 14:14Sprints, so, whatever. Our Early goals are like, okay,
- 14:17we're going to break this up into two weeks friends, but for
- 14:21each quarter, we generally have like a couple of goals like how
- 14:23are we going to increase the capabilities of our platform
- 14:26today? Does that mean that we're going
- 14:29to add in a completely new component?
- 14:31Does that mean just to just a new, some new upgrades here,
- 14:34there are small and so upkeep time can be relative based off
- 14:39of what our goals are for that quarter.
- 14:41And what we're looking to do, if we have in general, like, fewer
- 14:46machine, Earning use cases that are new to the organization or
- 14:49that we have made promises to say product managers or other
- 14:52product teams that are, you know, we have fewer of those,
- 14:55then we can maybe dedicate some more time to upgrades in our
- 14:58platform. And really we're always we're
- 15:01looking Less on the maintenance side and more on the improved
- 15:04capability side. So I think on maintenance, you
- 15:08know, I want to say it hovers between five to 10% of our
- 15:11engineers and data scientists time which is around the time
- 15:16that We roughly would spend on any service for that matter.
- 15:19Just, you know, if anything goes down, all right.
- 15:21Yeah, let's take a look. What's up with that or anything
- 15:24along those lines but generally we look to automate things.
- 15:28So now let's get into the Nitty Gritty.
- 15:31Yeah. Could you give us an overview of
- 15:34what you're working with and how it works?
- 15:37Definitely, I can definitely want to build an overview here.
- 15:42So, I like to break this apart into, you know, those three
- 15:48areas. You know, there's that data side
- 15:51that Services side and then the management side and under data
- 15:56side, what we've developed here. So just to give you a bit of
- 16:00background like back in 2018, will we would be doing is we had
- 16:05a data warehouse that was managed by By our data
- 16:07engineering team, you know, they would be in charge of developing
- 16:10the ETL that would do like a prod copy of all of our
- 16:15databases into our data warehouse and something that's
- 16:21unique about SurveyMonkey is that we're a hybrid platform.
- 16:24So some of our stuff is on premise and some of our stuff is
- 16:27in the cloud and we're actually in the midst of a transition of
- 16:31moving, everything to the cloud and putting that on.
- 16:34It'll be us for us. However, given, you know, we're
- 16:38pretty old company, we went with on premise, you know, many years
- 16:42ago, and we stuck by that for quite some time.
- 16:46And so all of our data that was used for machine learning model,
- 16:51training and development would sit in our data warehouses and
- 16:54our data scientists would call through these.
- 16:56Hundreds of tables, be really familiar with which data sits
- 17:01where what kind of quality checks they have to run what
- 17:03kind of validation in order for them to get.
- 17:06Raw training set and that would take a really long time, you
- 17:10know, sometimes in the order of months and then on the serving
- 17:13side, our data would be looking like okay.
- 17:17We know what tables this came from in training but sometimes
- 17:23we have already set up some services that serve us this
- 17:26table, the data from these tables already.
- 17:29So really, we should be using these service fees microservices
- 17:32because our engineering teams have worked hard for us to do.
- 17:36Deliver that sort of data in a nice clean format at certain
- 17:40latency is LA's and all those kinds of things.
- 17:44So we would go through a strenuous process of mapping,
- 17:47okay? You got so-and-so feature from
- 17:50this data warehouse table, so really this maps to this service
- 17:55and it's this feature but really got altered here somewhere.
- 17:58So we need to do some engineering on top of it.
- 18:01And then we have some really lengthy data validation process
- 18:05to make sure. Okay yeah.
- 18:06That's the Temperature, we're not, we're not having some
- 18:08training servings here that takes place and to do that for
- 18:11every single model for every single feature was a pain and we
- 18:15did it wrong so many times before we got it, right?
- 18:19So, we knew this wasn't the right way to go and our
- 18:22solution. To this was developing a machine
- 18:24learning feature store where we wanted to have, essentially, a
- 18:30One-Stop shop for all machine learning data.
- 18:33And we realized that we were essentially Starting to use
- 18:37cases here one is this kind of bulk training use case where you
- 18:41wanted data to be made available for all of our users, that use
- 18:45the Survey Monkey platform, but stolen an easy enough way that
- 18:51maps to the use case of our machine learning projects.
- 18:55So I gave a talk about actually, our machine learning feature
- 18:59store at O'Reilly strata data conference last month, and I can
- 19:06show you Good quick slide maybe so that it makes a bit more
- 19:09sense of yeah. Great.
- 19:11What what what this kind of looks like.
- 19:15That's something that I remember when we talked last you were
- 19:18telling me. Yeah, we're almost done with the
- 19:19feature store. Cool.
- 19:21So the way that we thought we took, we thought about this ml
- 19:23feature store was actually also do things like roast.
- 19:28We took a good hard. Look at our data patterns that
- 19:33existed within our organization and and we found a relationship
- 19:38that, you know, we had several one too many or one to one
- 19:42relationships that existed between our data and entities
- 19:46between them and then we, we also realized that our data
- 19:51scientists wanted point in time, window views into our data as
- 19:57well. So let me break down what that
- 19:59means. So if if I'm say like Airbnb I
- 20:03might be developing machine learning models, that are
- 20:06centered It around our guests or our hosts.
- 20:15Have Alders relevant feature data about them but then they
- 20:18might have some more in-depth data about, say, a guest can
- 20:22have many stays a host can have many homes.
- 20:25And these one-to-many relationships are then
- 20:27aggregated in view with respect to a certain entity.
- 20:31And so, at the end of the day, what data scientists really want
- 20:34is a super flat table, that contains all the information
- 20:38about that entity and all aggregated.
- 20:41Else other information about their sub entities or higher
- 20:44level entities and there at the end of the day, they also want
- 20:49this information with respect to certain time so how did you know
- 20:55that data? Looks like for a certain user on
- 20:58January 1st 2016 I should be able to know that so that I can
- 21:02develop say like a conversion model or churn model about this.
- 21:07And so we thought okay we really need to have a feature story.
- 21:11That serves this use case for our training purposes and
- 21:15ultimately, the structure that we were able to come up with
- 21:18that was super simple for our data, scientists to use and work
- 21:22with and easy for us to develop enough was creating a flat table
- 21:26for each entity where we have each entity ID broken down by
- 21:30each day. So each day's data and then all
- 21:33the features specific entity. I know this is like a really
- 21:37wide flat table, you know, it has hundreds of features and
- 21:41This made it super easy for data scientists to gets get up and
- 21:45running with any use case that they needed to work on.
- 21:49And so this machine learning feature store sits within we use
- 21:55AWS for all, for all the. So we leveraged EMR to do a lot
- 22:01of our data processing. We leverage AWS of theta, as our
- 22:06final tables, for entity tables, for our data scientists, to send
- 22:10a request to And it's backed by S3.
- 22:14So every, all the data is actually just sitting in that's
- 22:16three for us and it's it's really exciting to to see that
- 22:24work in in real life. And then, from there we had, so
- 22:31that's a really our batch use case, but then I talked about
- 22:33like are serving issues, right? So at the same time, we have a
- 22:38streaming architecture that reads off of our, uh,
- 22:41Application logs, from all of our services and creates a
- 22:45one-to-one mapping between the features that are in our feature
- 22:47story here and what spills off of our application logs.
- 22:52In real time, these values are then updated in a similar.
- 22:55Exact same structure feature store that can be read in, you
- 23:00know, at a single out of single layer, a single line.
- 23:05So, if I want to know, What is the data for a specific entity
- 23:10on a specific date? I hit my real-time feature store
- 23:13for that and my services hit that real-time feature store and
- 23:17the latency on that. As you know, just a few
- 23:19milliseconds. And so really, I'm able to get
- 23:23single line reads, super fast for my real-time feed restore,
- 23:27but I'm able to do my bulk reads against my trip.
- 23:30My bulk feature store as a data scientist, whenever I want again
- 23:35at a pretty fast speed. So I know that was a lot of
- 23:38information so I can maybe take a quick pause for you to ask
- 23:42some questions there, that was great.
- 23:45And I think this may be a good moment for us to open it up to
- 23:52everyone else that's in the in the chat right now.
- 23:56If anyone has a question that they want to ask juvie, feel
- 23:59free to unmute yourself and fire away.
- 24:03I have a question. Can you hear me?
- 24:06Yeah. Oh, hi.
- 24:15That today would have different
- 24:32considerations because they had so much.
- 24:35Of our platform that we might have decided to just buy.
- 24:54I agree with you but probably smaller aspects not like a huge
- 24:59data aspect or a huge serving aspect.
- 25:04Man out of the box and reason for that is even now you know,
- 25:09two years later. I we have the ability to look
- 25:12back and say, oh, you know, should we have done anything
- 25:14different and each time we do our retrospective and ask
- 25:18ourselves this question, what we end up realizing is, it doesn't
- 25:23end up being two things. It doesn't end up being super
- 25:26compatible with the rest of our, our, our architecture that we've
- 25:31developed it ends up being I'm like you buy, you need to buy
- 25:34into the whole thing and then you're limited by the
- 25:36capabilities of what you buy into, at least in the ml space.
- 25:41Since this is moving so quickly. What ends up, being released as
- 25:44a buy option takes some time. And then the second thing is,
- 25:49more of a Survey Monkey limitation is whenever we're
- 25:51working with anything. We often work with our
- 25:54infrastructure teams to make sure, okay, are we good from a
- 25:57security perspective? Are we good from any support or
- 26:01expertise perspective? Do we need to learn And anything
- 26:03substantially new from an infrastructure team.
- 26:06If anything were to go down because if anything were to go
- 26:09down where the first line of defense given were consumer
- 26:13platform. We have hundreds of thousands of
- 26:15people using our platform every day.
- 26:17It's very important for us. That things don't go down, you
- 26:20know, up time really matters, but the second line of defense
- 26:24is our infrastructure team, you know, they get paged next and if
- 26:28they don't have expertise, or they aren't able to learn the
- 26:30expertise to learn learn The tools effectively to be able to
- 26:34support us. That doesn't help us either
- 26:36because we don't have good backup in those scenarios.
- 26:38And so really, the first thing is realizing that we would be
- 26:42locked into certain things. And then the second thing is
- 26:44that more practical of we didn't have the ability to have a good
- 26:49support from like a devops perspective in terms of, like,
- 26:54if things were to go down or in terms of just uptime and such
- 26:57thank you. I'm seeing a few questions in
- 27:00the chat. One from d.c.
- 27:03Asking did you did you handle versioning bit temporarily.
- 27:09And if so, how did you express consistency requirements for end
- 27:14users? Yeah, great question DC.
- 27:18I so in terms of burgeoning so our ml Peter store, essentially
- 27:24we version by day and we realize that's not necessarily the most
- 27:29granular, versioning, that we that is possible technically We
- 27:33speaking, we can do it by every single change.
- 27:35That's taken place in a across for each user, you know, going
- 27:39back in time, but we really looked at what was really needed
- 27:44by our use cases and add a versioning, like versioning for
- 27:48every single day was more than good enough for our use cases
- 27:53and teams. We didn't have any issues with
- 27:56anything like that. So we're like, okay, you know,
- 27:58we know something greater is possible, but what do we really
- 28:01need? We can get away with Jay based
- 28:05versioning. And so we did and then in terms
- 28:07of when we need to version our training data for our machine
- 28:10learning models. So our machine learning models,
- 28:15they actually would have their own.
- 28:18They would read from our feature store to develop their training
- 28:21sets. And in each training set would
- 28:23be version based off of whatever data site would be version by
- 28:26time stamp based off of what the data scientist wants to use.
- 28:29So models are rarely developed by Saying like oh these are the
- 28:34features in the future store in. This is the date that I want
- 28:36things for and that's it. We actually do have a separate
- 28:39process of like. Okay.
- 28:40Yeah this was the exact data that was used to train version 3
- 28:45of this model and it's sitting here in S3.
- 28:48It's, you know, time locked. If we need to go retrain version
- 28:523 of the model because if some corruption the model artifacts
- 28:55we can actually go do that and we're pretty happy with how that
- 28:58works. And so that allows us to have
- 29:00that consistency. With our model artifacts and
- 29:06model versions themselves. Let me know.
- 29:09Do you see if that doesn't answer your question fully?
- 29:14Yeah I think that that's that's awesome.
- 29:18Yeah then we just have one more question in the chat of read it
- 29:23out loud for everyone that's just listening in.
- 29:26Does the feature store also store updated results of other
- 29:31ml models or just plain features from the dwh.
- 29:37Great question. So when we first started, it was
- 29:39just plain features because that was you know, our Phase 1.
- 29:42We just wanted to get things, get the ball rolling.
- 29:44Now it does have updated results of other ml models and that's
- 29:49really useful because as we know the inputs of some models are
- 29:53the outputs of other models. And so all of our use cases
- 30:01really function. And the way this really works is
- 30:05we have this gets into more of the feedback pipeline side of
- 30:08things, we have feedback pipelines that are set up to Put
- 30:13results of models into others basis within our data warehouse
- 30:18or, you know, spit out things into our log stream that we can
- 30:23then put directly into our data warehouse.
- 30:26And then it gets right into our MLP twist or so different ways
- 30:30of making that happen. And the reason for both of these
- 30:32things is, sometimes we need real-time feedback and sometimes
- 30:36we're okay with slower-moving feedback where the actual true
- 30:40results or True Values. Of inferences of Mo models.
- 30:44We end up getting that to, those True Values.
- 30:46Same days later. Like, does it user convert?
- 30:49Well, we might end up finding that answer, say 30 days later,
- 30:52but is it user? A Spam user 0.
- 30:55We can actually find that out like, super fast.
- 30:58So, based off of when we can find out, the True Values of
- 31:01things, that's when values are updated and made available that,
- 31:05then our ml teacher store, Cool, very cool.
- 31:09And since you're giving us a few use cases, can you go into a bit
- 31:13more depth on other use cases that you've you've had and sure
- 31:19should we talk maybe more on just to like get to keep the
- 31:23ball rolling, let's talk more about use cases and then maybe
- 31:26the lady to the serving side of things.
- 31:28Yeah, yeah, so we developed essentially a machine learning
- 31:37This is Gateway that acts as our.
- 31:41One place for all machine learning services.
- 31:43So essentially you want to call any mo model you hit our machine
- 31:47learning service Gateway. We let us know which model
- 31:49you're looking to hit and if there's any A/B Testing, you're
- 31:52looking to do specific to model versions and such, you can pass
- 31:56that in and then we pass him. The the data needed for that
- 32:01model to make make an inference. And what we want to do is make
- 32:06it super easy for our partner services to integrate with us.
- 32:10So When I say passing the data needed to make an inference, I
- 32:14don't mean all of the raw features that are needed to make
- 32:17a model and friends. I might mean do they just give
- 32:20us the user ID or the survey ID? And then from there we know for
- 32:25each model what features are needed.
- 32:27We go, hit our real-time feature store get those features and
- 32:31then we have essentially model project pods which are just
- 32:38clusters of know. Roads that are all running the
- 32:43same Docker image or various different versions of Docker
- 32:47images. If we're doing proper versioning
- 32:48and a/b testing, and then they, they have received all the Grab
- 32:59that in be we go hit those nodes, get her in friends, back
- 33:03and then return the result to our to our whoever cult has
- 33:07called our service. So just repeat that last part.
- 33:10I think you may have broken up a little bit.
- 33:12Oh, sure thing. So basically, we have like a
- 33:15high level Gateway. We receive all requests.
- 33:18We go. Hit a real-time feature store
- 33:19and grab our features. Then based off of, whatever the
- 33:23API primer inputs are, which model we're looking to hit and
- 33:26which version we go ahead. We have a we have an nginx
- 33:30routing layer in between that helps us route face up to these
- 33:33programs, which nodes we should be hitting to get to make our
- 33:37inference. We go make our inference, and it
- 33:39travels back up our path to then we return our results to our
- 33:43users. And so there's essentially a
- 33:45load balancer that sits right at our Gateway layer and then we
- 33:49have a router that sits at right below or gateway to route which
- 33:53nodes we should be hitting to make our inference and we're
- 33:58able To do this. Now, both synchronously and
- 34:01asynchronously because some of our models are super heavy and
- 34:05say they might take on the order of seconds but our Our partners
- 34:15want to be able to receive a results or at least know that
- 34:19they made the right call, it made the right request pretty
- 34:22quickly. And so, what ends up taking
- 34:25place? There is a synchronous evil
- 34:27return. Like, hey, you know, we got your
- 34:28request, here's your ID Pingas, whenever you need us to display
- 34:32results of the user and then we can go ahead and do that.
- 34:35And so were able to overcome our her.
- 34:39And the reason why we did this as we need, we had some hurdles
- 34:42on the infrastructure. Aside, we couldn't support some
- 34:46models that needed gpus to run very quickly and this is mainly
- 34:51due to like Sarah infrastructure.
- 34:57To eat some meat. Like, we couldn't get those GPU
- 34:59enabled, clusters or nodes. And so, as a result, we're
- 35:03running some things on CPUs there, bit slower.
- 35:05But we're able to still meet our requirements for delivering
- 35:09really quick results to our to our users and a use case that
- 35:15kind of demonstrates synchronous versus asynchronous.
- 35:18Is we have a machine learning model feature called
- 35:24surveillance a genius. So this is a feature that's its
- 35:29when your sits on the create side of our Survey Monkey
- 35:32platform. So when you're creating a
- 35:33survey, you know, Oh, good. We, when we're creating a survey
- 35:44on our platform, we want to help our users create optimal
- 35:47surveys. So we provide them with an
- 35:50estimated completion rate, estimated, completion, time, and
- 35:53some recommendations for how they can better their survey so
- 35:57that it's more likely to be completed.
- 35:58And so these are backed by a couple of different machine
- 36:00learning models, but we want the results appear real time as the
- 36:05user is creating their survey. So that they can make the
- 36:08changes to their survey almost immediately.
- 36:11And so this is the case that's asynchronous in Prince
- 36:15architecture since synchronous inference call.
- 36:18But then there's a use case of asynchronous and Friends.
- 36:20Call say, when we're doing some heavy analysis, Upon Our surveys
- 36:25and want to return some outputs on say the sentiments of every
- 36:29response forever, for the survey that you're looking at, you
- 36:33know, you can get millions of responses on your survey getting
- 36:36the sentiment. For everything can be really
- 36:38quite a while so in those cases where like okay, yeah, let's use
- 36:42our asynchronous architecture. It'll take us a couple of
- 36:44minutes for us to get you, you know, the overall distribution
- 36:48of sentiments and such like, such things like that.
- 36:51And so let's use our asynchronous architecture and
- 36:55you know, our users are okay with that and we've been able to
- 37:00see if they deliver on that for them as well in an efficient
- 37:03manner, without bogging down or our infrastructure too much.
- 37:08That's so cool. Thanks for breaking that down.
- 37:11So Karthik in the chat was asking a question that I was
- 37:17actually also going to ask about the inference architecture and
- 37:21does it run on kubernetes? Great question.
- 37:25So it did not for us because we whatever we're looking to add in
- 37:32any new tools or technology to our stack at They like to go
- 37:38through, we have, we have to go through such processes.
- 37:41So while we would like to be using kubernetes down the line,
- 37:46it just hasn't gone through that process of approval by security
- 37:50approval, by infra making sure we have all the knowledge that
- 37:53we need to support it. Essentially, we given Republic
- 37:58company and we have, we're consumer-facing platform.
- 38:04We need to make sure we have all our lines of Defense there.
- 38:07All are checkboxes. So what we end up using instead
- 38:11is ansible, which we have been using for many years at sorry
- 38:16monkey and it works well for inference architecture, that's
- 38:20great and Ryan's got a great chat or a great question in the
- 38:24chat, I should say, he's asking, if you can go more into the tech
- 38:28of the async architecture. And if it's closely related to
- 38:33the synchronous architecture, or is it a totally different?
- 38:37Yeah, it has layers of similarity Ryan.
- 38:40And so I would say the aspect of making a request in our Gateway,
- 38:47a routing that all Remains the Same.
- 38:49I think the additional layer of complexity comes in essentially
- 38:53what we use to inform our clients like, hey, your your
- 38:57request has a response that's ready or for sometimes even pass
- 39:02in a request to us. Is we have we use a message bus.
- 39:07That's our second one key wide message bus, you created a topic
- 39:11for ourselves and that allows us to do passing around of requests
- 39:18and responses in an asynchronous manner effectively.
- 39:22And that's essentially our main differentiator, I would say,
- 39:25beginner async and synchronous architecture.
- 39:27And there are some things also getting more into the
- 39:31nitty-gritty about like priority of requests and prioritization
- 39:36cues And different things like that.
- 39:39Yeah. But that's super specific.
- 39:41And for, for each use case, we end up realizing we need a new
- 39:48capability. How can we architect?
- 39:50Are asynchronous architecture to work for this use case.
- 39:57Already. And we like to be driven by use
- 40:00cases rather than entering the whole thing that we can think
- 40:03of. And then try to make it work
- 40:04because otherwise we get bogged down by all these other things.
- 40:09So, DC had another question in here.
- 40:12It's do you run in? Do you run any human tests?
- 40:16IE. How long does it take a human to
- 40:18add a feature? Get it flowing through to the
- 40:23end point. Yeah.
- 40:26Ali always whenever we add in a new capability or whenever we're
- 40:30just like, hey you know, let's see how things improved.
- 40:33So like, at least once a quarter will be looking to say like
- 40:36okay, you know, when you use case, you new machine learning
- 40:39model, that we want to help develop, you know, go through
- 40:42the whole Flow by herself. How does it look how long did it
- 40:45take you? Let's record It All.
- 40:47We Have It All documented. We know how long things took we
- 40:49know where the pain points exist and you know that serves as
- 40:53information for what we can do better next time and what
- 40:56Movements, we can continue to make to our platform for it
- 41:00access. A learning experience for, for
- 41:02people, that are onboarding onto our platform as well.
- 41:04And so, both things and these human tests, we always have to
- 41:09run to make sure that our platform is working to serve our
- 41:13data scientists and the engineers.
- 41:15Well and you know we're really expanding to other teams now
- 41:19helping to democratize machine learning within the greater
- 41:22SurveyMonkey engineering org. Think that could be a nice segue
- 41:25into To talking about how you're doing monitoring with the
- 41:31machine learning models. And I know that there's a few
- 41:34things to keep in mind when you're monitoring machine
- 41:37learning models, you have to just make sure that everything's
- 41:39working properly, the system is up.
- 41:42But then you also want to make sure that your models are doing
- 41:46what they said they put and they they were going to do.
- 41:49And so are using a third-party just to monitor the system like
- 41:54data dog or in Spanish or Whatever it is.
- 41:57And then is that all in-house also or are you also did you
- 42:03build that out and how did you go about that?
- 42:07Yeah, great question. So yeah, when we look at
- 42:09monitoring we look at essentially three things, I
- 42:13would say one is the service monitoring go just like you're
- 42:16monitoring any service. Second thing is input data
- 42:21monitoring so monitoring like what kind of data is coming into
- 42:24your machine learning models? And then Monitor.
- 42:27And then third thing is, like predictions / like real true
- 42:32value monitoring. And so on the service side, we
- 42:37do, we do use some, some third-party tool to help us out.
- 42:43And this is used across our entire organization, we use New
- 42:48Relic, I was just, sorry, I was thinking to make sure that I'm
- 42:50allowed to say and we are so yeah how we use, we use New
- 42:53Relic which allows us to You and all the monitoring on in terms
- 43:00of like service side of things and it's really similar to data
- 43:04dog. We had used a dog in the past
- 43:06and it works quite the same and we and yes.
- 43:12Dan Sullivan from New Relic is going to be on here in about a
- 43:16month so I'll let him know. Yeah, definitely.
- 43:21Yeah, we're big supporters of New Relic and it's worked really
- 43:24well for us and we're really happy about Out that.
- 43:27And then on the input data monitor instead of things, what
- 43:33were essentially doing? Is we look through our log
- 43:36stream. We log all of our input data
- 43:39going into our machine learning models, so that can be logged to
- 43:46our our, our application logs. So that would be coming in
- 43:49through our log stream then. So, you know, we have some, we
- 43:52have different log streams for different use cases, so Kafka.
- 43:56For our message by certain other things like that.
- 43:59And then the second place where we might lock things, is we
- 44:02every prediction is also logged into a prediction DB, so it sits
- 44:07in a database. We can query against it.
- 44:09Real time allows us to do any sorts of like analysis, check on
- 44:13data drift, very things like that.
- 44:15And so, because it gets logged to our log stream, we can
- 44:21develop some dashboards that allow us to look into David
- 44:23drift. What is our data distribution?
- 44:25Look. I'm like for all of our features
- 44:27for the specific model, what is our prediction distribution
- 44:31looking like for this specific model for each version of our
- 44:35model that's sitting out there. How is our our our A/B test
- 44:38results looking like we can go also map.
- 44:42These two True Values later on because our machine learning
- 44:46service, Tain back and point. So, if we can get the feedback
- 44:54real time, we do a scarcer, our clients.
- 44:56Hey, hitter hitter feedback in point.
- 44:58Let us know what the real value was, and that allows us to the
- 45:00map. Oh, yeah, we made this
- 45:01inference. This is the input data.
- 45:03This is the true value. This is how well our model is
- 45:05performing, and that gives us a real time view into our model
- 45:09performance. In some use cases, we don't have
- 45:11that and that's where because we're logging everything to this
- 45:15table. Whenever we do get that
- 45:17feedback, we asked our partners. So, log that feedback into a
- 45:22table of sorts? And so, we can set up some
- 45:25feedback pipelines that essentially map these inferences
- 45:30to the True Values. We can then get some results of
- 45:35how well, our models performing usually, it's like daily or
- 45:38weekly views. Let me just post it into a slack
- 45:41channel. So whoever this model pertains
- 45:44to say, our product managers, our clients us, the ones that
- 45:47worked on the models themselves are aware of Oh yeah.
- 45:51You know this past week we saw we saw some down taking
- 45:54performance, probably we're good.
- 45:56Where we have to go look into this and see like what's going
- 45:58on, or then we can maybe kick off an auto retrain process to
- 46:03just Auto retrain, our model, if our performance dipped below a
- 46:06certain certain threshold and so we have all these systems
- 46:10working in tandem with each other that allow us to monitor
- 46:14all three aspects, effectively, very cool.
- 46:19And what lead? I see your question I just Ask
- 46:21one more about that auto retrain, because last week, when
- 46:25Phil was on, he made the case for this idea of good practice
- 46:29being just to Auto retrain, but he wasn't sure it was so worth
- 46:34it in some to most use cases or what he had seen with certain
- 46:42companies. It wasn't needed.
- 46:44Do you have Auto retraining going on?
- 46:46Or is that something that is not necessary?
- 46:49How does that work with? You guys.
- 46:51So I agree with Phil as well. I think there are some use cases
- 46:57where you do not need it. And I think that's the same
- 46:59thing for us. There are some use cases where
- 47:01we do enable it and some used to use cases where we do not
- 47:04however, we what whether we enable auto retainer, not is one
- 47:11thing but still being able to Auto retrain is I think another
- 47:15thing, all of our models if we need to retrain our And fresh
- 47:21data we can we can just click a button and it'll go retrain.
- 47:25And the reason for that is because if anything were to get
- 47:28corrupted, if anything, where we realize ago, we lost our model
- 47:33artifact, or whole like repository of our model
- 47:37artifacts went down. We know, we can go and do it
- 47:40again and we're confident in that and that is just no, our
- 47:44backup processes. We want to make sure everything
- 47:46is good there. And I think often, When we think
- 47:51like, oh yeah, everything's in the cloud, it's safe.
- 47:53But, you know S3, go down to it'll, be less goes down to and
- 47:57we like to just have our backups there for those keys.
- 48:01For the, you know, that less than 1% of the time when things
- 48:04go wrong. And it also allows us to have a
- 48:09level of accountability of making sure.
- 48:11Like, oh, we did what we did during training, and we can
- 48:14reproduce it. And then reproducibility aspect,
- 48:17make sure that if someone is leaving the company, And someone
- 48:21who is joining, it makes sense to them.
- 48:23What went on here and they can get the exact same model
- 48:26artifact once again, so can be used in any case.
- 48:30So, a couple of different smaller reasons there that Force
- 48:33us to have Auto, we train available still there, but it's
- 48:36still only enabled for certain use cases, where we see data
- 48:39drift occurring, or where we see that we are, our performance is
- 48:43varying over time. Yeah.
- 48:46Yeah, completely it makes sense. So while lead had a question
- 48:50here in the The chat. He was wondering he says I would
- 48:54like to understand more the role of ansible in your
- 48:58infrastructure. Could you please elaborate on
- 49:01how it's used and how your on-prem infrastructure looks
- 49:05like? Yeah, that's a great question.
- 49:08Why lead? So ansible is used for
- 49:10orchestration process. It's used for setting up like we
- 49:15have you know, hundreds of microservices.
- 49:18SurveyMonkey each micro. This has specific Docker images,
- 49:23they want specific setup for node flavors, like what kind of
- 49:27instance you're dealing with different things like that to
- 49:30ansible orchestrates, the setup for each specific node relative
- 49:36to which service it's going to fit under and that's essentially
- 49:43what we use it for there isn't much.
- 49:45There isn't any real of And that's a limitation of our under
- 49:52a structure as we moved to AWS. And some of our services are
- 49:56over there. In some of these cases are over
- 49:58there. That's where we can take the
- 49:59benefit of what AWS gives us. There are on-prem infra I can't
- 50:05talk too much more about what I said than what I've already
- 50:08said. Unfortunately, yeah, I apologize
- 50:13for that but it's, it's It will be rely upon ansible to setup
- 50:20our nodes, and influences, and sit in their perfect.
- 50:24And I was Sandra was asking, do you have use cases that involve
- 50:29personal identifiable information, if you do, how do
- 50:34you handle that? Yeah, great question Alessandro.
- 50:38We do a lot of we are HIPAA compliant because many hospitals
- 50:44or Health Care Professionals use SurveyMonkey.
- 50:47We also integrate with a lot of Enterprises that provide us Pi
- 50:53info and so a pii data. And so we need to be able to
- 50:58work with that and so the way that works is our real-time
- 51:01feature store is set up in a secure manner that only specific
- 51:06services and access it and it does contain the pi data.
- 51:09Since sometimes, we do use Pi data during inference time and
- 51:14that's known to our users. It's an And thing where users
- 51:18have to opt into it however for training.
- 51:21No pii data is available, we can to make that accessible for
- 51:26training ever. So you cannot train on any PI
- 51:30data. It can be anonymized in certain
- 51:32use cases depending upon these case and we have an entire
- 51:36governance process set up that I'm not responsible for.
- 51:39But we make sure to abide by it at each point to make sure that
- 51:44we are working there if Actively and I think, I think the the pi
- 51:53data that we use in the real time cases are also like we do
- 51:57have the ability to be able to go back in and delete it if
- 52:00needed. And the various other processes
- 52:02that are instead of been set up for to abide by it, like the,
- 52:08the data governance practices that we need to fulfill as as a
- 52:12server monkey org. Yeah, that makes sense.
- 52:15Gah. Has a question here about the
- 52:18line between the machine learning engineer and data
- 52:21scientists, he's wondering creating managing model
- 52:25artifacts using repository for this model.
- 52:28Versioning retraining, is this the role of a ml engineer or a
- 52:32data scientist? How to ml engineers and data
- 52:36scientists work together? And when does the ml engineer
- 52:40takeover or are they continuously working together,
- 52:45because Data scientists aren't often keen on software
- 52:49development or versioning. Yeah I know it's a great
- 52:53question. I think each organization Works
- 52:55differently so I can talk specifically from SurveyMonkey
- 52:58has few years ago and used to be like oh yeah data scientists do
- 53:03all the model development to give us model artifact and then
- 53:07they're like okay here you go and off that did not work very
- 53:12well for us in the long run and since then we work together
- 53:16intend on. From the very beginning and that
- 53:19allows our data scientists to pick up on some software
- 53:22development that allows their MO engineer's to understand the
- 53:25model at a very, very low level. So that makes sure that we can
- 53:31know from the get-go like oh actually you know we don't have
- 53:34this data available in our feature store real-time like it
- 53:39only gets populated once a day. So like are you okay with that?
- 53:42Is that fine and our data scientists know this.
- 53:46They requirements or limitations upfront or like oh yeah you
- 53:50know, we can't support a 15 layer neural net we can only
- 53:55really support 10 layer ones at the moment.
- 53:57So you know whatever you're looking to do, we can't do that.
- 54:00And because those conversations are happening earlier on our
- 54:03data, scientists know what the restrictions are, we know what
- 54:06the restrictions are. And from there on, we can really
- 54:10make sure that we don't have any like blockers that we didn't.
- 54:16See kind of appearing and as a result to be specific data,
- 54:21scientists still are probably the leads on the model
- 54:24development and them all Engineers are more.
- 54:27So, the leaves on the production izing aspects, but there's
- 54:31definitely some crossover and more and more crossover edit
- 54:34that, but it happens over time. And I would say that over time,
- 54:37I'd say, I've gone way more depth on the data science side
- 54:41of stuff, enter data scientists have become way more Adept also
- 54:46on On the software engineering side.
- 54:50There was no it's going on and if anything were to happen to
- 54:54our services, I'm sure they'd be able to, you know, be able to
- 54:57chip in and make sure things are running smoothly.
- 55:00Great. All right, so we got two minutes
- 55:03left. I want to ask you one final
- 55:06question. But before I do, what's the best
- 55:09way to connect with you? If anyone wants to continue the
- 55:12conversation, Yeah, I would say linkedin's probably the easiest
- 55:19thing. I look at most frequently, I do
- 55:21have a Twitter and I'll but I don't, I feel like I end up
- 55:26using it all too much. So yeah, perfect.
- 55:29So LinkedIn will put that in the follow-up email and my last
- 55:35question of part is can you talk to us just quickly about some
- 55:42obstacles that you face? When you were building the
- 55:45platform, something that you thought in the beginning was
- 55:48going to be easy. And it wasn't or just something
- 55:51that came out of nowhere and blindsided you.
- 55:56I think. I think we knew this was going
- 56:00to be hard but it was still super hard when we did it which
- 56:02was justifying their requirements and like making
- 56:05sure we stick to it. At the end of the day, we were
- 56:09trying to create something that we didn't have too many examples
- 56:12to follow. Like when we will be would often
- 56:16do is we would talk to other ml teams at other organizations.
- 56:20Like oh hey what are you guys doing?
- 56:21Or what are you doing? And that helped us figure out
- 56:24like oh what was manageable tasks or mental thing we could
- 56:27take on or sometimes They would talk about their own obstacles
- 56:30or nightmares that let us know, like, oh, what's possible or not
- 56:33possible, or what should we really try to do?
- 56:36But I think I still think of the other end of the day, it was
- 56:39really, was scoping like, figuring out.
- 56:41Like what, what can we take on? What can we do?
- 56:43Is this possible? What do we really need?
- 56:48And I think we spent a lot of months doing that and having a
- 56:54lot of back and forth on all aspects about that.
- 56:59The we still probably in terms of it are literate, orations,
- 57:05probably still have that, but I think that was probably the
- 57:08biggest obstacle. Another one was definitely just
- 57:10expertise. We ended up using a lot of tools
- 57:13that were we weren't necessarily familiar with initially.
- 57:17So, it was a learning process for us like we hadn't used pie,
- 57:21spark heavily on like, say our feature stores and of things
- 57:26learning. That was what stuff It's
- 57:29definitely a learning curve there.
- 57:32I would say that those are probably our two large obstacles
- 57:35that were over there. Perfect.
- 57:40Thanks so much. Who be and connect with him on
- 57:42LinkedIn. Thank you everybody, for joining
- 57:44us. This has been an awesome
- 57:46conversation. You all asked some amazing
- 57:48questions. I'll send up a follow-up email,
- 57:52and I look forward to seeing you.
- 57:54We're doing this every week. So, please come join us.
- 57:58Next week. See y'all later have a great
- 58:01night. Stay safe out there.
- 58:03Thanks here and feel safe.