Latest / Agentic Conversations (formally mlops.community) / Clean Code for Data Scientists // Matt Sharp // # 160
Transcript
- 0:01I am not sharp. I work at Shopify.
- 0:04I'm a day to developer there. I'm very generic title but
- 0:08essentially, machine learning engineer and I don't drink
- 0:12coffee or tea, so I'm water guy for sure.
- 0:17Welcome back to the ml. Ops Community podcast, I am your
- 0:21host Demetrios and I am here with one of the best in the
- 0:25business. A be.
- 0:26How's it going? A be great, there's a lot
- 0:29happening. Ain't like the tech world too
- 0:32many changes to many fruit Prince way too many
- 0:34announcements are, we had a wonderful conversation with
- 0:37Matt. Matt is a chemical engineer
- 0:40turned. A scientist turned the engineer,
- 0:42and right now he's leading, D top at Shopify.
- 0:47So, I ate think, I'll let dimitrios take on what were your
- 0:50favorite Parts Demetrius in the conversation?
- 0:54For those who don't know, Matt also is a bit of a LinkedIn
- 0:57influencer because of all of the Relations and post that he has
- 1:02up around clean code for data scientists T refers to himself
- 1:07as a recovering data scientist. And we got into that in this
- 1:11conversation, we also talked a little bit about the platform
- 1:15that Shopify created Merlin and the blog post that they wrote
- 1:19about it and how they're able to enable if there is a little bit
- 1:23of a tongue twister for you, the real-time recommender systems
- 1:28and the inbox Education and also, fraud detection, all that
- 1:33good stuff that you hear about for real-time use cases.
- 1:37They break down exactly how they're doing it.
- 1:39And also, I think the biggest takeaway for me on Merlin and
- 1:43the whole real time serving platform that they created was
- 1:47the ability to quickly iterate and get up and running with a
- 1:51Sandbox and then if you prove out some value, you can go and
- 1:56run with it. That was my takeaway.
- 1:58What about yours? Sofia me.
- 2:00I think I loved his advice on. What does clean code main for
- 2:05their scientists? I thought he had a hot take
- 2:08about those posts that blow up on LinkedIn and Twitter.
- 2:13Like, I've been a data scientist or a software engineer for x
- 2:16amount of years and I still Google how to do the most basic
- 2:19things in Python and his response to that was hilarious.
- 2:23It was like if you've been a data scientist for 12 years and
- 2:26you're still figuring out the basic building blocks of Vaughn
- 2:30and you have to Google that. You're not good at your job.
- 2:33So let's just be very candid about that and I thought that
- 2:36was a funny hot take that is a little bit contrarian to the
- 2:42things that we see and hear on social media.
- 2:45So, overall, I think the conversation was a good
- 2:47combination of talking about clean coding, coding practices
- 2:51for ideas like this and then we move to real-time streaming
- 2:55talking about World Landing. Then finally, to Ellen's in
- 2:57production in some of his work on Topic in some physical pain.
- 3:01And so, overall, there's something for everybody, he is
- 3:05coming out with a book to on lme's in production.
- 3:08I think that is actually the title of the book and it should
- 3:11be out soon. We, if it is out already, we
- 3:15will leave a link in the description if it's not out we
- 3:17will hopefully leave a link to the Early Bird version of it so
- 3:23that you can check it out. And without further Ado, I think
- 3:26it's time to get into this conversation if you like and
- 3:30Enjoy this podcast. It means the world to us if you
- 3:32just share it with one friend, one friend, that's all we ask.
- 3:35Because that is the way that we're going to spread the good
- 3:39word of ml Ops or as some people are calling it.
- 3:45These days L LM Ops or as other people are calling it.
- 3:50These days LMS in production, and We've been having all kinds
- 3:57of lme's in production conferences happening and I
- 4:01think by the time this bad boy comes out, we are going to
- 4:05either be gearing up for the LM in production conference, which
- 4:09you can find a link to in the description below or we're going
- 4:11to just have had it. Which you also can find a link
- 4:14to all the replays in the description below.
- 4:15So, depending on where you are at in time, when you listen to
- 4:19this, you can click on the link below and get everything about
- 4:24lme's in production. Your heart's desire.
- 4:27That's it for now, let's jump into the conversation with Matt.
- 4:37to start it off. Do you have a really big wall in
- 4:42front of you that you watch? You have a projector behind you
- 4:45and I'm guessing that it's your like home movie theater that you
- 4:48project onto a wall. It is, I knew it.
- 4:51Yes. So we Have this on the second
- 4:54floor across the living room. There's just this empty canvas
- 4:58and so yeah, we'll have home videos and stuff up there, so
- 5:02it's pretty nice. It looks so cool.
- 5:05Yeah. Well done, well done.
- 5:06All right, not great to have you here, I have been a fan for a
- 5:11while. You've been preaching the good
- 5:13word on LinkedIn about clean code for data scientists.
- 5:17I think it struck a nerve because occasionally, I'll see
- 5:21one of your post pop up with Thousands of likes and Views and
- 5:25all of that good stuff. So you are a bit of an
- 5:28influencer these days and I think there's a reason for that.
- 5:32Lots of people have either been a data scientist or work with
- 5:36data scientists that may or may not know the fundamentals.
- 5:41And so it's very important to get it, right?
- 5:47And you are trying to raise awareness about this.
- 5:53What brought you into this space?
- 5:55Like why did you decide that you were going to be the one to
- 5:58start talking about this? Huh.
- 6:01Well I guess I mean to start off like I used to be a data
- 6:04scientist myself, like I get it like when you're a data
- 6:08scientist, I was just like so many things to learn, you know,
- 6:12like statistics heavy just like analyzing data and just being
- 6:17able to answer stakeholders questions and answer the
- 6:19business values and all of these things that Oftentimes actual
- 6:24code portion is often seen as like well I got it working like,
- 6:30you know, that's fine. But like at least when I was at
- 6:33a descent there was so many errors and waste of time because
- 6:36like I had to go and fix some Thug or do other things.
- 6:40And like the when I was at there was there was no one around me
- 6:44who knew coding, you know? So like it was mostly just me
- 6:47and, you know, some other data scientist, you know, trying to
- 6:50hack things together. And so, And then like, you know,
- 6:55I got to a tech shop and like it's completely different,
- 6:58right? So like had a Shopify, for
- 7:03example, like when do you think they start expecting like a data
- 7:10scientist to start writing clean code?
- 7:13You know, and like the answer is like immediately, right?
- 7:17Like if you go in and you look at like our documents of saying,
- 7:21okay. Hey like Like you're a senior
- 7:23engineer. Like these are the requirements
- 7:25for your job, like, like, clean code is actually an Insight, you
- 7:29know, like being able to write clean code inside of our
- 7:32requirements and it starts as an intern, right?
- 7:36Like because, you know, like when you come in as an intern,
- 7:41they don't necessarily expect you to be able to solve problems
- 7:44but they do expect you to write clean code.
- 7:46So like it's very much, a fundamental problem that needs
- 7:51to be there right at the beginning.
- 7:53And I don't think a lot of data scientist like realize that one
- 7:56very quick question because I want to clarify this for
- 8:00listeners. There's a lot of conversation
- 8:02about writing clean could but what does that mean for you?
- 8:05Does that mean the use of functions or writing modular
- 8:09code? Does that mean fighting unit
- 8:11tests and integration tests while writing the code which or
- 8:16does it mean structuring all of those things?
- 8:18What are your top tips for? When you say, okay, this passes
- 8:22my Mark for clean code. So I clean code to me, like the
- 8:30definition, how easy it is to understand.
- 8:34And so, so the best way for you to gauge it is if you write code
- 8:39and you come back, six months from now.
- 8:41When you completely forgot about what you were working on, can
- 8:45you get caught up within a couple of seconds or minutes?
- 8:50Can someone else come in and read your code and understand
- 8:53it? Write Clean code is all about
- 8:55the communication. An aspect.
- 8:57It's very much a technical skill but it's who a lot more of the
- 9:03soft skill because the whole point of clean code is making
- 9:08sure that you can collaborate with other with other people,
- 9:13you know? So like, because you don't work
- 9:17in a vacuum, right? You like, you need to be able to
- 9:19communicate with analysts and other data scientists about the
- 9:21statistics and about how you're working with the code.
- 9:25And then you also need to To be able to go in.
- 9:29And hopefully, you're going to be working with data engineers
- 9:32and no engineers and other people.
- 9:35And they need to be able to talk.
- 9:37And then, like the code is really the communication piece
- 9:41of how this all works down in. So, like, when code is clean,
- 9:44it's communicate about. And how do you define clearly
- 9:48communicable code? Does that mean it's a Well
- 9:51commented or does that mean? You know you are using the right
- 9:55variables? Shows that the functioning is
- 9:59done in a way that makes sense. Instead of using very random
- 10:03variables, to be able to store things.
- 10:06How do you define or what are your three top things that you
- 10:09would say, are important for that?
- 10:11So, naming variables is definitely probably the largest
- 10:15aspect of writing clean code just because if the variables
- 10:19are well, written and well-defined like you just, you
- 10:25know, like Furious Is a model called cars rights just like,
- 10:29well, what could be in there and it gets I think a dataset that I
- 10:34often point to is I'm so I can my old company, we had a table
- 10:38called locations and like locations sounds like a great
- 10:43name. But you know like what does it
- 10:47mean, right? It can mean it.
- 10:50Because like we had locations for like Merchant addresses and
- 10:54then we also had online locations, which It's websites
- 10:57and just like it got really confusing.
- 11:00And the problem lies is that this locations table, like
- 11:03people put it up and it was actually zip codes and we never
- 11:07used it. And so like, but it was up there
- 11:10and I got integrated into a bunch of different things.
- 11:12And so like no one wanted to touch it and remove it and clean
- 11:16things up. But everyone would always try
- 11:17to, you know, merge onto that table and like, get their
- 11:21location data. And they thought the result
- 11:23Groove. And they would be like, wait,
- 11:25why isn't this working? Working, you know, what is my
- 11:27data analysis is not working? And it's just like, well, it's
- 11:31because you're using the locations table which, you know,
- 11:34isn't our locations? You locations aren't location,
- 11:38right? Like like you want, you know,
- 11:41Russian dress it, right? And so but like so a good name
- 11:44is both like I'm very like particular but it's also broad
- 11:49enough to include all the use cases of what you're trying to
- 11:51do and and kind of understanding that and getting a hang of good
- 11:56names. It is obviously really
- 11:57important. I think there's a common joke
- 12:00where it's just like there are, you know, the two hardest things
- 12:06and programming are naming cache invalidation and off by one
- 12:10errors. Not like because she's so yeah.
- 12:14So naming is definitely hard but I think oftentimes when you talk
- 12:18with data scientist so is that like they don't most of them
- 12:22don't necessarily come from acute, computer science,
- 12:25background, and so forth. A lot of the tips I give often
- 12:29involve just like how do you structure a project?
- 12:33So that way you can find the files, you need to know like how
- 12:36do you You know and because of that comes down to the
- 12:41communication, right? Because like if I'm given a
- 12:43project, a Ruby on Rails project like Ruby on Rails has its
- 12:47awesome structure where like you know you had scaffolding and so
- 12:50every project is exactly the same.
- 12:52It's really easy to find, okay? Here's where the JavaScript here
- 12:55is where the controllers are here's views are, it's really
- 12:59easy to go in and dig into them because they're all the same.
- 13:01But like, I like data science projects often don't have that
- 13:05type of scaffolding or other things like that.
- 13:07It's like, it's really The fine even like basic things and like
- 13:11where are the test. So like I do they even have
- 13:13Tesla. Okay.
- 13:14Now like this is a data science project.
- 13:15I forgot, you know, it's just like you know.
- 13:18And then like they have you know and just like a lot of the
- 13:23problems often stem from like you know, data scientists are
- 13:27always using jupyter notebooks, right?
- 13:30And but like they haven't learned the computer science
- 13:33aspects so they don't know how to like manage those and they
- 13:36often get a lots of different naming and And so, just like
- 13:39figuring out the best. And so a lot of my tips often go
- 13:43into that, I would like, okay. Like this is how you get the
- 13:47belt most out of your jupyter notebook.
- 13:49This is how you can communicate, more and others in subsets,
- 13:52dude, I love it. I mean, coming out hard on the
- 13:57data science projects and you went there.
- 14:00So I'm going to follow your lead and ask about jupyter, notebooks
- 14:05and things that you found because I actually We enjoy
- 14:09finding out about other people's processes when it comes to
- 14:13taking jupyter notebooks and all of the power that they present,
- 14:19in their phases of the machine learning lifecycle.
- 14:25But then, what do you do? Once you've reached the end of
- 14:29their life cycle and how do you get out of them as quickly as
- 14:32possible? And what do you recommend to the
- 14:34data scientist, then? If ever because some people I
- 14:38know, don't like to get out of them.
- 14:45You know, I've spent enough time in jupyter notebooks, I'm really
- 14:47not a fan, you know, everything from managing their kernels to
- 14:53like just you know, like the tricks you can play.
- 14:59This was actually I don't know if it's April Fool's but I was
- 15:03just like, hey, like this is a prank, I played where, you know,
- 15:06you go in, you can run some code and then you delete that cell
- 15:10and like no one's ever going to be able to understand why I like
- 15:13their jupyter notebook. Worksite.
- 15:15And you know doesn't work anymore just because you like,
- 15:18redefined, you know, something Imports, or things like that.
- 15:21And so generally how I like to use jupyter notebook though, is
- 15:26because like they are powerful, like you can iterate really
- 15:30quickly, you can go through And you can get things, you know,
- 15:34look at your data easier look, you know, that they are really
- 15:38powerful but so I like to use them.
- 15:41And I think this is really useful is essentially like I
- 15:46think people make their cells too small.
- 15:50You know, the they're often you know, you often want to make
- 15:53them do one thing but like I said, I wasn't a function like
- 15:57there's no restriction for to doing one thing.
- 15:59But so when I like to do is Like to think about cells, as I was
- 16:04like, if I was to put this into like a scripting project and
- 16:08inside of just pure python files, like a cell, would be a
- 16:12single file, you know, with with its separate Imports and doing
- 16:16its own specific thing. Usually like defining a class or
- 16:20more defining a group of functions that I can then like
- 16:24import into other other cells. And so, what makes this strategy
- 16:29powerful is generally like By the time you're, you know, each
- 16:34cell is encapsulated and you can be ensure that each cell will be
- 16:38able to run on its own. The the next powerful thing
- 16:42about doing this is that when it comes time to like communicating
- 16:46or maybe moving it into a more foundational, you know, python
- 16:50script or Library like it's just a matter of taking each cell and
- 16:54copying it into like script file and then you know, just making
- 16:59sure you adjust you know the Imports to The other things you
- 17:02need. And so, I find that strategy
- 17:07really powerful as far as transitioning between a jupyter
- 17:12notebook and an actual project as well as just like making sure
- 17:16things are clear and things always run think work.
- 17:20Well, I think this is a really interesting nerve that you're
- 17:23hitting which comes down to this difference between doing just an
- 17:27exploratory project where you're just exploring the detailed of
- 17:31at the Level trying to understand make sense, or if it
- 17:34worse, is when you're writing code for production leveling,
- 17:37why you can do it in anything, you can write it in a jupyter
- 17:41notebook, or you can choose to write the python code from the
- 17:44get-go, but I don't think that distinction is usually mentioned
- 17:50clearly which is, you know, there's no problem with using
- 17:53any tool. The problem is how you write at
- 17:57different stages of using that to so, while right?
- 18:02Lighting model code is a living more important.
- 18:04When you're writing production level code, do you think it's
- 18:08equally important when you're doing exploration as well as
- 18:11would you think now the cell code is?
- 18:13Okay, we can keep using the d, f da shape and just run that while
- 18:18we're doing exploration and maybe once we are writing the
- 18:21production level code at that, that doesn't really fly.
- 18:27You know I talk about this a lot I think clean code should be
- 18:30right at the very beginning, no matter what you're doing because
- 18:34exploratory data analysis, like the workflow, I see data analyst
- 18:39do all the time is. Ok I have a new exploratory data
- 18:43analysis, I create a new jupyter notebook and then the first
- 18:47thing they do is they go find their last analysis and they
- 18:50start copying the code over, right?
- 18:51Like, oh, I don't want to redo this again, right.
- 18:54And but like, That first code, they wrote being like, oh, this
- 18:58is just a quick script and it's really bad and then they go and
- 19:01they copy it over and then they're like trying to, you
- 19:03know, run it. And then like oh no I made a
- 19:05mistake and now they go and you know, they make fixes and then
- 19:09they make edits and like, you know, just like no, like just
- 19:13just go and then this is actually something I recommend
- 19:16is like, have a jupyter notebook.
- 19:19That is like four notes like actual notes, right?
- 19:23Like you're gonna go and and you're gonna Copy and paste.
- 19:26Okay, this function was really useful copy and paste it over
- 19:29give notes about what it does and like clean it up, you know,
- 19:33and then like when you go and you are going to copy code,
- 19:37you're first going to look at that notebook, that has all your
- 19:39clean code, you know, it's going to have all that all your
- 19:42reference stuff in it and and that's going to just and then
- 19:45you're copying over and things are just going to go a lot
- 19:48smoother when it comes to a quick analysis, right?
- 19:51Because like no quick analysis is ever like quick.
- 19:55Yeah, you know, and so like and so like it's almost more
- 19:59important to make sure your code is cleaned when it's when it's
- 20:03quick and when it's supposed to be exploratory data analysis
- 20:05because like one of the things software Engineers have learned
- 20:10is like you're, you know, when you're writing code like you
- 20:13yourself are reading in about 10 times more than your writing,
- 20:17you know, you're scanning up. You're looking up.
- 20:19Oh what did I set this out? Okay.
- 20:21What is this variable? And so like you know, every code
- 20:25is Read way more than it's ever written.
- 20:27And so like that is the heart of why, clean code, it's good and
- 20:30like clean code is way more valuable for you, right?
- 20:34Like it's future, you whether or not that future you earlier, I
- 20:38said, six months but like you will find Value five minutes
- 20:41from now. All right, like when you're
- 20:42coding and you're just looking back every like, oh well, what
- 20:46did I do up here? You know, what did I name that
- 20:48variable? You know, and so good.
- 20:50Clean code is useful and and this is often like When the
- 20:55values of actually working in an IDE versus, you know, just a
- 20:59general, jupyter notebook is IDs, come with all of the
- 21:02helpful, you know, code completion tips and other things
- 21:05like that. And so like I often encourage
- 21:08data scientist. Hey, go open up an IV, like,
- 21:11it's fine if you use, jupyter notebooks, and he loved that.
- 21:13But like, open it up and realize what tools and like, what things
- 21:17are there and ready for you out of the box, because it will
- 21:20definitely change your life. Yeah, it's so interesting that
- 21:23you point that out like the foundation and how just us as
- 21:27humans were so in a hurry all the time to get to the next
- 21:32thing or try and figure something out that we do these
- 21:35quick hacks and then we just start throwing something on top
- 21:38of these quick hacks and that foundational level is so flimsy
- 21:43that it can end up coming back and bite you in the ass real
- 21:47quick. And so I want to ask one more
- 21:52thing before we move on to the actually, So one of my most
- 22:00popular post on LinkedIn was about streaming data and
- 22:03real-time, and that seems to blow up.
- 22:07I want to ask you before we jump to the next one.
- 22:10What has been your most popular post on LinkedIn?
- 22:13This far. I imagine it's around something
- 22:17clean code. So, this is interesting, so, I
- 22:22think, my most popular post ever was taken down because it was
- 22:27too controversial and taken down by who you or LinkedIn dialing
- 22:33tone. Oh yeah, about clean cook about
- 22:36data scientists, some data science at LinkedIn got picked.
- 22:41So it was yes, yes. So it was it was, it was a very
- 22:45simple, very, very simple. All it was I was and I'm known
- 22:51to be a little controversial sometimes, but all the post
- 22:55said, was clean code is greater than clean data.
- 23:00And it kind of blew up and like, a lot of people were really
- 23:07angry with us. But like my, my, my basic, you
- 23:13know, thought process around this is just like clean data
- 23:16comes from clean coat, like all data, like ultimately comes from
- 23:21code. Like, you know, when you know,
- 23:23whether or not, you know, you're taking a video, you know,
- 23:26digital camera, like, all of that is, you know, code working
- 23:29on under the hood, to get the data and that you're putting
- 23:32into a database and data pipelines, and you're doing all
- 23:35these things. And so like, I was just this
- 23:37point or, you know, like they say like, you know, 80% of the
- 23:41data scientist job is like cleaning data and like everyone
- 23:46was always saying, hey, data is so so important.
- 23:49You have to have to clean it garbage in garbage out.
- 23:53And, you know, it's something that data scientists very
- 23:55understand very well, because when their data is bad, like it
- 23:58just ruins their day. And how that makes analysis way
- 24:01harder and makes training models really harder.
- 24:04You know, I'm but like they don't want clean code because
- 24:08that's work that is on them to do, but it's just like, but if
- 24:11they had clean code, their data would be cleaner, right?
- 24:15And like, this is something, you know, with things like what,
- 24:19Chad sanderson's pushing out with, you know, models and n
- 24:23apis and just, you know, having data contracts and things like
- 24:27that is just like, yeah. Like if you just had clean code
- 24:30and data contracts, and these other simple principles, like
- 24:33you're going to have clean data. Like it's just, it's gonna be a
- 24:37result of it. And so, anyway, so so yeah, it
- 24:40was just a very simple post, you know, clean code is more
- 24:45important than clean data and it just blew up and I think some
- 24:48people got mad and they took it down because of that.
- 24:50Like, but yeah, so that's so wild.
- 24:54That's I wonder if they took it down because of the comments
- 24:58potentially like being So you can LinkedIn doesn't want that
- 25:01to be the experience that people have on LinkedIn or if it was
- 25:05just some engineer at LinkedIn was like, fuck this and prints
- 25:09they went and went behind the scenes and were like delete
- 25:12post. Yeah, I don't, I don't know.
- 25:15It was up for a good while and like people even took
- 25:20screenshots of it so like I know it existed but like I can't find
- 25:23it anymore and I even had like a direct link to it and wow, that
- 25:27just returns a 44. So, I've been thinking about
- 25:32like re-exploring reposting it just because it's been taken
- 25:34down. I the cult like this was way
- 25:37back when when I was first, posting about clean code, like
- 25:42it would really upset a lot of data scientists and like no one
- 25:46thought it was important. But nowadays, like all
- 25:49influencers have found their like, oh, if I post some like,
- 25:52hey, like here's some good sequel, cleaning tips or like
- 25:55here's some good code to like the content does really well.
- 25:59Now, I see a lot of em. And so like I'm really glad that
- 26:02the community has changed and realize like for, you know, hey
- 26:06clean code is actually important for the better but like yeah,
- 26:08when I first started talking about clean code like the only
- 26:11people who I could satisfy was like you know old hardened you
- 26:16know software Engineers. Like yeah this is your finally
- 26:20saying what? I post a lot of hate crimes but,
- 26:22you know. Yeah.
- 26:24I would often have like some head of data science or some VP
- 26:28of data science or something. Like that.
- 26:30So, it doesn't matter. He just need to get it working
- 26:33but I don't see that as often. So, Wow.
- 26:39Wow, it's incredible. So, let's take a moment and
- 26:44recognize that this episode is brought to you.
- 26:46By --zl is soul is cloud is a purpose-built cloud, native
- 26:51Vector database that stores indexes and searches for
- 26:54billions of in Bedding, vectors to power enterprise-grade
- 26:59similarity, search recommendation, systems, llm
- 27:03apps and more. It's built on the popular
- 27:06open-source. Database Mill vez, which if you
- 27:09have not tried out, go check that out too.
- 27:12It's incredible but easier than Novus to get started with is Liz
- 27:16Cloud. It allows for easy integration
- 27:19with open a Ico here. Hugging face, Lang chain Lama
- 27:23index and more. It's makes it very simple for
- 27:26developers to get started. Building AI applications.
- 27:30That scale from the get-go. Try the new free tier adds a
- 27:34list.com. Cloud will leave a link.
- 27:37In the description. And now let's get back into this
- 27:42episode. I think now that people have
- 27:46moved from that stage of your people were like, can we
- 27:50actually derive value our if you know, building a machine
- 27:53learning or like a data science team?
- 27:55I think everybody has sort of moved where they have enough
- 27:59maturity to know. Yes, you can derive value, but
- 28:02you're not going to be able to drive value or if like bad
- 28:06practices or bad software. Engineering practices
- 28:09specifically speaking because you have to be able to write
- 28:12code that passes the level of at least some best practices on
- 28:17production that was software engineering.
- 28:20Yeah, I think this I guess just one more thing before we move on
- 28:24I just like like code is where the rubber meets the road for a
- 28:29data scientist and it's important to realize.
- 28:32I like a lot of data scientists think their job is reading white
- 28:36papers all day and now I'm like are you know like maybe at the
- 28:41end result is writing a right white paper like that is the you
- 28:45know Glory like that is, their job is to write white papers but
- 28:49But ultimately, no is like, it's the right code right there.
- 28:54They are programmers. Write like, ultimately, you
- 28:58know, like if they wanted manipulate data, if they're want
- 29:00to write machine learning models.
- 29:01If they want to do any research on data, like it involves
- 29:04writing code and that is where the rubber hits the road and
- 29:08like that. You know, it's just so important
- 29:10to harness their craft and and realize like, hey, yeah, you are
- 29:14a programmer, you're a very specialized programmer, that
- 29:17does a lot of statistics and does a lot of research.
- 29:19But Like your hand out. Like like that is, your craft is
- 29:25writing code, it's not reading and writing white papers because
- 29:28or whatever else, you may think it is, you know, talking and
- 29:32meetings about statistics notes. Like ultimately like you're like
- 29:37you the value you bring people as when you write code.
- 29:40Yes. You and you will be held
- 29:42responsible for that. So, it's cool that you've talked
- 29:45about it at school that you continue to preach the good word
- 29:49on it and you're doing. Hard work and I'm glad
- 29:51somebody's doing it. I want to go into this real-time
- 29:54streaming. As I mentioned, one of my best
- 29:56performing post on LinkedIn was talking about real time,
- 29:58streaming, and you all at Shopify, just put out, a blog
- 30:03post that goes really in-depth in to how you are doing
- 30:08real-time streaming. And one of the things that I
- 30:11think we can kick off the this part of this conversation about
- 30:15is Merlin and what exactly Merlin does and then It fits
- 30:20into the rest of your stack. Yeah.
- 30:22So Merlin is just the machine learning platform at Shopify and
- 30:32like really like when you when you look at it, it's it's really
- 30:39not much, but it's just a way for data scientists to quickly
- 30:45manage a machine learning project.
- 30:48Of course, And like I say it's not much but it's really cool.
- 30:53And so, like, Merlin the big thing with Merlin is it's built
- 30:56on top of re the main thing is is it makes parallel processing
- 31:01really, really easily. And so like you.
- 31:05So the basic principle is it has a head node which has a bunch of
- 31:09worker nodes. And so like, when you start a
- 31:12training job, it'll start spinning up worker nodes to
- 31:15process that data. And so it just makes working
- 31:19with really Really large data sets so much easier and so
- 31:23Merlin essentially just provides a bunch of command line tools so
- 31:30that way you can quickly spin up a project manager dependencies,
- 31:35you know, create your images and you know, has some boilerplate
- 31:39code for you to kind of do all this stuff and makes it easy.
- 31:44I'm specifically my work stream that I work on inside of Merlin
- 31:49is About making sure that we can do online inference.
- 31:54So, we, we provide a bunch of helper functions and things like
- 32:00that. So that way, you can quickly
- 32:02spin up a new rest API and new service with your machine
- 32:07learning model, and to be able to have it inside of the Shopify
- 32:11ecosystem, and to be able to, you know, get inference out of
- 32:15it. And so It's it's just really
- 32:19simple. You just end your terminal
- 32:21right? Merlin Services create and that
- 32:24creates a repo, it creates you know, simple, config files, easy
- 32:29enough. So that way like a data
- 32:32scientist doesn't have to go in and mess with Terror form or
- 32:36other things like that, but like, they can make sure that
- 32:38they have everything needed, you know, defined there, you know
- 32:42what gpus they need, how much, you know, CPU and memory.
- 32:45It takes care of all the auto, Only the one the recent projects
- 32:50I worked on was adding GPU auto-scaling to it.
- 32:55And so yeah so that's kind of what my team works on.
- 32:59We created a Merlin's pipelines library that just you can import
- 33:04and then it just has everything you need from getting data from
- 33:10our different data stores as well as you know, transforming
- 33:14it and getting it into however you need.
- 33:17As well as and and making sure that it's all distributed and
- 33:21using Ray out of the get go there now on version 2 and
- 33:25there's been lots of improvements but kind of working
- 33:28with with the team over there and things go.
- 33:31And so there's been kind of lots of learnings, like, one of the
- 33:35things we found is a lot of times like you know, data
- 33:38scientists end up often with just working on the head node
- 33:41and not taking advantage of the worker nodes and making sure
- 33:45things been out correctly. And so just making sure that we
- 33:49can make that easier. So there's one big thing that I
- 33:55want to know because as you know, I am a happy Shopify user
- 34:00with our funny shirts that we've been selling, which is I
- 34:05hallucinate more chat GPT. They've been discontinued
- 34:08because we can't just have them available all the time.
- 34:11We got to put a little bit of scarcity around it, but me as a
- 34:15Shopify. User.
- 34:19What are some of the things that like you're working on that?
- 34:22I as that end-user am seeing in my interactions with Shopify?
- 34:33So there's kind of a lot of cool projects happening under the
- 34:37hood. So so like one of the projects
- 34:44that the team has been working on a lot is supporting like
- 34:51not-safe-for-work filtering because you know Shopify
- 34:55supports lots of different businesses.
- 34:58And so you know when you go onto an app though, you don't You
- 35:03don't necessarily, you know, depending on who you are, right,
- 35:07like necessarily getting, you know, kind of an adult shop or
- 35:10lingerie shop, or like a violent, you know, like a gun
- 35:13shop or something like that. Maybe, you know, if you're just
- 35:17looking for Lego toys, you know, and something like that, like,
- 35:20air or water gun, you don't necessarily want real guns
- 35:23popping up, right? And so, having some sort of a
- 35:26filter there is something, the team's been working on improving
- 35:32and Ben. And so the.
- 35:35So those are some of the things. The other thing like we have
- 35:41Projects. Like so one of the cool projects
- 35:44I think is like you know recommendations for like new
- 35:50shop owners. So like you create a new shop
- 35:55like there's a lot that needs to happen, right?
- 35:58And like understanding you know the best past forwards over a
- 36:02job had a like an can be a confusing process.
- 36:06So like we have some models in place that help kind of
- 36:11Understand who you are, what type of shop you're trying to
- 36:14build and and then like make recommendation as you go and we
- 36:18try to follow what you're doing and continue to make the next
- 36:22best action recommendation. So that way you can build and
- 36:26grow more organically and so that's kind of cool.
- 36:31We also have other machine learning models that just, you
- 36:35know, are for internal. Use of understanding what we
- 36:39call the grid is just Like, you know, understanding our own data
- 36:44and understanding Trends. And you know, what, what should
- 36:48we do? Like, maybe we should we do
- 36:50different promotions, or should we do different Outreach house
- 36:53and markers, or cannot sit? Like we do have models
- 36:56internally that you know, help help the business due to
- 37:00business things. And so like, yeah, there's
- 37:03there's lots of different. There's lots of different
- 37:06projects, a Shopify, I think it That is like, you know, with
- 37:12online car, you know, e-commerce.
- 37:16Like there's so much that can be done and there's so much we can
- 37:20help our shop owners, become better at and so in all
- 37:24likelihood, I think the saying is saying, like, we're more
- 37:27likely to die from like, constipation, then we are from
- 37:31starving, right? Like we have, you know, trying
- 37:34to shove too much in and, and not focusing on the highest
- 37:38priorities. Then we are to be like Oh, we
- 37:41don't have anything to do, right?
- 37:42Like know, we have so many ideas floating around.
- 37:45There's so many cool projects that people come up with and so
- 37:50yeah, always trying to figure out what the highest priority
- 37:53wants are and what can be the most valuable, are always really
- 37:57useful. So yeah, our Shopify has
- 38:01invested a lot recently and to like open a.i. and we have a
- 38:08partnership with what G PT. And so like we Integrated it
- 38:12into a lot of different things that you might be able to see.
- 38:14So when you're creating your store and you want to start
- 38:18adding like products to it like there's a whole workflow process
- 38:25and inside of that you can actually add GPT
- 38:29recommendations. Right?
- 38:30So like it's like, hey I want to add sunglasses and if you add
- 38:35this to your workflow, it'll actually come up with a cool
- 38:37description of like what those sunglasses are and like, Kind of
- 38:41be a little bit scelzi or like, hey, like you're the coolest
- 38:45with these Shades and things like that.
- 38:46It helps kind of automate a lot of those different things, as
- 38:49well as, you know, like a, you can use it like, maybe
- 38:53auto-generate tags. So saying, like what, you know,
- 38:57who this is for, and things like that.
- 38:59And so, so yeah, lots of different.
- 39:03Lots of different projects happening inside Shopify to make
- 39:06your job easier. Yeah.
- 39:09Well I know we're going to get into a lot of that.
- 39:12Hopefully, I can convince somebody to Shopify to come and
- 39:16talk at the next lme's in production conference because
- 39:19that would be awesome. Maybe you maybe somebody else, I
- 39:21don't know. But I want to take these last
- 39:25couple minutes to talk about the book that you're writing.
- 39:27And what book are you writing first of all, and what made you
- 39:31want to write it? Half.
- 39:35So, we're writing a book lme's in production, which happened to
- 39:40be the same title as your last conference.
- 39:43So we fell in a great minds think alike.
- 39:47Yeah, exactly. Yeah.
- 39:48So this is something that's kind of been in the works for a while
- 39:51now in my co-author crisper. So he's kind of a legend in the
- 39:59NLP Community for say. He works at master Card.
- 40:04And so it really is a nice pairing because he comes with a
- 40:08lot of that natural language processing background.
- 40:13You know, he's worked as a translator, you know, several
- 40:16languages went in and became a data scientist and kind of
- 40:21learned a lot of that. And I kind of come from the
- 40:24other end of hey, like like one of the things I've always been
- 40:28focusing on in my career is like, how do I get a model into
- 40:32production? How do I make it easy for people
- 40:36to use? And actually usable, like, I
- 40:39like one of the things I hate the most is like when someone
- 40:42creates a cool model just sits and like their project workspace
- 40:47on their laptop or something like that.
- 40:48It's like no, I want like let's get this out to the world and
- 40:53and so yeah so we kind of come in from from both ends.
- 40:57And so yeah this this book islands and production it really
- 41:01focuses on How to put and work with and maintain these large
- 41:08language models and side of production.
- 41:11I think we because what kind of inspired this, I was like we saw
- 41:16a lot of people talking about writing LM books but a lot of it
- 41:20is more focused on the data. Scientists talking about the
- 41:24theory, it's really going into like Brazil, you train one of
- 41:28these massive models and you know, how do you deal with all
- 41:31those things? So we really wanted to take it
- 41:34the other way and so like our book is really more geared
- 41:37towards the end. They'll ease the software
- 41:39Engineers, you know the people who also want to work with these
- 41:44models but you know like kind of more get them into a more useful
- 41:49State and so so yeah we'll we're talking everything from you
- 41:55know. So like there are things we're
- 41:57going to be talking about in the book that you know like okay you
- 42:01know like what data sets. Do you need to train an llm?
- 42:07But like a data scientist is going to care about that
- 42:11question differently from like a machine-learning engineer,
- 42:15right? Like a machine learning engine
- 42:16resume or data, engineer cares about that in the aspect of
- 42:19like, how do I go and get that data, right?
- 42:21Like how do I build a data piping around it?
- 42:24Like how do I clean it or web scrape it or you know yeah
- 42:28things versus a data scientist is going to worry more about
- 42:31like, okay, like How do I clean it?
- 42:33How do I train it? You know, like and so we often
- 42:38have a lot of the same questions but our reasoning and purpose
- 42:40for for them are are different. And so, yeah.
- 42:44So this book is I think what's going to be really cool as.
- 42:50So, the end of the book we're going to have three different
- 42:53chapters on allow you to go and put an llm into production.
- 43:00So we're probably One chapter will be just like, hey working,
- 43:07you're gonna set up a cluster in the cloud you're gonna go in and
- 43:12you're going to deploy a model into the cloud.
- 43:14You're going to then you know create maybe like a phone app or
- 43:17something and you're going to be able to go interact with it and
- 43:21and and use it maybe you set up some sort of chatbot you know
- 43:25the other project were working on is, you know, like code
- 43:30completion like getting your own.
- 43:32Get up, copilot, something like that.
- 43:34Or you can go in, you can just get something, maybe set up on
- 43:37your laptop or again. You had it from the cloud
- 43:41before. So like, can you deploy an llm
- 43:45that you find tuned for that and kind of just use it on your own
- 43:49data, you know? So that way you can keep all
- 43:51your code, you know, prevent from pushing your code up to
- 43:55open a I so that way you have more control and making sure
- 43:58it's clean, and then the last one, I think is really going to
- 44:02blow people's mind. So like we've gotten, and
- 44:06there's definitely a smaller part of Creator.
- 44:09Two sets of few, one Cohen to read and things like that.
- 44:12But like we've gotten Ellen's working on a Raspberry Pi and we
- 44:16want to show you how you can do that as well.
- 44:18How you can get Ln on to the edge.
- 44:20And I think that's really cool because when we first started
- 44:22talking about this idea of her just like yeah lme's on the
- 44:25edge. Ha ha like like it's like it's
- 44:28not, you know, it's not even possible.
- 44:30Well, you know, several months ago and just like know you like
- 44:33he just have to have like tons of massive.
- 44:36Yeah. You things like that but like
- 44:38you know like with compression as well as Lama and other things
- 44:41like that, you can get a small, hello Lana, you know, 6 million
- 44:45parameters, some ruling parameters down onto a Raspberry
- 44:49Pi and get it running. And it's it may be really slow,
- 44:53but like we hope will be able to speed that up with like TPU
- 44:57stick line with coral or something like that.
- 45:00And I'm sorry. Yeah, we're pretty excited and
- 45:03about this book. So currently we can't wait I
- 45:08have a little bit information which is you've written the
- 45:10initials for chapter 2 and chapter 3 Alton three rain does
- 45:14the Early Access cover? So I think the Early Access
- 45:22comes out after you've written a third of your book and since
- 45:26we're going with Manning they have eat is what it's called
- 45:29MEAP, which gives people Early Access and so.
- 45:34So yeah. So we're supposed to be done
- 45:36with our side made 20 seconds so hopefully the the first Meep
- 45:44will be soon after that, by the time this podcast comes out
- 45:48approximately. See, Ricky around that time.
- 45:50Oh, okay, yeah. So yeah, if you're watching this
- 45:54populist go check out my book and we've hopefully it's out
- 45:57really soon. Yes, will leave a link?
- 46:00So do this is awesome. I look forward to reading it.
- 46:03Thank you so much for your time. This has been great.
- 46:06Awesome. Thank you.
- 45:48See, Ricky around that time. Oh, okay, yeah.
- 45:51So yeah, if you're watching this populist go check out my book
- 45:55and we've hopefully it's out really soon.
- 45:58Yes, will leave a link? So do this is awesome.
- 46:02I look forward to reading it. Thank you so much for your time.
- 46:05This has been great. Awesome.
- 46:06Thank you.