Latest / Talk Python To Me / #359: Lifecycle of a machine learning project
Transcript
- 0:00Are you working on or considering a machine learning project?
- 0:03On this episode, you'll meet three people from the MLOps community,
- 0:06Dmitryo Sprinkman, Kate Kuznikov, and Vishnu Ratchakanda.
- 0:10They're here to tell us about the lifecycle of a machine learning project.
- 0:13We'll talk about getting started with prototypes and choosing frameworks,
- 0:16the development process, finally deployment and moving into production.
- 0:20This is Talk Python To Me, episode 359, recorded March 22nd, 2022.
- 0:25Welcome to Talk Python To Me, a weekly podcast on Python.
- 0:42This is your host, Michael Kennedy.
- 0:44Follow me on Twitter where I'm @mkennedy and keep up with the show
- 0:47and listen to past episodes at talkpython.fm.
- 0:50And follow the show on Twitter via at Talk Python.
- 0:53We've started streaming most of our episodes live on YouTube.
- 0:57Subscribe to our YouTube channel over at talkpython.fm/youtube
- 1:00to get notified about upcoming shows and be part of that episode.
- 1:04This episode is brought to you by Sentry and their awesome error monitoring product,
- 1:10as well as the Stack Overflow podcast, bringing you stories about software development.
- 1:14Transcripts for this and all of our episodes are brought to you by Assembly AI.
- 1:19Do you need a great automatic speech-to-text API?
- 1:22Get human-level accuracy in just a few lines of code.
- 1:24Visit talkpython.fm/assembly AI.
- 1:27Kate, Vishnu, and Dimitros.
- 1:30What's up?
- 1:31Welcome to Talk Python To Me.
- 1:32Hey.
- 1:32How you doing, man?
- 1:33Great.
- 1:34Hey, I'm doing great.
- 1:34It's fantastic to have you all here.
- 1:36I'm psyched to talk about ML Ops and your community and some best practices and tooling
- 1:43and all that kind of stuff.
- 1:44And I think it's going to be a lot of fun.
- 1:46So hopefully you're looking forward to it as well.
- 1:48Yeah, for sure.
- 1:49Yeah, for sure.
- 1:50So think about one of the hottest areas of technology right now, whether it's trying to
- 1:55get a job or it's VC funding or whatever, right?
- 1:58The machine learning and AI is like one of the peak buzzwords right now.
- 2:03And so I think this is going to be a fun conversation both to talk about this hot topic, but also
- 2:07maybe to demystify it a little bit.
- 2:09Yeah, I hope we can do that.
- 2:11I think we can.
- 2:11I definitely think we can.
- 2:12And you all built this cool community, mlops.community, which we're going to talk about a lot.
- 2:18But before we get into that topic, let's just start with your background and how you got into
- 2:24machine learning and all this stuff.
- 2:25Kate, let's start with you.
- 2:26All right.
- 2:26So my background is probably not so conventional for the field, although nothing is conventional
- 2:32for ML, I guess, at this point.
- 2:34So originally, I actually started studying business and economics back in the day, and
- 2:39then I slowly shifted into basically digital analytics for marketing and stuff like that,
- 2:44at which point I realized that I'm more interested in the numbers than in influencing people.
- 2:49So I went through a bootcamp and then one thing led to another through consulting, internships
- 2:54and so forth.
- 2:55Once you get your foot in the door, I guess it's easier to establish yourself.
- 2:58And then I ended up continuing on that path, mostly data science.
- 3:03So not crazy robots or anything.
- 3:06It's still very close.
- 3:08No self-driving cars right now.
- 3:09No self-driving cars yet.
- 3:10So it's still mostly basically ML for commercial purposes, like working with sales data, with
- 3:17text data and so forth.
- 3:19But that was it.
- 3:20I think there's a lot of people that come from economics in that area and get into computation
- 3:26and then get into data science.
- 3:27It's a bit of a gateway, I think.
- 3:29Yeah.
- 3:29And I mean, economics is also kind of this easy choice of subject.
- 3:33When you're finishing school, you're kind of like, I can do math, so I'm not going to
- 3:37do just social science.
- 3:39So, OK, let's go for economics.
- 3:40And then you're like, what can I actually do with it?
- 3:43Do I want to work in a bank or maybe something else?
- 3:46Yeah.
- 3:46Yeah, exactly.
- 3:47I had a similar experience with my math degree, but.
- 3:49Exactly.
- 3:50Yeah.
- 3:51Fantastic.
- 3:51So you said you did a bootcamp, which I think is interesting.
- 3:54When I think bootcamps, I think JavaScript front end, not necessarily the best thing to
- 4:01just produce a whole world full of JavaScript front end folks.
- 4:04But that's sort of the main bootcamp story.
- 4:07It sounds like yours was in data science.
- 4:09Was that a good experience?
- 4:10What was that like?
- 4:11So we actually did have those paths as well with Java and front end.
- 4:15I just decided to go for the data science one.
- 4:19I think they even called it big data in AI or something like that, but technically it was
- 4:23just like pure nice Jupyter notebooks where you are massaging the data a little bit and
- 4:28then running your first couple of models.
- 4:29It was very nice in a sense that it was like all of us struggling together was very intense.
- 4:35So you kind of can test drive your idea of whether it's actually for you or not in a very short
- 4:41time.
- 4:41And ours lasted like, I think three or four weeks.
- 4:44And after that internship, the same company, sorry, bootcamp would get you into an internship.
- 4:49If you pass the whole bootcamp, you pass the last test, do the project and then do the interview,
- 4:55you can be a candidate there.
- 4:57And I think that was very appealing to me because it had some consequence.
- 5:00It wasn't just, oh, let's try this out.
- 5:02And then I don't know what I'm going to do.
- 5:04Who's going to hire me, whatever.
- 5:05It was very well thought out.
- 5:07So in that sense, I think it's a great program that they have put together.
- 5:12I think they're not doing it anymore, like specifically for data scientists, because they
- 5:17found out it's very hard, even in consulting, to employ very, very junior data scientists and
- 5:23get value out of them.
- 5:24So now they're training people in data engineering and then a little flavor of data science so
- 5:31that later you can develop the skill and maybe apply that knowledge down the road.
- 5:35Yeah.
- 5:36Interesting.
- 5:36I do think it probably is a little bit challenging to get in as a junior because there's not a
- 5:40huge team of data scientists a lot of times.
- 5:43So interesting.
- 5:43Yeah.
- 5:44How about you?
- 5:45Yeah.
- 5:45So I fell into this very, very happenstance in a happenstance kind of way, which was I was
- 5:53working on the sales side of a company that was selling tools to machine learning engineers.
- 5:58And so I was that guy that would spam people.
- 6:02And so if I spammed you, please forgive me back in the day.
- 6:06If I tried to reach out to you on LinkedIn and I tricked you into connecting with me, that
- 6:10was my past life.
- 6:12I have repented for my sins.
- 6:14And now I do the community stuff full on.
- 6:19But yeah, the company was doing ML tooling and we were really focused on provenance and
- 6:25trying to be able to reproduce your runs or your data, your models, everything that comes
- 6:31along with the modeling side of machine learning.
- 6:34And so what happened was though, when the pandemic hit, that company went out of business.
- 6:41And just about like three weeks before the company went out of business, nobody was picking
- 6:47up the phone.
- 6:47Nobody was connecting with me on LinkedIn.
- 6:49And so our CEO said, why don't we try and do something around a community?
- 6:54So people don't want us to come to them.
- 6:55Maybe we can make a place for them to come to, right?
- 6:57Exactly.
- 6:58Like, and so our CEO, I got to hand it to him.
- 7:00It's his name's Luke Marsden back in those days.
- 7:03And he was the CEO of this company called Dot Science, which is now defunct.
- 7:07He said, you know what?
- 7:09He has open source in his blood.
- 7:11Like he can't help but do the open source thing.
- 7:15Even though this company wasn't open source, he wanted the community to be very open source
- 7:20and vendor neutral and open to anyone.
- 7:22And in the beginning, I didn't understand that.
- 7:24I was like, wait a minute, you're going to let our competitors come in here.
- 7:27And not only that, you're going to let them give a talk?
- 7:30No way, man.
- 7:31This is crazy.
- 7:32And so he was all about it.
- 7:34And he helped me to understand like the value of community and what it's about.
- 7:37And then because of that, those first like weeks, I just was interviewing people as a podcast
- 7:45host because I needed to ramp up.
- 7:47And so I was interviewing people.
- 7:49Basically, I was learning on the air and I was talking to different machine learning engineers
- 7:53when we would have the meetups and we would run it like almost like a podcast slash meetup.
- 7:58And it would be a live podcast, kind of not too dissimilar to what we are doing right now.
- 8:03And then I was able to talk to enough people and then more people started joining the community.
- 8:08And then I started learning more about it.
- 8:10And now here we are two years later and I'm still running with the community.
- 8:15It became something that is like my pride and joy.
- 8:17And I can't see it's part of my identity now, which I don't know if that's a good or bad thing,
- 8:22but it's part of it.
- 8:23It sounds really fun.
- 8:25And these communities are super fun to build.
- 8:27And two years, that's a long time to be building.
- 8:29And so it's the kind of stuff that doesn't necessarily explode overnight.
- 8:33But if you sort of take a long view and then look back, you're like, wow, look what we built.
- 8:38That's pretty neat.
- 8:39Yeah, totally.
- 8:39I mean, and Vishnu was in it at the very beginning and Vishnu and I talked quite a bit.
- 8:43And it was like when there was, I remember in the first couple months,
- 8:48I was sitting there and thinking, wow, if we hit 600 people in Slack, that will be like
- 8:55uncomprehendable.
- 8:56And so, yeah, then it's kind of like you said, it's just grown from there.
- 9:03And you look back and you go, how did we get here?
- 9:05Wow.
- 9:06This is incredible.
- 9:07Yeah.
- 9:07I think one of the things that's easy to lose sight of for creators and community members
- 9:12or organizers and stuff, it's really easy to get tied up.
- 9:16And you look at like a famous YouTube person with a million views on their videos,
- 9:20or you look at some crazy TikTok thing or something.
- 9:23But 600 people, that's pretty close to a keynote for a lot of conference.
- 9:28That's like the premier group where you try to get them all together.
- 9:33Like that's pretty, pretty amazing.
- 9:35So that's so true.
- 9:36Which is awesome.
- 9:37Yeah.
- 9:37Which new?
- 9:38How about you?
- 9:39Well, how I got started in ML, I think if I really had to trace it back, it was maybe
- 9:44around 2017, you know, around that time, I was really kind of thinking about what I should
- 9:51try and do in my career.
- 9:52I was really passionate about, I am continuing to be very passionate about healthcare and biotech
- 9:57and sort of life sciences field.
- 9:59And I was reading a lot and kind of thinking, what do I want to do with my career?
- 10:02It was maybe, you know, kind of similar to Dimitri.
- 10:05I was actually contemplating some of the very more,
- 10:07sales or business development or product management side of thing in the industry.
- 10:11But I was like, you know, it doesn't feel tangible enough.
- 10:13It doesn't feel like I'm actually helping make people healthier in a very hands-on way.
- 10:18And so I started to read more papers as part of a master's program on the impact of machine
- 10:23learning in, you know, health, healthcare and biotechnology and decided, okay, this is what
- 10:27I want to do.
- 10:28And kind of just spent some time teaching myself how these things work, took some courses,
- 10:32became a machine learning engineer at a medical device company.
- 10:35And quickly after starting that realized, well, there's a lot more to doing model.
- 10:39That, you know, a lot more to machine learning than just doing model.fit.
- 10:42And that's when I joined the MLOps community back when it was about 300 people in May of 2020,
- 10:47you know, have been in it since.
- 10:49Dimitri and I are pretty, pretty tied to that.
- 10:51And that's kind of tracked my growth as a machine learning engineer and understanding,
- 10:54you know, okay, how do we go from model to model and production to system to, you know,
- 11:00business value.
- 11:01And that's kind of been my journey in terms of this industry to date.
- 11:04Yeah.
- 11:05Super neat.
- 11:05I think around 2017 was certainly when the promise of machine learning for healthcare really
- 11:12started to gain public awareness.
- 11:14You know, you had like, I don't remember exactly the timing, but like that XPRIZE around mammography
- 11:19images and stuff like that.
- 11:21We're like, oh, this is starting to beat doctors, right?
- 11:23And it's automatic.
- 11:25Like, could it be both fast and sort of, you know, beating radiologists estimates of whether
- 11:31or not someone has cancer and things like that.
- 11:33And that's pretty neat.
- 11:34I haven't been tracking it that closely, those sorts of developments, but I'm sure it's just
- 11:39grown from there.
- 11:39Yeah.
- 11:39I mean, I think around that time you had, it's a good memory with XPRIZE that was on, on sort
- 11:44of available.
- 11:45There was also a chest X-ray work that was open source from the NIH, big data sets around,
- 11:50you know, what's the, what is the promise of machine learning modeling for that problem,
- 11:54diagnosing pneumonia.
- 11:55And then also AlphaFold came out around that time from DeepPine for biotech, protein engineering.
- 12:00And so on all sorts of different vectors, you had a lot of energy and I guess I was, you
- 12:05know, sucked in.
- 12:05Yeah.
- 12:06That's cool.
- 12:06I suspect that the protein folding understanding is even more important really than you have this
- 12:11problem.
- 12:12But like here we can understand how to fix it maybe for sure.
- 12:14Yeah.
- 12:14Yeah.
- 12:15I think the protein folding stuff, it's especially with the open sourcing of AlphaFold 2 recently,
- 12:20the buzz is pretty incredible.
- 12:21Yeah, absolutely.
- 12:21Well, let's start off by talking a bit about the MLOps community some more, and then we can
- 12:27dive into a couple of layers of best practices and machine learning in production and stuff like
- 12:34that.
- 12:35So maybe Demetrius, we talked a bit about it, but you want to introduce what it's all about
- 12:39for folks?
- 12:40Yeah.
- 12:41And so we're really trying to just be like, this landing page is funny because it's something
- 12:48that we put together, whatever, years ago.
- 12:51And now we definitely need an upgrade.
- 12:54And so we're doing that right now because I realized after I surveyed the whole community,
- 13:00a lot of people are like, wow, we're in this community, we're in the Slack.
- 13:03But we didn't realize that there is newsletters you got going on.
- 13:08You've got roundtable discussions happening.
- 13:10There's reading groups.
- 13:11There's all kinds of different initiatives that people from the community are doing.
- 13:16And we don't actually make that very clear for people when they join, right?
- 13:23So maybe they know about the Slack or maybe they know about the meetups or the podcasts that
- 13:27we have, but that's it.
- 13:29And they don't necessarily get to go through all of that and have a better overview.
- 13:34So that's what we're doing now.
- 13:35And really like the community for us, it's trying to find this place or trying to define
- 13:42and create this space where people can come together.
- 13:45They can learn, they can engage with practitioners who are on the front lines and get their questions
- 13:51answered, but also like meet others and network with people.
- 13:55And we're doing that in this virtual space.
- 13:57We're trying to really share, collaborate, learn, and trying to make it fun also.
- 14:04So it's not just like numbers, crunching numbers and stale and boring.
- 14:09This portion of Talk Python To Me is brought to you by Sentry.
- 14:14How would you like to remove a little stress from your life?
- 14:17Do you worry that users may be encountering errors, slowdowns, or crashes with your app
- 14:23right now?
- 14:23Would you even know it until they sent you that support email?
- 14:26How much better would it be to have the error or performance details immediately sent to
- 14:31you, including the call stack and values of local variables and the active user recorded
- 14:36in the report?
- 14:37With Sentry, this is not only possible, it's simple.
- 14:40In fact, we use Sentry on all the Talk Python web properties.
- 14:44We've actually fixed a bug triggered by a user and had the upgrade ready to roll out
- 14:49as we got the support email.
- 14:50That was a great email to write back.
- 14:52Hey, we already saw your error and have already rolled out the fix.
- 14:56Imagine their surprise.
- 14:57Surprise and delight your users.
- 14:59Create your Sentry account at talkpython.fm/sentry.
- 15:04And if you sign up with the code talkpython, all one word, it's good for two free months of Sentry's
- 15:10business plan, which will give you up to 20 times as many monthly events as well as other
- 15:15features.
- 15:15Create better software, delight your users and support the podcast.
- 15:19Visit talkpython.fm/sentry and use the coupon code talkpython.
- 15:26I'll throw an idea out there.
- 15:27You'll tell me what you think.
- 15:29I already sort of hinted at this.
- 15:30You know, for software developers, a lot of times they're on teams where there's, you know,
- 15:34group five or 10 of them working together.
- 15:36But I feel like that's less true for machine learning folks and more of a specialized role.
- 15:42Not always.
- 15:43I know there's teams and stuff, but a lot of companies have a data scientist or one or
- 15:47two data scientists.
- 15:48And it seems to me like communities like this would be more about even more valuable than
- 15:53say like a software development one where it's maybe easier to find in your environment as
- 16:00a meet at a meetup or at a company that you already work at or something like that.
- 16:03Totally.
- 16:03Totally.
- 16:04I resonate with your description there, Michael, because that was me when I found the community.
- 16:08Right.
- 16:09You know, I was a machine learning engineer who was putting together some models that I
- 16:14thought could be used better by the company that I was at, you know, could be integrated
- 16:18into our hardware device a little bit better than I thought that, you know, than was currently
- 16:21being done.
- 16:22And I was trying to talk to our software engineers and realize like, hey, there's kind of a, just
- 16:27like a translation gap.
- 16:28Like, what is this field of like taking a model that exists and has some value in terms of
- 16:34like accuracy and precision or whatever else.
- 16:36And I turned that into, you know, an artifact that's consumed by software teams and then
- 16:40ultimately by business teams.
- 16:41And I read about ML Ops in 2020, but was really not clear what exactly that meant.
- 16:46It felt more like a buzzword than it did like a field at that time.
- 16:49And I joined the community and it essentially became real-time stack overflow for me, right?
- 16:54Where people are asking and answering questions daily about how do you actually implement production
- 17:00ML?
- 17:01What does it look like?
- 17:02What are the best practices?
- 17:03And how can we help each other do that at work and be better ML practitioners day to
- 17:08day?
- 17:08So it's been great from that standpoint.
- 17:09Yeah.
- 17:10Fantastic.
- 17:10Kate, how about you?
- 17:11How did you come to the community?
- 17:13I'm not actually sure exactly, but I think it was also like the whole pandemic.
- 17:17You tried to connect to the world and including ML Ops.
- 17:20And at the time, a friend of mine was also starting a community in Riga.
- 17:24It wasn't ML Ops.
- 17:25It was data science in my hometown.
- 17:27Because, again, we couldn't meet in person.
- 17:29So we did that.
- 17:31And along the same time, we discovered that there are other Slack communities.
- 17:34And it was just fun to...
- 17:36We had a different focus.
- 17:38So it was just fun to be kind of part of both and in different directions.
- 17:41And I do agree with the stack overflow notion.
- 17:45Like sometimes, especially if you're working alone on a problem, you just go there to feel
- 17:49like you're not crazy, first of all.
- 17:50To think that's what you're thinking.
- 17:53And secondly, just basically, I can search right now.
- 17:55There's like such a huge knowledge base because so many questions have been asked.
- 18:00So I can go there to quickly validate some ideas, see which angles have been taken into consideration.
- 18:05So in that sense, it was fun.
- 18:07And definitely the networking aspect.
- 18:08Luckily, Berlin is full of ML people.
- 18:11And that's definitely one of the places you can reach out for questions.
- 18:15I had some people reach out to me, ask about like, what are the companies to apply to?
- 18:20Are there any jobs?
- 18:21Do you want to refer me?
- 18:22And vice versa.
- 18:23So it's definitely fun.
- 18:24Yeah, nice.
- 18:25I don't know why this is, but you're right.
- 18:27It does seem like Berlin and sort of generally Germany as well.
- 18:32It's just a lot of times I'm talking to people about data science or machine learning.
- 18:36I'm like, wait, you're both in Berlin?
- 18:38It's like of all the places in the world, it does seem like a hotbed of machine learning.
- 18:44That's pretty cool.
- 18:44And now there's a lot of companies that just source their talent here and work in completely
- 18:49different markets because they know that there are people here that people will be willing
- 18:53to relocate here as well.
- 18:55So that's definitely adding to the whole dynamic.
- 18:58Yeah, absolutely.
- 18:58It's a cool place to live.
- 18:59And I think probably a lot of folks in Germany, I know the education system there, they end up
- 19:05very good and strong backgrounds in math and stuff.
- 19:08So, right.
- 19:09Compared to other places in the world, like the US, certainly coming out of high school,
- 19:14there, you come out with a very strong math degree.
- 19:17I know that much.
- 19:17So pretty cool.
- 19:18All right.
- 19:18Well, let's start by talking about, I wanted to cover sort of the URL thoughts on some different
- 19:25layers or stages of a machine learning project.
- 19:28So we could structure our conversation around that.
- 19:31So I want to talk about prototyping, come up with ideas, choosing frameworks, things like
- 19:35that.
- 19:35And then talk about building the project with development and then running and maintaining
- 19:40it over time, the whole ops sort of machine learning and production side of things.
- 19:45So let's start with prototyping.
- 19:47So I guess the first question I wanted to ask, and this might be, I don't know, y'all can laugh
- 19:52at me or whatever, but deciding is a problem actually a machine learning problem?
- 19:56Because there is so much hype around AI and machine learning that sometimes I think a series
- 20:02of if statements is called artificial intelligence.
- 20:05I remember there was this scandal, I think it was in the UK, there was some airline company
- 20:10that was specifically finding families traveling together and booking them apart from each other
- 20:16and then charging them money to book themselves back like a premium to so they could sit with
- 20:21their family.
- 20:21Like, sorry, your seat didn't get put next to your family.
- 20:24Whoopsie.
- 20:25But you can pay 50 bucks or 50 quid or whatever and get back by your family, right?
- 20:29And it was in the lawmakers, they were like, they're using artificial intelligence to do this
- 20:34terrible.
- 20:34Like, that sounds like an if statement.
- 20:36So, you know, like I think deciding, should I just encode some decision-making into software,
- 20:43which we often call programming versus is it a real machine learning problem where neural
- 20:48networks or NLP, like how do you all think about this is a machine learning problem versus
- 20:54this is just a software problem, traditional style?
- 20:56I'll just say one thing just before I let Vishnu and Kate jump in and it comes from one of the
- 21:03community members.
- 21:04Who has like a famous tweet and blog posts about like the first rule of machine learning is don't use
- 21:12machine learning.
- 21:14And so, if you can avoid it at all costs, it's probably better just because you're adding additional
- 21:20complexity.
- 21:21And if you don't need to do that, then it's going to be infinitely easier on you to not.
- 21:28That being said, there are a lot of times where you do need to add it.
- 21:32And there are a lot of businesses that are realizing business value from it.
- 21:36So, that's like kind of a hand wavy answer, but I'll see if Vishnu or Kate have anything
- 21:41more concrete.
- 21:42Yeah, absolutely.
- 21:43Also, I just want to give a quick shout out.
- 21:45I did have Eugene on the podcast in March of last year.
- 21:50We talked about the seven lessons that machine learning can teach us about life or something
- 21:54like that, which is pretty, he's a very thoughtful guy.
- 21:56Yeah, he's great.
- 21:57He is awesome.
- 21:58Yeah.
- 21:59Your question is about whether or not to use machine learning versus maybe more traditional
- 22:03approaches.
- 22:04Is that correct?
- 22:05Right, right.
- 22:05Someone comes to you with a problem and says, we need to make our API do this or our website
- 22:10do this or our app do that.
- 22:11And how do you decide, like, this is a machine learning problem versus just, you know, you
- 22:15just need to decide if statement or switch statement or whatever.
- 22:18I deal with this problem a lot in my role right now.
- 22:21I'm a data scientist at a healthcare services company, actually the first day to hire.
- 22:25And a lot of times I have people come to me that says, hey, this is a clinical population.
- 22:30This is a group of people that we want to serve.
- 22:32You know, how do you think about delivering our intervention to them?
- 22:37I'm speaking in generalities, but I can talk a little bit more specifically to some examples
- 22:40of this later on.
- 22:42And to me, what matters most is driving value on a single business metric, because to be honest,
- 22:49that's the simplest way that your company does better and you do better, right?
- 22:53It's not through, let's say, implementing the most fancy algorithm.
- 22:57You know, we're not working in research environments anymore when it comes to machine learning as
- 23:02often as we used to, right?
- 23:03If you're in a research role, be my guest.
- 23:05Use the most advanced algorithm or whatever the coolest, latest model might be.
- 23:10But for me, the number one thing is what is the business model metric I'm trying to drive?
- 23:15Is that engagement for our population?
- 23:17Is that some sort of like quality metric in the healthcare sense that I'm trying to change?
- 23:22And then what is the simplest possible way that I can advance that number, right?
- 23:27Is it just like a standard SQL query I run?
- 23:29Is it, you know, some kind of template in SQL query or is it a machine learning model?
- 23:33And the idea is simple is reliable and scalable, much more so than something complicated.
- 23:39And that's kind of the way that I triage whether or not machine learning is the right intervention
- 23:44for a problem.
- 23:45And so to kind of recap, it's like, what's the business model metric I'm trying to push?
- 23:49And then what's the simplest possible thing, knowing that it's something that needs to be
- 23:53reliable and maintainable for the long term.
- 23:54Yeah.
- 23:54Excellent.
- 23:55Kate?
- 23:55I agree with Vishnu.
- 23:56Well, my advantage as a newcomer to this career path, I guess, was that I was just unable to go very fancy in many of the cases.
- 24:07So it was a no brainer to go, what is the simplest way and what is actually the way I can solve the problem?
- 24:14And then just by having adopted that mentality early on, you kind of, you basically hack the problem, right?
- 24:19And then also coming from more business marketing background, again, I'm not thinking about what is the fancy, shiny new tool that I want to use.
- 24:27Sometimes I do now because I'm bored, but this is more for the cases where nobody cares what I'm really doing.
- 24:33And then I show them something sparkly.
- 24:36From my side, I would say it's very important to communicate the solution rather than thinking about whether it's an ML problem or not at the end of the day.
- 24:46So if you give the people what they want and with the shine and sparkle that they want, they will forget whether there's AI behind it or not.
- 24:54Having said that, though, in consulting experience, sometimes people really come to you and they're like, I want this predictive model and just like leave it or take it.
- 25:03And you do it for them, even though it's not the most, the best approach, or especially if you try to explain, maybe that is not the best approach.
- 25:11But sometimes people just need to, I don't know, maybe they have a KPI of having developed one and introduced one ML project into their teams.
- 25:21And this is it, like whatever way.
- 25:23So there are some cases, but I think most people can be reasoned with.
- 25:28Yeah, the stockholders demand more AI.
- 25:30So we need more AI.
- 25:31I don't know what that means, but we definitely need it.
- 25:33Yeah, that's great.
- 25:34And I do resonate with the idea of just start simple and evolve.
- 25:39Like so many people perceive software and software projects in the broader sense as I have to think about it for a long time and get it right.
- 25:48Rather than let me try to build something over a day.
- 25:51And if that doesn't work, I'll try something else.
- 25:54Or we can evolve it over time.
- 25:56Maybe that comes from back when software was harder to change and the tools were chromium or whatever.
- 26:01Yeah, I think just jump in, try something and go with that.
- 26:04Yeah, I wanted to say something real fast on machine learning, especially.
- 26:09And this is something that I think a lot of people don't realize until later on.
- 26:15And I see it time and time again from the veterans in the community coming and answering questions that are being proposed.
- 26:23And that is like really taking it back when you're proposing a solution or when you're asking a question in the community.
- 26:31It's like, but what is it exactly?
- 26:33What is the business value here that you're trying to affect?
- 26:37Because machine learning is so closely tied to business that you can't really...
- 26:43It's like that Venn diagram is so overlapping on the business side.
- 26:48And it also has the technology side.
- 26:50But a lot of times we just take for granted that it's technology.
- 26:54But you can't do that, right?
- 26:56Like especially with machine learning.
- 26:58Like if you're an SRE and you're just focusing on the SLOs and all of that, it's a lot easier to be like, okay, cool.
- 27:05This is a very technology problem.
- 27:07But when you're machine learning and like Vishnu said, like you really got to know what kind of metrics are you trying to move the needle on?
- 27:14And how are you going to go about that?
- 27:16So that was just something that I noticed comes up quite a bit from the veterans saying like, wait a minute, slow down.
- 27:24Before you go for that next one, what is it that you're trying to do here?
- 27:28Yeah.
- 27:28Probably someone comes in with a question like, I'm trying to make PyTorch do this thing.
- 27:33And I'm having a hard time.
- 27:34Like, whoa, whoa, whoa.
- 27:35But do you really need to do it?
- 27:36Like, is that really?
- 27:37Maybe it's cool or whatever.
- 27:40But is that really what you need in this situation?
- 27:42Could you just use Pandas?
- 27:43That's exactly what it is.
- 27:45And oftentimes it's something even more complicated than that, where it's like, I'm trying to have, you know, I'm trying to use Kubernetes to do this retraining job 100,000 times.
- 27:54So I can see which of these models is most effective at this particular metric.
- 28:00You're like, whoa, whoa.
- 28:01You're about to undertake a huge engineering project with all kinds of complicated tools.
- 28:05Why?
- 28:06Yeah.
- 28:07But if you ask why you send people into existential crisis, so that is the interest as well.
- 28:12I guess the audience, Cam asks or says rather, a lot of times I've researchers propose algorithms that are too computationally complex to run at the speed we need for production.
- 28:23And I think that's probably also an interesting thing to consider when you're doing the sort of prototyping, getting things started is maybe here's a algorithm.
- 28:33I'll give you a great answer.
- 28:34But, you know, Vishnu, you talked about training 100,000 ways, right?
- 28:38Like, can you really spend $25,000 to decide, you know, on compute in the cloud or something to decide if this is even going to work, right?
- 28:47Or could you do that in production and over the data you have or something, right?
- 28:50What are your thoughts on this?
- 28:51A lot of times, and I'd say like a lot of times machine learning, our default in terms of technical requirements is pretty unilateral, you could say, right?
- 28:59It's like increased accuracy or the precision or whatever the score is.
- 29:03But in software engineering and in other forms of engineering, they're much better at understanding multivariate requirements, right?
- 29:09And I think that's where you see the tension, right?
- 29:12The data scientist says, but this model works at the problem.
- 29:15It does the thing it's supposed to.
- 29:16It's better on this one thing.
- 29:17And the engineer says, well, wait, no, there are a million things that I think about.
- 29:20I need to think about latency.
- 29:21I need to think about my capability.
- 29:22I need to think about, you know, how big the file might be.
- 29:25There might be a million different things.
- 29:27And I think that's where you see the kind of thing that Cam's talking about.
- 29:30Yeah, interesting.
- 29:30And I think it comes from academia, actually, because they just recently, I remember a year ago, we're doing a meta science course where it discusses ML, basically model assessment, and how the same researchers could not reproduce their results because they just realized they use different compute.
- 29:49So they will be having different results.
- 29:52And in each of those cases, they realize they need to bring that information in, in the academic paper to have comparable scenarios.
- 30:02So maybe you have a little compute, a little compute, and then this is the best model.
- 30:05And in the other scenario, the other one is better model.
- 30:08And I think now that there's changes in academia, it will kind of become more standard to consider elsewhere as well.
- 30:15Yeah, it's a good point.
- 30:16How many times have we heard of stories, and I'm sure people listening have lived these stories of a data scientist coming with a model, and it's like, or they go, they get tasked with a problem.
- 30:27They go work on a model for a while, and they come back with the accuracy or F score is like, perfect.
- 30:35And then they give it to whoever the stakeholder is, another stakeholder, and that stakeholder is like, but this is useless to me.
- 30:41I don't care what your accuracy score, you're not actually solving the problem here.
- 30:45And it just goes back to this, like, make sure you're very clear on what you're optimizing for.
- 30:52And then another point I wanted to make, which I feel like is super important, is depending on your use case, you really have to be vigilant about what you're trying to do and what you use to get there.
- 31:05Because if you're doing like autonomous vehicles, that is a whole nother world as compared to what Vishnu is doing or what Kate's doing, right?
- 31:14Like, even if you're just dealing with unstructured data, and you have a computer vision problem that's in healthcare, and it's deciding if someone has cancer, that takes a lot longer.
- 31:24You can put out like one model, and it has to get approved by the FDA.
- 31:28And that takes a long time for it to go through that process.
- 31:31So you don't really care about like, updating that model in real time and gathering that data right on the fly, right?
- 31:37But if you're in autonomous vehicles, that's a whole nother set of problems that you need to get into.
- 31:43And so really like recognizing what is your use case?
- 31:46What is the big things that you need to take into account as you're looking into these use cases?
- 31:51And where do you want to optimize?
- 31:54For sure. And I definitely want to talk about that tradeoff of like, building the perfect model versus evolving it later.
- 32:00This portion of Talk Python To Me is brought to you by the Stack Overflow podcast.
- 32:06There are few places more significant to software developers than Stack Overflow.
- 32:11But did you know they have a podcast?
- 32:13For a dozen years, the Stack Overflow podcast has been exploring what it means to be a developer,
- 32:19and how the art and practice of software programming is changing our world.
- 32:23Are you wondering which skills you need to break into the world of technology or level up as a developer?
- 32:28Curious how the tools and frameworks you use every day were created?
- 32:32The Stack Overflow podcast is your resource for tough coding questions and your home for candid conversations with guests from leading tech companies about the art and practice of programming.
- 32:43From Rails to React, from Java to Python, the Stack Overflow podcast will help you understand how technology is made and where it's headed.
- 32:51Hosted by Ben Popper, Cassidy Williams, Matt Kierninder, and Sierra Ford, the Stack Overflow podcast is your home for all things code.
- 32:59You'll find new episodes twice a week wherever you get your podcasts.
- 33:02Just visit talkpython.fm/stackoverflow and click your podcast player icon to subscribe.
- 33:09And one more thing.
- 33:10I know you're a podcast veteran and you could just open up your favorite podcast app and search for the Stack Overflow podcast and subscribe there.
- 33:16But our sponsors continue to support us when they see results and they'll only know you're interested from Talk Python if you use our link.
- 33:23So if you plan on listening, do use our link, talkpython.fm/stackoverflow to get started.
- 33:28Thank you to Stack Overflow for sponsoring the show.
- 33:31So another area that I think is interesting to consider as you're getting started has to do with how much compute does it take to solve some of these problems and build some of these models?
- 33:44Like more than a lot of other areas of software development, training models takes a ton of energy, which can either mean money or time or both.
- 33:53You're putting aside like just the carbon costs of like spending a lot of time on servers, but just, you know, how are you going to accomplish that?
- 33:59Right.
- 33:59So how do you think about that tradeoff?
- 34:01Like, oh, can I train this up on my laptop or do I need to get a GPU cluster or what are your thoughts there?
- 34:08It's funny.
- 34:09I actually think the compute part of MLOps is perhaps the most solved portion of the stack.
- 34:15We usually think about things in terms of data model and code in machine learning, right?
- 34:22You know, your data is changing.
- 34:23You want your model to change as the data changes.
- 34:25And then your code is just sort of a way that you control the model that you're creating based on that data.
- 34:30Right.
- 34:31And, you know, when you think about what AWS has done over the last few years to make it more possible than ever companies like paper space as well.
- 34:39And even, you know, Google cloud was making cloud free and GPU instances free.
- 34:44Like it's very easy to experiment with compute much more so than ever before.
- 34:48And I think that is the hardest part of the process, right?
- 34:52It's freedom to experiment is usually what is the constraint, right?
- 34:57Right.
- 34:57And, you know, I'll just contrast that with data.
- 35:00It's very difficult to, I would say, experiment in the machine learning process right now with different data sets, with trying to work with sort of synthetic data or use different cuts of data that are correlated with interpretability.
- 35:13That is a very much more complicated area.
- 35:16I would say that I think a lot of machine learning professionals spend a lot of time doing a lot of manual work on as opposed to compute nowadays, which is by and large, I think like a very experimental and solved problem.
- 35:26Yeah.
- 35:27Excellent.
- 35:27Do you do any edge computing with your, do you do like medical devices or anything like little, little devices that people walk around with that you've got to put real time stuff onto?
- 35:37I used to, I used to work at a medical device company that was doing an eye imaging device.
- 35:41And we used to put a machine learning model on an ophthalmic imager.
- 35:45And it was interesting.
- 35:47It really gave me a lot of appreciation for, you know, what some of the folks at, at Apple and Nvidia and Fitbit and some of the other, you know, sort of bigger companies that do a lot of, a lot of machine learning on device do.
- 36:01It takes a particularly talented group of hardware and software and machine learning professionals to make all that stuff work together.
- 36:08And I would definitely suggest to anybody interested in this field, like check out what Nvidia is doing.
- 36:13They're doing a lot of really cool stuff.
- 36:14From what I learned in my time doing it, I learned that, you know, simplicity is really, it's the way that you can get things done.
- 36:21We were just exporting model weights to a pickle file and then doing some very low level computation to make it as fast as we needed.
- 36:28So that's about my experience working on that level.
- 36:31Interesting.
- 36:31Okay.
- 36:31Yeah.
- 36:32I'm always blown away that pickle is still used, but especially in this area, it's pretty interesting.
- 36:36It works.
- 36:37I know.
- 36:37It definitely does.
- 36:38It's easy.
- 36:38It's just whatever.
- 36:39Just save that.
- 36:40We'll deal with that.
- 36:41Let's talk real quick about one thing you have over on the community.
- 36:46You have a couple of things up at the top here.
- 36:48And one of them is called this feature store.
- 36:51It sounds like it might be helpful for people to get started.
- 36:54Do you want to tell us about this a little bit?
- 36:56Yeah.
- 36:56So we like set out to demystify a space.
- 37:00And like, I have so many stories of how this just was like, I didn't know what I was getting myself into when I started creating this.
- 37:09Because the MLOps, first of all, like right now in machine learning, there's not clear spaces of like, oh, this is this tool.
- 37:20And you need this tool if you're doing X, Y, Z.
- 37:23And here's the space that it occupies.
- 37:26There's like this tooling sprawl.
- 37:28And some tools do a little bit of this.
- 37:30And other tools do a little bit of that.
- 37:31And maybe this tool does all of these things, but it doesn't get you with that.
- 37:35And so what I've been able to congregate on or like I landed on a few things that are different spaces that are clearly defined.
- 37:46And one is the monitoring space, because I think that's just really easy for people to comprehend.
- 37:53Monitoring is it's like software development monitoring.
- 37:56But then you add the machine learning aspect to it.
- 37:59And you add that data.
- 38:00And then boom, you've got lots of new stuff to monitor.
- 38:04And then there's the feature store part.
- 38:05There's also like the metadata management or experiment tracking piece.
- 38:10And then there's the deploy piece.
- 38:11And like you can ask Vishnu, I've gone back and forth on how we're going to present these things, what we're going to do in order to create.
- 38:21Should we create the framework and basically do Gartner's job for them and say like, these are what you should be looking for in the tooling if you're looking for a feature store or if you're looking for a monitoring tool.
- 38:34And that's what we kind of have been trying to do.
- 38:37And we've been working with all the different companies in the community and then also like practitioners who use this.
- 38:43And we've been asking them like, hey, is this what you would expect from a feature store or a monitoring company or metadata management or deployment tool?
- 38:52The problem is that like there's a lot of tools right now that are doing like they're specializing in optimizing compute.
- 38:59And then they also have deployment as a feature.
- 39:02So is that a deployment tool?
- 39:04Yeah.
- 39:04So, yeah, it's a tricky one.
- 39:07But I guess the takeaway maybe is over on your website, you've got like some different categories that sort of try to do that comparison to help people pick some of these tools.
- 39:14Yeah, exactly.
- 39:16And so that's where me pulling my hair out for the last like year and a half has been just trying to figure out like what because I know that if I'm struggling differentiating all of these tools, I'm not the only one.
- 39:28This is what I go on and people reach out to me quite a bit to tell me about their new MLOps tool.
- 39:34Then I go on to their website and I'm like, what exactly do they do?
- 39:37It's always the same like stat.
- 39:40You hear like 80% of machine learning models never make it into production.
- 39:43And that's like what they have is they're like H1 on their website.
- 39:46And then it's like, but what do you do?
- 39:49I don't understand.
- 39:50So we tried to like take a non-biased approach to figuring that out.
- 39:54Yeah, very cool.
- 39:55Let's move over to the development side.
- 39:59So you sort of figured out your path.
- 40:01You decided it is a machine learning problem, how you want to approach it and so on.
- 40:05What are some of the recommendations or techniques that you have for people in that stage of these ML projects?
- 40:14You know, the one that I hear a lot of times is, or the category, I guess, is there's a lot of software engineering practices that don't necessarily get brought into data science as often as they should.
- 40:26For example, like unit testing or version control or stuff like that.
- 40:29Like what are your thoughts?
- 40:30Kate and Vishnu especially.
- 40:31I'll let Kate go first.
- 40:33Yeah, it's a good one.
- 40:34I wouldn't call myself a super awesome engineer.
- 40:38I'm still on that path trying to just be tolerant and understanding to my other folks on the team who actually know what they're doing and not to make their lives too hard.
- 40:47My personal super tiny hack was, especially in the days where I think people are still using notebooks, but I'm using VS Code with this like hash percent percent sign, which turns your script into cells.
- 41:01And when I'm done, I just clean it up and it becomes a normal script again.
- 41:06Or at least I can basically copy it and do that.
- 41:10You can still run it, yeah.
- 41:10And still run it and test it out that way.
- 41:12And that I think really speeds up the process.
- 41:15And of course, yeah, version control.
- 41:17Currently, I'm working with teams or just basically either data engineer or SREs who are helping me make things a bit more polished or deploy them a bit better.
- 41:29So I don't have to think about it that much.
- 41:31So I'm happy to hear from Vishnu.
- 41:34Yeah.
- 41:34To me, components of the software engineering workflow that I suggest data scientists and machine learning engineers heavily leverage are version control, CI, CD testing, and in general, you know, clean code best practices.
- 41:47Right.
- 41:48You know, I'm not.
- 41:49Yeah.
- 41:50Code reuse functions rather than just top to bottom with copy paste.
- 41:54Yeah.
- 41:55I mean, if you do, if you do those three, four things, like, you know, that's actually, you know, I would say like a good bit of a hard day-to-day stuff, right?
- 42:03Just following those best practices.
- 42:04Yeah.
- 42:04And they'll really accelerate you.
- 42:06I try to set those things up early on in the process of running a project, you know, setting up the repo, get a repo the right way, setting up CI, CD to the extent that makes sense.
- 42:16You know, you don't want to over-engineer infrastructure around your project without having a project too early on.
- 42:21But I think those kinds of things are very helpful.
- 42:24And, you know, we had on a guest on our podcast, our ops community podcast, Demetrius and I, a guy named Jesse Johnson, who is the VP of software engineering and data scientists at a company called DuPont Therapeutics.
- 42:35And he has this concept known as building software from the outside in.
- 42:38And what that means is you start sort of at the finished, you start like when you're building like a product, a product, maybe that involves an API, like define what the API looks like.
- 42:48Define what you'd like your end user, what their experience to be like, and then build backwards to all the things that allow for that to happen.
- 42:56And I like to think about the same thing with the machine learning model or with whatever kind of data science output that I have, which is what I want that end experience to look like, how elegant should it feel, how well, how reliable, maintainable and well architected should it be.
- 43:10And then build in, you know, build inwards towards that.
- 43:13So that's sort of another software sort of engineering concept that I try to apply.
- 43:16Yeah.
- 43:17A lot of people talk about how unit testing makes your code better.
- 43:21And I think that's actually, you've touched on the key to why that is.
- 43:25Because instead of just thinking about the details of the algorithm, you have to think about like, well, how is this going to look when somebody tries to use it?
- 43:31Right.
- 43:31And like, because that's what you got to kind of do in the test is use it a little bit.
- 43:34Exactly.
- 43:35Kate, do you want to go?
- 43:35I just wanted to do a quick joke that it runs on my machine.
- 43:39So it must be good.
- 43:40It must work.
- 43:42Do you know about the, it works on my machine certification program?
- 43:45No.
- 43:47What is that?
- 43:48I need this.
- 43:48Oh, it's brilliant.
- 43:50It has some interesting rules.
- 43:52So yeah, anytime somebody is sort of, you can do this, you can give them this stamp.
- 43:58And it's brilliant.
- 43:59To be certified, you have to compile your application code.
- 44:02This is like a language of files.
- 44:03Getting the latest version of any code changes from any other developer is purely optional.
- 44:07Launch the app.
- 44:09Cause at least one path to be executed.
- 44:11Preferred way to do this is ad hoc manual testing.
- 44:15You can omit this step if the code change was fewer than five lies or in the developer's
- 44:20professional opinion.
- 44:21The code change could not possibly result in an error.
- 44:23Check in your code.
- 44:24Certified.
- 44:25Oh boy.
- 44:26Yeah, I know.
- 44:27It's the problem that we all run into, right?
- 44:29Yeah.
- 44:29Yeah.
- 44:30Reproducibility and the shareability and so on.
- 44:34And you're right that like source control and CI and these things are absolutely, absolutely
- 44:39important.
- 44:39One thing, Demetrius, go ahead and jump in with your thought.
- 44:42Then I want to talk about a tool here real quick.
- 44:44Oh yeah.
- 44:44I was just going to say that one of the guests on the community podcast made an excellent point.
- 44:50We've had two that come on, that have come on and talked about testing specifically for
- 44:54machine learning.
- 44:55And one of them, Svet, was talking about how when you properly test, and actually,
- 45:01Mohamed, both of them, they kind of said the same thing in different words.
- 45:04When you have tests set up and they're properly there, not just unit tests, but also like testing
- 45:09the data and this kind of stuff.
- 45:11One of the side effects that you get from that is it's documentation.
- 45:15It's like you have these artifacts that are left.
- 45:18So you, as someone who's coming in and jumping in new, you get to see, oh, okay, so this is
- 45:24what's happening with this slice of data.
- 45:27And this is when you are trying to debug something, it gives you a much better picture and it's
- 45:33more clearly laid out than if you were to just leave it all up to chance, we could say.
- 45:39And, you know, the open source angle, if you're looking at some package or library to use for
- 45:45your code and you go and check it out and it has no tests, there's a good chance you're like,
- 45:50ah, this thing's not really ready.
- 45:51People are not putting the effort to make sure it's good enough to remain good enough over time
- 45:56and to help onboard new contributors that you really want to depend upon it, right?
- 46:01So I think there's that angle that's important as well.
- 46:03The two tools I wanted to talk about really quick in this area is this thing called DCV,
- 46:10which is open source version control for machine learning projects.
- 46:14maybe, and then also before that is NB dev from fast.ai.
- 46:19Vishnu, you spoke about using Git and checking in yourself and so on.
- 46:23And one of the challenges, I think notebooks are great, but one of the challenges of them is they
- 46:28kind of save their output in the file and every run potentially be generating a different output,
- 46:33which means some like meaningless Git merge conflict problem you got to deal with.
- 46:38Do you have, do you have ideas to fix, fix some of that stuff?
- 46:41Or do you use anything like NB dev to sort of make that simpler?
- 46:43Good question.
- 46:44I like paper mill a lot.
- 46:46I follow the Netflix approach for working with notebooks.
- 46:49I think that they're a very useful tool.
- 46:51I think that if you're prescriptive, give us the quick summary of what the Netflix philosophy there is.
- 46:57Sure.
- 46:57Yeah.
- 46:57Maybe they should do that.
- 46:58Basically, Netflix's point is notebooks are a really effective, interactive prototyping tool that if given really prescriptive guardrails can be a part of a production process.
- 47:12And they use notebooks in production at Netflix and they really encourage their use internally.
- 47:16And they've developed a lot of tools that help make sure that the known flaws of notebooks, such as the state element that you pointed out, don't lead to things falling off the rails.
- 47:27And that's the way I like to think about it as well.
- 47:29I don't use an NB dev myself, but I do think it's a great project that for people who are thinking about using notebooks, they should check out.
- 47:38I think another tool that I've heard of is called Plumber.
- 47:41But the most important thing is when you're using notebooks, I think rather than getting into a holy war about whether they're the best tool or not, it's understanding that is it the right tool for my job?
- 47:53And I view the right context for that as being when iteration and speed is of the essence.
- 47:59There is no tool that is better than a Jupyter notebook.
- 48:02It's just there isn't.
- 48:03And then we have the empirical proof for that.
- 48:04So let's just find ways of putting process around it to make it work.
- 48:08Sure.
- 48:08Yeah, that makes sense.
- 48:10What about tools like DCV, some of these version control systems?
- 48:15You know, part of the problem is the data sets and data science in general, but in machine learning as well, it's just like it doesn't actually make sense to check them directly into Git.
- 48:24To Git, yeah.
- 48:25You know, yeah, yeah, yeah.
- 48:26So some tools like this have sprung up to allow for sort of a side-by-side store of your data, but it's also tracked in Git, but not entirely stored in Git.
- 48:35So do you, Kate or Vishnu, or are you using this?
- 48:39I'm trying not to, but this is exactly the space that that company that went out of business at the beginning of the podcast, this is what they were playing in and trying to make like this happen.
- 48:49Interesting, okay.
- 48:49But yeah, I'll let Kate and Vishnu give their opinions on DVC.
- 48:54Yeah, it's also the kind of tool that you would have to categorize into your Gartner four quadrant.
- 49:00Yeah, yeah.
- 49:01Somehow.
- 49:01What I found, what's so interesting is that, I mean, just, and this is horrible to say, but it feels like people have so
- 49:09many other problems with getting their machine learning into production that this is almost
- 49:14like a secondary thing that comes afterwards, or they don't necessarily care as much about
- 49:21this because it is, it's like not mission critical.
- 49:24There's bigger, more significant problems, right?
- 49:26That are just like, we got to solve this for this even matter.
- 49:29That's not to say there's not a lot of people out there.
- 49:30I know there's a ton of people that use DVC.
- 49:32Their community is huge.
- 49:33It's a great tool.
- 49:35But I didn't think about that sometimes.
- 49:38Like, yeah, there's, there's mission critical things that are really top of mind.
- 49:43And everybody likes to talk about how reproducibility is very important for them.
- 49:47But unless you're in like banking and you need to because of the law, like it's not necessarily
- 49:54the, the most important thing for you.
- 49:56Sure.
- 49:57I would say in my experience, versioning and lineage and stuff tends to be the province of
- 50:01data engineering teams a lot more than it is machine learning engineers.
- 50:04And the way that we think about data in a machine learning context as sort of one-off artifacts
- 50:11that we need to associate with a particular experiment is not compatible with the way a lot of data
- 50:16engineering team think about data engineering teams think about their data sets as being sort
- 50:20of like a baked cake, you know, that is ready for consistent use going forward, right?
- 50:24To use that sort of cake, cake analogy that's common in data engineering.
- 50:28I personally, I use DVC.
- 50:30I think it's a well-created tool.
- 50:32It didn't exactly solve my problems.
- 50:35I'm a big believer.
- 50:35Like if you're a machine learning engineer and you're having data versioning problems, like
- 50:38go learn a little bit about data engineering and learn about data warehouses and databases
- 50:43and how you can leverage the existing tools in that field, rather than trying to use, you
- 50:47know, maybe something that might have been spun up for a very specific purpose or adopt a platform
- 50:52like a pachyderm that has, you know, an end-to-end approach to thinking about the entire
- 50:56machine learning pipeline that does data set versioning that helps you do your experiment
- 51:00tracking and helps you with, you know, sort of your deployment.
- 51:03That's kind of my approach to thinking about data set versioning as a component of the overall ML workflow.
- 51:08Yeah, we have similar, yeah.
- 51:10So we don't use any specific tools.
- 51:12We are going as many larger companies building our own set of tools, of course, based by people
- 51:20who might not ever touch machine learning in their whole lives with some other people who
- 51:25complain about how their files don't work.
- 51:27Trying to make everyone happy.
- 51:28But essentially, yeah, it's basically our data engineers trying to integrate some kind of
- 51:33extra metadata in our deployment tools so that we know that we can backtrack those specific
- 51:38training sets whatsoever to the models that we're training or deploying and so forth.
- 51:43So basically, it's, as Vishen said, in the realm of data engineers who are making things happen,
- 51:50they're the greatest people, all of them all.
- 51:53Two thoughts.
- 51:54One, before people get too tied up about trying to be perfect, like putting just your notebooks
- 52:00and your scripts into version control and straight to get is like 80%.
- 52:04It's got to be so much better than not doing anything.
- 52:08And then two, I'm fascinated by this comment, Kate, about like built by people who don't do
- 52:13machine learning for machine learning.
- 52:15Like, is that what, how's that sort of interaction?
- 52:17Is that challenging to cross that boundary or whatever to work with folks at companies like
- 52:23that that are not quite totally experienced at what you're building?
- 52:25I think it's funny for me because I come from consulting where we kind of closely work together
- 52:30with data engineers.
- 52:31And there was kind of always an overlap of your tasks.
- 52:33And now I'm coming to a larger organization where people's tasks are pretty well outlined and
- 52:38their responsibilities are more narrow.
- 52:41And sometimes people treat me like, I don't know, something between an alien and a dinosaur
- 52:45because they have never interacted with like a data scientist or machine learning person
- 52:50and ask me questions.
- 52:53Like, I don't know, I'm going to just tell them what's the meaning of life all of a sudden.
- 52:57We have this data, find the answers.
- 52:58And usually it's very basic stuff, but I think it's very important to have those people in
- 53:04the organization.
- 53:04Some people call them data strategists.
- 53:06Some people call them just fun people to talk to, like Demetrius, you know, who will bridge
- 53:11that gap and make sure that everybody's heard and translated to each other's language to just
- 53:17get that set of requirements and not build what data engineers want to build or build just what
- 53:23data scientists want to build and create that connection between the two.
- 53:26So that is important.
- 53:27Yeah, very cool.
- 53:28So let's move over to the operation side.
- 53:31Now, on the ops side, I guess the first thing I really want to think about is where do you
- 53:36run your code?
- 53:37Where do you run your models and APIs that back them and stuff?
- 53:40And I looked over around here and I see a lot of stuff about Kubernetes on the community for
- 53:48you all.
- 53:48And so Kubernetes, Linux virtual machines run in the cloud.
- 53:53Does that take too much to run it in terms of sort of compute costs?
- 53:57You would rather run it locally and you own servers.
- 53:58What are your thoughts on this?
- 54:00I mean, to me, it depends on how intensive your training efforts are and how many models
- 54:04you have in production, right?
- 54:06Setting up a Kubernetes cluster for one model seems to me like overkill.
- 54:10But, you know, for a company that has tens or hundreds of models in production, it might
- 54:15make a lot of sense, right, to try and set up some sort of distributed training architecture,
- 54:19et cetera.
- 54:19Especially if someone else is maintaining that cluster for you.
- 54:22Yeah.
- 54:22Yeah.
- 54:23Yeah.
- 54:24It's one thing to say, I want to have, I want to create and babysit a Kubernetes cluster versus
- 54:28I want to be able to give my job to Kubernetes.
- 54:30Yeah.
- 54:30It's not the same, right?
- 54:32Exactly.
- 54:32Yeah.
- 54:32Yeah.
- 54:33So I think it really depends on, you know, what scale you're at.
- 54:36That's kind of what we talk a lot about in the community and confused about what scale
- 54:40you're at or what maturity level you're at.
- 54:42I invite you, please join the Slack, the MLOps community Slack.
- 54:45And, you know, I'm sure people will be able to provide some very technical suggestions
- 54:49for your size.
- 54:49But I guess my answer to you is it depends.
- 54:51Okay.
- 54:52I would say I use the path of least resistance.
- 54:54So whatever is there, whatever is available, what is the easiest way to source your data?
- 54:59What is already, what are the connections that are already set up?
- 55:02Again, because sometimes you work with different teams or in consulting different companies.
- 55:07That's about it.
- 55:08And if I'm lucky enough, like right now to have a cluster that is babysitted by another
- 55:13person, well, good.
- 55:15Then it's a deal, you know, just take it.
- 55:18This runs on my machine.
- 55:19Exactly.
- 55:20We should like pour out some whiskey or whatever, some drink for lots of data scientists that
- 55:27have gone in to the Kubernetes world thinking they were going to pick it up and get their
- 55:32models out because they needed to.
- 55:34For some reason, they got brainwashed into thinking like, oh yeah, I should just learn Kubernetes
- 55:39real fast.
- 55:39And they never were able to come back.
- 55:42Yeah.
- 55:43And it's like such a huge detour, right?
- 55:46And so we talk about this a lot and that is like, what, first of all, what should the
- 55:51team composition look like as a machine learning like squad or team or someone trying to just
- 55:58get value out of it?
- 55:59And should a data scientist have to know Kubernetes?
- 56:02And so that's kind of like the joke here is like Kubernetes is a gateway drug.
- 56:07If you can get past it, if you can get into it, then you're probably going to go a lot
- 56:11deeper.
- 56:12But it's really hard to pick up, especially if you're coming from a data science background.
- 56:17Yeah.
- 56:17Yeah.
- 56:18It's a whole nother thing to learn.
- 56:19Yes.
- 56:20Right on, Kate.
- 56:21Exactly.
- 56:22Pamphal in the audience has an interesting comment that I would love to echo as well.
- 56:26Also, don't forget you're not Google, right?
- 56:28And you're not Facebook and you're not Instagram and you're not, you know, all these companies
- 56:33that are trying to run at such an insane scale, right?
- 56:36That they have to come up and use very interesting deployment in DevOps, whereas maybe just running
- 56:43on a server is fine.
- 56:44I don't know, you know?
- 56:44That's probably the most shared blog in the community is that you are not Google blog.
- 56:49Yeah.
- 56:50Yeah.
- 56:50That was a great article.
- 56:52It came out like a year and a half ago or something like that.
- 56:54He's a community member in our community, but also is very well known in the general ML
- 56:58community.
- 56:58Jacopo Talibue, who's the director of AI at CoView.
- 57:02He's been putting out a series of articles known as ML Ops at reasonable scale.
- 57:06And I think it talks a lot about this entire concept, which is like a lot of what the discussion
- 57:12is driven by about ML is about ML at unreasonable scale.
- 57:16It's the Googles and the Ubers that are doing hundreds of millions and billions of events.
- 57:21And for many of us, that's not the reality and what, you know, Mike just pulled up here.
- 57:24It's a great series that I encourage everyone to read who feels like, hey, that's not applicable
- 57:28to me.
- 57:28What is?
- 57:29This answers that.
- 57:30And we had him on for a podcast as well.
- 57:32Nice.
- 57:32Yeah.
- 57:32The subtitle here is ML Ops without too much ops.
- 57:35That's good.
- 57:37I like it.
- 57:38And it's the same idea.
- 57:39It sounds just very focused on machine learning rather than just broad software development.
- 57:43Do any of you all use like software as a service type places?
- 57:48I'm thinking of stuff like Streamlit, for example, like Streamlit Cloud and these types
- 57:53of things where kind of build your model and you're just like, here, go run.
- 57:56I mean, Heroku would be sort of the similar website equivalent of that.
- 58:00So we do use Streamlit, but we don't use the cloud.
- 58:03We use it just as an interface.
- 58:05Right.
- 58:06You can self-host it yourself.
- 58:08We host it ourselves because then authentication, everything else is kind of linked to it.
- 58:13And then we forget just a nice interface.
- 58:16Yeah.
- 58:16What are your thoughts on Streamlit?
- 58:17It's awesome.
- 58:18Yeah.
- 58:18I haven't had to use it for anything, but my experience is that like it's the amount of
- 58:23code that you have to write to create these really interactive dashboards.
- 58:27It's super short.
- 58:28Yeah.
- 58:28And I mean, the alternative usually in the organization is that, oh, we have this Tableau
- 58:32dashboard.
- 58:33Right.
- 58:33And that requires licenses and training for people.
- 58:37And again, it has its own limitations at some points with certain amount of data, it just
- 58:43starts crashing.
- 58:43And this is an easy way to, for machine learning professionals to showcase whatever they're working
- 58:50on in a way.
- 58:51And it's been a lifesaver for us.
- 58:53Sometimes people just don't get what the hell you're talking about.
- 58:56So we were working on an NLP tool that would analyze a lot of unstructured text in a lot of
- 59:02different ways.
- 59:03And we just plugged all the possible ways to visualize that result.
- 59:07And it just clicked for people.
- 59:09And then you had a nice little video next to it.
- 59:11You know, it's just so flexible.
- 59:12It's really cool.
- 59:13Yeah.
- 59:14The nice part is it's not just a static notebook output, right?
- 59:17You can sort of play with the dropdowns, click in the places, and it becomes a live
- 59:21little interactive thing without you having to learn some sort of front-end programming
- 59:25framework like Vue.js or something.
- 59:26Yeah, exactly.
- 59:27And also, on the other hand, we had developed this package to do the analysis.
- 59:31But this gives a no-code interface for people to completely just do it by themselves.
- 59:36And they feel really cool about interfacing with machine learning without having that background,
- 59:41without having to learn.
- 59:43That's cool.
- 59:43Think of it as like a hybrid, right?
- 59:45Like, build the real software development bit and then expose it to things like Streamlight.
- 59:50Yeah.
- 59:51Cool.
- 59:51Vishnu, what are your thoughts?
- 59:52No, I agree with everything Kate said.
- 59:54I think it's...
- 59:55Remember when it came out?
- 59:56It came out with a lot of great examples.
- 59:58And it came out with a lot of...
- 1:00:00You know, at the time, it was still TensorFlow 1.0.
- 1:00:04Two hadn't come out.
- 1:00:05And it was really, really hard to work with machine learning models.
- 1:00:08You know, it was like, you know, you had these, like, you know, these underlying graphs that
- 1:00:12you had to kind of struggle with.
- 1:00:13And people spent so much time just wrangling, like, how do I get an output for this model
- 1:00:19training exercise?
- 1:00:20But to have this, like, really neatly written package that would just take that as a backend
- 1:00:24and then let me make, you know, interactive visualizations felt like magic.
- 1:00:28You know, all great tools feel like magic.
- 1:00:29And I think that's what Streamlit did well.
- 1:00:31As Kate said, like, it allows, you know, non-technical users to interact with outputs of
- 1:00:35models very naturally, which I think is a really important part of connecting some of
- 1:00:39those technical to business value.
- 1:00:41There's a whole set of tools like Streamlit that have since come out, you know, that are
- 1:00:44making various parts of the sort of machine learning workflow or the operations workflow
- 1:00:48a lot easier, you know, whether it's sort of, you know, letting you set up APIs on top
- 1:00:53of those models or visualization or all kinds of other sort of aspects.
- 1:00:58So starting a revolution.
- 1:00:59Yeah, absolutely.
- 1:01:00You know, for me, the magic is you write a function that looks like it just takes arguments
- 1:01:04and you don't have to deal with callbacks and interactive stuff.
- 1:01:07And it just kind of adds that into there.
- 1:01:10What are some of the other tools like this that people might be using out there to get
- 1:01:14their ML models online?
- 1:01:15FastAPI right now is really popular as like a way of, you know, serving your model.
- 1:01:19FastAPI?
- 1:01:20Not fast AI, right?
- 1:01:21Yeah, FastAPI.
- 1:01:22Yeah.
- 1:01:22Yeah, absolutely.
- 1:01:23Yeah.
- 1:01:24FastAPI is really popular.
- 1:01:25There's a new tool I heard of called Banana, which also does this.
- 1:01:28Banana.dev.
- 1:01:29Banana.
- 1:01:30Okay.
- 1:01:30Yeah.
- 1:01:30I mean, I think they're still early on.
- 1:01:33I'm struggling to remember off the top of my head right now, but just in general, this
- 1:01:37paradigm of saying like, hey, if I can like write a neat sort of like modern Python library
- 1:01:43where I can write, as you said, a function with a couple arguments and then do things that
- 1:01:48are associated with the machine learning workflow.
- 1:01:50That's a model that works.
- 1:01:51So like Great Expectations kind of does that with data testing.
- 1:01:53Right, right, right.
- 1:01:54You know, it kind of works like pytest for data.
- 1:01:56And so I think what we're trying to do overall, the big picture is bring, you know, very Pythonic
- 1:02:02ways of working with code into the realm of data and machine learning models to the extent
- 1:02:07that makes sense.
- 1:02:08Yeah.
- 1:02:08Banana.
- 1:02:09Banana.dev is totally new to me.
- 1:02:13Interesting.
- 1:02:13ML model hosting as an API.
- 1:02:16Instantly, instant scalable interface hosting, inference hosting for your machine learning
- 1:02:21models on serverless GPUs.
- 1:02:23There's a lot of, a lot of words there that mean interesting stuff about running and production.
- 1:02:27Kate, are you familiar with Banana or do you have other tools like this you think are neat?
- 1:02:30No, I cannot name anything on top of my head.
- 1:02:32Just like, you know, I always blank out the question.
- 1:02:35I'm like, what's the main thing?
- 1:02:36I have no idea.
- 1:02:37Google's the most amazing thing that ever happened, I think, to data scientists.
- 1:02:43Apart from like the original notebooks, because it's just like, it's right there with all your
- 1:02:47random files in the drive.
- 1:02:49You can just hook it up, test something quickly.
- 1:02:51So, but that's not related to this.
- 1:02:53What roles do places like Google CoLab and these other hosted notebook places serve in the
- 1:03:00production side?
- 1:03:01Like, I clearly see the value when I'm doing like some development and prototyping and trying
- 1:03:06to figure stuff out.
- 1:03:07But would you ever try to make that the final version in production?
- 1:03:11I'm not sure how it interacts with GCP production.
- 1:03:15So I tried it for my pet projects.
- 1:03:17It was very fun because I had to transcribe some random lectures and I decided, hmm, what
- 1:03:24if Google can do that for me?
- 1:03:25And I literally had it all in my drive and ran some code in CoLab, linked it to GCP and it
- 1:03:31gave me all the results.
- 1:03:32So that was like pretty neat because I really didn't have to do any kind of configuration,
- 1:03:37any kind of thought into it.
- 1:03:39So for pet projects, that was amazing.
- 1:03:41For production, Databricks cell books kind of work.
- 1:03:45Well, again, especially if you're in Azure, I'm not sure how it interacts with other, if
- 1:03:51it's as convenient.
- 1:03:52But with Azure cloud, it was, it was just amazing.
- 1:03:55It was like literally as soon as you have your credentials figured out, everything works in
- 1:04:00the background, you just do it as you would do it in a normal notebook and you can put
- 1:04:05it in prod, no problem.
- 1:04:06Yeah.
- 1:04:06Fantastic.
- 1:04:07That's a good recommendation.
- 1:04:07All right.
- 1:04:08I think we are just out of time.
- 1:04:10So I want to let you all get back to things before you got to run.
- 1:04:14But Kate, Vishnu, thank you for being here.
- 1:04:17Demetrius had to run off, but thank you to him as well.
- 1:04:19Final thoughts.
- 1:04:21Maybe people want to get started with the ML Ops community and maybe get their models in
- 1:04:26production.
- 1:04:26Give us your final thoughts.
- 1:04:28Kate, you want to start?
- 1:04:29I think the best way, if you're, if you're really just starting out, go and meet people
- 1:04:32in person and the ML Ops community or any other community that is available in your area
- 1:04:38will give you the right boost of motivation and also knowledge and just create a support
- 1:04:43network for you to be able to get through the blocks that you will definitely have on your
- 1:04:49path.
- 1:04:49So that would be my word of advice.
- 1:04:51Don't stay alone, isolated.
- 1:04:53Yeah, for sure.
- 1:04:54Vishnu?
- 1:04:55I think that's a great tip, Kate.
- 1:04:56I mean, to anybody starting out in ML Ops, I would say certainly join the community and
- 1:05:02search the answers to that question because it's been asked before in the Slack community.
- 1:05:06And there are a lot of great answers.
- 1:05:07I would also say like, you know, check out some established resources.
- 1:05:10Like I think a guy named Goku Mohandas has been like, you know, putting together a website.
- 1:05:15Made with ML.
- 1:05:16Made with ML is a great resource.
- 1:05:17Chip Huyan's Stanford class on machine learning systems design.
- 1:05:22Eugene Yan, you know, our Slack community.
- 1:05:24These are places that you can just pick up, you know, years worth of knowledge very quickly.
- 1:05:28It's organized for you.
- 1:05:29It's structured for you.
- 1:05:30So definitely make use of those existing resources.
- 1:05:32Thank you for being here.
- 1:05:33It's been really great to hear your experience and thoughts.
- 1:05:36Thanks for having me.
- 1:05:37Thanks for coming by.
- 1:05:37Thanks for having me too.
- 1:05:38My pleasure.
- 1:05:39This has been another episode of Talk Python To Me.
- 1:05:43Thank you to our sponsors.
- 1:05:45Be sure to check out what they're offering.
- 1:05:46It really helps support the show.
- 1:05:48Take some stress out of your life.
- 1:05:50Get notified immediately about errors and performance issues in your web or mobile applications with
- 1:05:55Sentry.
- 1:05:55Just visit talkpython.fm/sentry and get started for free.
- 1:06:00And be sure to use the promo code talkpython, all one word.
- 1:06:04For over a dozen years, the Stack Overflow podcast has been exploring what it means to be a developer
- 1:06:09and how the art and practice of software programming is changing the world.
- 1:06:13Join them on that adventure at talkpython.fm/Stack Overflow.
- 1:06:17Want to level up your Python?
- 1:06:19We have one of the largest catalogs of Python video courses over at Talk Python.
- 1:06:23Our content ranges from true beginners to deeply advanced topics like memory and async.
- 1:06:28And best of all, there's not a subscription in sight.
- 1:06:31Check it out for yourself at training.talkpython.fm.
- 1:06:34Be sure to subscribe to the show.
- 1:06:36Open your favorite podcast app and search for Python.
- 1:06:39We should be right at the top.
- 1:06:40You can also find the iTunes feed at /itunes, the Google Play feed at /play,
- 1:06:45and the direct RSS feed at /rss on talkpython.fm.
- 1:06:49We're live streaming most of our recordings these days.
- 1:06:53If you want to be part of the show and have your comments featured on the air,
- 1:06:56be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
- 1:07:01This is your host, Michael Kennedy.
- 1:07:03Thanks so much for listening.
- 1:07:04I really appreciate it.
- 1:07:05Now get out there and write some Python code.
- 1:07:07Bye.
- 1:07:07Bye.
- 1:07:08Bye.
- 1:07:08Thank you.