Latest / Agentic Conversations (formally mlops.community) / The Art and Science of Training LLMs // Bandish Shah and Davis Blalock // #219
Transcript
- 0:00Hey everyone, my name is Mondesi.
- 0:03I work on deep learning at Databricks and I take my coffee
- 0:07as a shot of espresso in the morning.
- 0:09Hey, I'm Davis. I'm a research scientist at
- 0:12Databricks and my caffeine of choice is green tea.
- 0:17Welcome, welcome. We are back with another MLM's
- 0:20Community podcast. I am your host and today we get
- 0:262 for the price of 1. Davis and Brandish both doing
- 0:31some really cool stuff when it comes to training large language
- 0:35models at Mosaic. And if you are in to the
- 0:40research side of things or you are at least a little bit
- 0:45curious like myself, this is the episode for that.
- 0:48They break it down all the different places that you can
- 0:52fail. You know, we don't really like
- 0:54to talk about what is glittery and gold and all that.
- 0:58We're not going to tell you in these episodes that AGI is
- 1:03coming. Get ready.
- 1:04We better get universal basic income.
- 1:06We're talking about how these training runs can fail and what
- 1:14a conversation this was. There are so many different ways
- 1:18that you can look at training looms and the pains that these
- 1:26deep learning researchers go through on a day-to-day basis.
- 1:30Because as Davis put it, you can fail in a million different ways
- 1:37and he broke down just a handful of some of these ways.
- 1:41And a lot of times you don't even realise that your models
- 1:45are failing. You don't even know that the
- 1:47model training is not going as planned.
- 1:50You just see all of a sudden things start acting funny and
- 1:54then you have to go debug and maybe you have to debug on the
- 1:59hardware side. Maybe you have to debug because
- 2:02there's some breaking changes in PIE Torch that you didn't even
- 2:04realise, or there's just another type of framework that you're
- 2:08using and there's been a breaking change.
- 2:10He was mentioning how much of a headache all these breaking
- 2:13changes are, and how you have to keep up with that, and the act
- 2:19of trying to stay stable and use one version of Pytorch or
- 2:24whatever it is that you're leaning heavily on.
- 2:28It's a bit of a myth because you want the newest and baddest
- 2:34features that come out in the latest PIE.
- 2:36Which release? But guess what, Breaking
- 2:40changes. So that's another area.
- 2:42It can fail. It can fail just because you
- 2:45don't really understand what business problem you're going
- 2:49after when you're training this model.
- 2:51And so these guys get down and dirty with us on all the
- 2:55different things that they've seen in their years of
- 2:59experience. While training models, I also
- 3:01got into data quality with them and how we can ensure data
- 3:06quality, especially when you are training these gigantic models
- 3:10and you have a lot, a lot of data.
- 3:13It's basically the opposite of that.
- 3:15Big data is dead trend. This is the big data is alive
- 3:19and well trend, and one quote that I particularly like from
- 3:24the conversation is every data set is ugly in its own way.
- 3:29And Bandish mentioned how you got to get in there and you got
- 3:34to just do a little bit of manual evaluation.
- 3:37Look at your data set. Sometimes there's ideas that ohh
- 3:42yeah, a markdown file is referencing diagram 1 or table
- 3:48one. But because of the way that you
- 3:51did your data preprocessing, Table 1 does not exist in that
- 3:56markdown file anymore. So you'll figure it out soon
- 4:00enough. Just taking a few random samples
- 4:02of these gigantic data sets and there's always something wrong.
- 4:06That is what I'm coming away with.
- 4:09It's just a matter of if you can catch the majority of things.
- 4:14And these guys at Mosaic, they have been doing it long enough
- 4:17to where they've got some experience and they've seen a
- 4:21few things. They've been around the block,
- 4:23we could say. So let's get into this
- 4:26conversation. But before we do, I want to
- 4:28mention that I did some analysis on the YouTube page that we have
- 4:33and specifically the analytics side of the YouTube page.
- 4:36And I have some key findings for you.
- 4:38So if you are watching this on YouTube, there are about 30,000
- 4:45views that we had in the last 1028 days. 21 thousand of those
- 4:50views were from non subscribers. What is this?
- 4:53What is going on? It takes nothing.
- 4:56Hit that subscribe button. We would love to see you more
- 4:59often because the funny part of my little analysis is that 20
- 5:05thousand of those 30,000 views were from returning viewers.
- 5:11This means lots of people are coming back for seconds, but
- 5:14you're not hitting the subscribe button.
- 5:15So come on, hit that subscribe button.
- 5:19And I also want to give a huge shout out to everyone that
- 5:23reached out to me after a few podcasts ago when I was lost on
- 5:30a paper. I could not figure out what the
- 5:32paper was that I was trying to find and I knew it had something
- 5:37to do with data leaks and also using Open AI and all the ways
- 5:43that when you call the Open AI API you get data leaks and some
- 5:46prog researchers had written this paper.
- 5:50I couldn't figure it out. So many of you reached out to me
- 5:54and gave me that paper. I just have to say you restored
- 5:57my faith in humanity. It is so nice to see that and
- 6:02it's a little bit dangerous because now I might start
- 6:04leaning on you a little more than expected and I'm going to
- 6:10do my best to 1st Google things before I ask the masses.
- 6:15But I may ask you all a few more questions while we're at it.
- 6:20Last but not least, it is official June 25th we're having
- 6:26the first in person ML OPS Community Conference.
- 6:30It's gonna be all about AI quality.
- 6:35It's going to be called the AI Quality Conference June 25th in
- 6:40San Francisco. I really hope to see you there.
- 6:42We will leave a link to where you can get the early bird
- 6:45tickets right now. Come join us.
- 6:47You know we're not going to just do it like a normal conference.
- 6:50You can expect lots of shenanigans, that is for sure.
- 6:54Hopefully you did not use your learning budget up for this year
- 6:59yet and convince your boss that you got to go.
- 7:02We're going to make the tickets nice and cheap, so it's going to
- 7:04be an easy win. We just want to get you there.
- 7:07We want to have a bunch of fun friends hanging out in a room
- 7:11learning some stuff and maybe doing some crazy musical
- 7:17improvisations or some hardcore techno dance classes, you name
- 7:23it. I don't quite know what the
- 7:25craziness is going to be yet because it's still very early,
- 7:27but I suggest you get in on it June 25th.
- 7:30That is AI qualityconference.com.
- 7:34We've got it all laid out and before we go, I want to give a
- 7:38huge shout out to Databricks for sponsoring this episode.
- 7:43They've been doing some incredible stuff, as you will
- 7:45hear. And let's listen to our friends
- 7:50at Databricks and Mosaic in this conversation right now.
- 7:59Davis, I got to hit you with the question.
- 8:01Man, I'm a fan of your newsletter.
- 8:03I really appreciate when you break down all these papers that
- 8:07I don't necessarily under understand 100% of the time, but
- 8:11I feel like they're important and I feel smarter because I get
- 8:14your newsletter in my inbox. The only thing is, my inbox has
- 8:18been a little bit lonely since the beginning of the year, and
- 8:21I'm guessing that's because you either got access to a tonne of
- 8:26new GPU S and so you've been training a lot of models, or
- 8:31you're taking a hiatus to come back bigger and better in the
- 8:35second-half of of 2024. Yeah.
- 8:40So there are two reasons for that as an exciting one and a
- 8:43depressant 1. The exciting one is that we've
- 8:49been cooking at Mosaic. I can't say exactly what yet,
- 8:54but basically when the cluster costs more cash per day than you
- 8:59do per year, it's a little hard to justify working on other
- 9:03stuff. So that's kind of involved to
- 9:06the priority top of the priority list, to the exclusion of
- 9:08everything else. A little more depressing reason
- 9:12is, I think having to crack something out every week kinda
- 9:16suck the joy out of reading papers for me for a long time.
- 9:20Like, think about a task you don't want to do.
- 9:24Like the last time you had something you really dreaded,
- 9:26you put it off whenever you could.
- 9:28Now imagine that even if you do it, it just comes back again.
- 9:33Next week. It gets a little depressing.
- 9:37And now imagine that every day you put it off, it gets worse
- 9:41because every day more and more papers are coming in O.
- 9:44It used to be the case that reading papers was the one thing
- 9:47I could always do, no matter how sleep deprived I am, no matter
- 9:52what else is going on, it's always easy to sit down and
- 9:54focus or read a paper. But having this big extrinsic
- 9:57motivation, feeling like there are all these people almost
- 10:01breathing down my neck waiting for content, it just sucked all
- 10:06the joy out of it. And so I kind of reached the
- 10:10point where I needed, I needed to take a little bit of a break
- 10:13and kind of rediscover the joy of learning, of reading all this
- 10:18stuff, getting back to why I started doing in the 1st place.
- 10:23O that's what's happening. I think I would be doing it now
- 10:25if we weren't cooking so much, but I needed at least a few
- 10:27weeks to kind of reset there. For me, it's very much like when
- 10:33I write the newsletter for the MLS community, and especially
- 10:36the ones where it's more like I need to add my thought.
- 10:41I need to bring in new types of ideas.
- 10:44I want originality in it. It is literally like I I know
- 10:49that feeling of procrastination where each day it just builds
- 10:52and then you would think like more subscribers is better and
- 10:58you would be excited for that. But then you see like the
- 11:01numbers of subscribers are growing and then the
- 11:04procrastination is growing. And so that all just adds to the
- 11:07weight of it. And I would end up going nuts
- 11:10and then spending so much time on the newsletters and
- 11:15specifically like these mega OPS roundups.
- 11:19And I was doing those monthly. We have our weekly newsletter
- 11:23that goes out. But then I would do like a
- 11:26monthly one to kind of go over things and give my commentary on
- 11:29the whole scene and the ecosystem and all that fun stuff
- 11:33and it's hard. So I feel you.
- 11:35I can totally understand. A little break, hopefully you'll
- 11:38get back at it because my IQ thanks you.
- 11:42And for anyone that does not know and wants to sign up for
- 11:48when Davis is back in the newsletter writing phase.
- 11:53Hence these clusters aren't costing more than half of a team
- 11:57worth per day. I guess I would highly recommend
- 12:02subscribing to his newsletter. It's going to be in the
- 12:04description. It's like Davis Reed's papers, I
- 12:06think is the very unique name. To it and summarise this paper.
- 12:13There it is very clear what you're going to get on that
- 12:16newsletter. Davis Reed's paper, so you don't
- 12:19have to. Ohh.
- 12:20It's great. It's fantastic.
- 12:22And that is the value prop there.
- 12:24It's like you read all the, you read a whole tonne of papers and
- 12:28then you call out what the interesting pieces of some
- 12:33really good ones are. And so we're going to be talking
- 12:37a lot about lots of the stuff that you've been learning in
- 12:40those papers. But first, like maybe Davis, can
- 12:45you breakdown a little bit of how you got into tech in general
- 12:50so we can see your arc before Mosaic?
- 12:55Yeah. So I feel like me getting into
- 13:01technology was kind of inevitable in some sense.
- 13:05So my granddad was an electrical engineer and grew up on a farm
- 13:10in the middle of nowhere in Tennessee.
- 13:12But just always had that inclination.
- 13:16Ended up being the first person in his family to go to college
- 13:20at the University of Tennessee. Later went on to become a
- 13:22professor there. He had three sons.
- 13:26All of them taught electrical engineering degrees from the
- 13:28University of Tennessee. One's a professor there now.
- 13:32My dad's professor at UVA Other One is a practising electrical
- 13:36engineer. Just every male blaylock on my
- 13:42of my side of the family is an engineer of some sort.
- 13:45I'm actually a little bit of an outlier, getting a degree in
- 13:48computer science instead of electrical engineering.
- 13:51It's only electrical engineering from undergrad.
- 13:53And then so you you got the degree and you decided to hey,
- 13:58you know what, I think this ML stuff, it's pretty fun.
- 14:02And when did you get the bug for like starting to train and
- 14:09basically big GPU's making GPU's governor?
- 14:15Yeah, it was not what I intended to do.
- 14:19So back in 2013, I was in undergrad at the University of
- 14:24Virginia. I worked in a research group
- 14:27doing wearable devices. This was back in the days when
- 14:31Fitbit was going to change the world.
- 14:32We were going to revolutionise healthcare, all that stuff.
- 14:37And we had these little wearable devices or Lapid made record
- 14:43data from all sorts of different people we do.
- 14:45Studies identify dementia, Parkinson's, healthcare givers
- 14:51or whatever. And it turned out that once you
- 14:55had all this time series data, all this longitude and all data,
- 15:00it was really hard to analyse. It very hard to make sense of
- 15:04accelerometer, gyroscope, magnetometer signals.
- 15:07So I ended up just kind of backing in some machine learning
- 15:10and data mining. As a result of that, I was
- 15:14trying to work on healthcare stuff, but he just converged to
- 15:18the inevitable challenges of making sense of the data.
- 15:23So that was what I spent a fair amount of my time on in
- 15:26undergrad and then coming to grad school in 2014.
- 15:30It just seemed like machine learning was the field that was
- 15:33popping off. That had a lot of potential, and
- 15:37that was very deeply technical because I also considered doing
- 15:40a lot of human computer interaction stuff.
- 15:43There were groups that wanted me to come to HCI, but there was a
- 15:48lot of value it seemed, and doing something deeply technical
- 15:51that was emerging that had a lot of potential.
- 15:53So that was how I ended U signing a new machine learning
- 15:56when it came to MIT. And so you wrote the paper
- 16:01Multiplying Matrices without Multiplying, which I think
- 16:04gained you a bit of notoriety. Can you explain that?
- 16:08Yeah, that was a fun one. So the problem we're tackling
- 16:14there is approximate matrix multiplication, which is exactly
- 16:17what it sounds like. You have two matrices.
- 16:20You want to multiply them because matrix multiplication is
- 16:23of course one of the most fundamental operations in
- 16:25machine learning in many other fields.
- 16:28But you want to do it really quickly, and you're willing to
- 16:30tolerate some error in the output.
- 16:33There are a bunch of approaches to this.
- 16:36Under slightly different assumptions, we found a method
- 16:41that ends up letting you do this approximation without any
- 16:45multiplication. Sounds a little bit
- 16:47counterintuitive. Effectively, you have to know
- 16:50one of the matrices ahead of time.
- 16:52If you know one matrix ahead of time, it turns out you can
- 16:56process the other one in a way that doesn't involve any
- 17:00multiplication. I think it'll be a little hard
- 17:02to get into the details, but the keyword here to look for is a
- 17:05vector quantization. That's kind of the core of the
- 17:09approach, and what's cool about it is that it is extremely power
- 17:16efficient because you won't do vastly fewer operations.
- 17:23You end U doing small table lookups instead of multiplies to
- 17:28your place, say 4 or maybe 8 multiplies with one table.
- 17:31Look, that is both less work and is something you can implement
- 17:37in way fewer transistors. Just think about how many
- 17:41transistors it takes to build a multiplexer versus multiplier O.
- 17:44My contrarian take is that binary neural networks make
- 17:49basically no sense. They're strictly worse than
- 17:52vector quantization. They're strictly less
- 17:54expressive. They don't buy you any more
- 17:56hardware efficiency. They are the more obvious
- 17:59approach because they're just extrapolating taking the
- 18:03parameters to fewer and fewer bits, but there's effectively no
- 18:05advantage to them. It's all going to be vector
- 18:07quantization in the future. Wait, and this is been getting
- 18:13kind of popular recently because of the whole I I think there was
- 18:16a paper that recently came out that was talking about how ohh,
- 18:19we can do large language models in one bit, right.
- 18:22And so you're saying that's going to be thrown out the
- 18:26window. It's just a matter of time.
- 18:29Pretty much, yeah. There have been.
- 18:31There's been work on binarization of neural networks
- 18:33since at least 2015 ish, and there's a company called XNOR
- 18:37AI. I got acquired in 2016, so this
- 18:40is not a new thing. I think it's been riding the
- 18:44hype cycle up and down. Occasionally there's a paper
- 18:47that gets people excited, but yeah, I think it's an
- 18:50interesting proof of concept. But if you just look at the
- 18:55fundamentals, if you just look at the amount of information per
- 18:59stored bit you can get out of binarization versus vector
- 19:05quantization. You just have strictly more
- 19:08expressivity with vector quantization.
- 19:12Binarization is just a special case that kind of hamstrings
- 19:15you, because you can't exploit any mutual information across
- 19:20different parameters and every parameter has to be exactly 1
- 19:23bit. You're you're just really really
- 19:27constrained compared to a more flexible representation that
- 19:32looks at the distribution of multiple values together.
- 19:35That's really the core idea of vector quantization.
- 19:37People say quantization in neural networks usually in
- 19:39scalar quantization, which is every input floating point
- 19:43weight becomes 1. Lower precision weight.
- 19:46Vector quantization is you look at groups of weights and you
- 19:51effectively do K means and find structure in the distribution of
- 19:57your weights across different dimensions O You can exploit
- 20:00that structure to get vastly less quantization error.
- 20:04Ends. You end up with usually higher
- 20:08entropy in your encodings because you're saying which
- 20:10centroid is it? And yeah, it is just strictly
- 20:16more expressive while retaining the extreme low power hardware
- 20:21advantages. And it works today on CPUs like.
- 20:24You can already get a huge seed U on Ccus.
- 20:27Hmm. So Brandish don't wanna Don't
- 20:31want you to feel like we're just forgetting about you over here.
- 20:34Of course, I know that you were doing stuff with Matrices also.
- 20:37I mean, you had some time at Cisco just to catch everyone up
- 20:41on your journey until you got to Mosaic.
- 20:45You also were working at Samba Nova, so you're no stranger to
- 20:49this space either, and I I would love to get just the quick
- 20:54rundown on how you found yourself working on matrices and
- 20:58then jumped on to Mosaic and now you're leading teams there.
- 21:04Yeah, for sure. I mean, let's say so it's
- 21:06actually similar somewhat to, Davis said.
- 21:09You know, I I started out never actually thinking I'd get into
- 21:11computer engineering, computer science.
- 21:14I wanted to work on stuff that ends up in space, you know, and
- 21:18ended up just, yeah, I mean, I was just super like as a kid.
- 21:22Like I was a kid that took everything apart.
- 21:24I drove my parents nuts and constantly wouldn't shut up.
- 21:28Like, you know, my mom likes to joke that no one would babysit
- 21:31me because I would just keep asking questions.
- 21:33And it was like one of those things error I think that
- 21:37eventually just turned into, you know, getting into engineering
- 21:40school, you know and and the result a million things in
- 21:42between. There was astronaut, there was
- 21:44business. There was, you know whatever was
- 21:47flavour of the week kind of thing.
- 21:48But at the end of the day, you know, I think engineer at heart
- 21:51and yes I ended up getting to college, you know, declared an
- 21:55electrical engineering major because that's what a bunch of
- 21:58my uncles had done and ended up loving it and actually ended up
- 22:03yeah, joking. We never actually took a CS
- 22:05course and all of college except for like maybe the closest thing
- 22:08was a computer architecture and digital design course, which I
- 22:11took my my senior year and I got involved actually working on
- 22:16electrical systems for a nanosatellite project.
- 22:19So the Air Force research labs at the time had a nanosatellite
- 22:22programme. And so I ended up kind of
- 22:25building all the different interfaces and it was like this
- 22:27modular satellite that you could build very quickly.
- 22:30These are like nanosatellites. They're pretty common now.
- 22:32Like think about SpaceX or think about you know like Starlink and
- 22:36stuff a little smaller than that but same kind of basic principle
- 22:39and and yeah, I was like, OK, I'm gonna do aerospace, going to
- 22:43grad school for that and that will work for NASA.
- 22:44It's great. And.
- 22:46And that all changed, I think my, my serior when I, you know,
- 22:54decided to show up to a career fair super late, like in the
- 22:57last 15 minutes to like, just got you see what was out there.
- 23:00And I yeah. And I worked IT in college.
- 23:03You know, I was like my kind of school gig and ended up almost
- 23:06running over like a former kind of coworker that I worked with
- 23:09was like a year older. And he worked at Sun
- 23:11Microsystems at the time. And he was carrying this, like,
- 23:13giant, like, server motherboard that they had brought as like a
- 23:16prop. And I was like, that's cool.
- 23:18Like, how do I make that? He was like, give me your
- 23:20resume, you know? And then about, you know, a few
- 23:22weeks later interviewed at Sun Microsystems and then joined
- 23:26them and then about a year and a half later got bought by Oracle.
- 23:29So I was building silicon and I worked on like PCI Express,
- 23:33worked on memory ASICS, so worked on all kind of like the
- 23:37northbridge, Southbridge type stuff, you, you know, speak the
- 23:39Intel parlance. And then and then eventually
- 23:42started thinking about like the main processor.
- 23:44And so I did that for almost the better part of a decade.
- 23:47And actually right around the time I think in Naveen RAW was
- 23:53starting Nirvana and it was like, Ohh man.
- 23:56Like, you know, before if you had to go to, if you wanted to
- 23:57build trips and you wanted to work in a startup, like that was
- 24:01unheard of. Like everything had
- 24:02consolidated. Like you couldn't.
- 24:04You know, it's like there's just you gotta go to one of the big
- 24:06companies if you wanna make a career and ship design.
- 24:10And you know, I think a lot of part like being kind of made it
- 24:13cool again. Like there was new money going
- 24:14into chip designs, AI was picking up right.
- 24:17There are a lot of breakthroughs and deep learning happening.
- 24:20And it was like, OK, like, let's try to figure out how to build,
- 24:23you know, an FPGA at the time to just, like, prototype it, right.
- 24:27Let's do like, a quick iteration kind of hardware design on an
- 24:29FPGA. And so, you know, I like to joke
- 24:32that hammers. You kind of always see the world
- 24:34as nails. And so as a hardware guy, I was
- 24:36like, oh, like, let's clock it faster, right?
- 24:39Like, let's just do, you know, let's, let's take this thing
- 24:41that's happening in software. It's a bunch of, like, vector
- 24:43instructions on an X86 processor or something.
- 24:46And let's actually figure out how to build specialised
- 24:48hardware. And it was kind of along the
- 24:50same theme. So we started working on kind of
- 24:52prototyping these different things.
- 24:54Um, and then actually ended up, you know, a team from from
- 24:59Oracle at the time went off and found its Amanova.
- 25:01So I got involved in some Nova very early and that took a bunch
- 25:05of research like really just super interesting research
- 25:08around like building coarse grained reconfigurable type
- 25:10architectures and creating you know basically a deep learning
- 25:14accelerator from that. So then from there kind of went
- 25:16into performance and like really looking at how to optimise these
- 25:19workloads on these specialised chips, you know, probably picked
- 25:23up a little bit of, you know, more and more software started
- 25:26and moving up the stack a bit more, you know.
- 25:28Now I joke that I kind of manage a Python team.
- 25:31So it's it's you know I've come almost not not full circle, but
- 25:35I've definitely come from like have gone to the dark side, if
- 25:38you will, if you're hardware guys, so.
- 25:41Well, here's what I imagine both of you do while you when you go
- 25:45to work. And I think we're all kind of
- 25:47the same age. So you can remember those memes
- 25:50that were popular on Facebook probably like 10 years ago,
- 25:53where it's like what my brother thinks I do and what my mom
- 25:57thinks I do, what I actually do. I just, I think you guys sit
- 26:01there and you check in on your training runs that have been
- 26:04going for like the last 30 days and you're like everything
- 26:06looking good here. Let's see.
- 26:08Well then, how can I debug this? Or we need to stop training.
- 26:12So that's my like very naive vision of what you are doing.
- 26:17Give me the real breakdown on what's the day-to-day life in
- 26:21Davis and Ben Dishes world. Yeah, I could do that.
- 26:25So if you want to remember what it's like to train Ellens, you
- 26:32just have to remember there's a song written about it.
- 26:35It is 10% luck, 20% skill. It's 15% concentrated power,
- 26:42will 5% pleasure and 50% pain. That's pretty much the
- 26:47breakdown. Where's the pain coming from?
- 26:51Yeah. So that's a great, it's a great
- 26:53question. So there is pain from all over
- 26:57the place. The lowest level source of pain
- 27:02is that you get a tonne of hardware failures, at least.
- 27:06Supposedly this doesn't happen as much with CPUs, but at least
- 27:09with GPUs you're gonna be seeing hardware failures all the time.
- 27:12And when you get a hardware failure, it doesn't raise
- 27:16hardware failure exception that you can catch and handle in some
- 27:20nice way. You just get arbitrary bad
- 27:22behaviour. Maybe your job just completely
- 27:24crashes. Maybe some of your nose just
- 27:27slow down slightly. Could even just start getting
- 27:32subtly incorrect outputs. All sorts of terrible things
- 27:35happen. O you have say, thousands of
- 27:39GPUs, maybe just hundreds of GPUs crunching numbers and then
- 27:43suddenly something just kind of goes wrong.
- 27:45You usually what you'll see is a nickel timeout.
- 27:49Nickel is NVIDIA Distributed Communication library.
- 27:52All that means is that some node didn't respond when they were
- 27:55supposed to be syncing gradients or something.
- 27:57It's very vague, so it just means that something has gone
- 28:02wrong and now it's up to you to figure out what that is.
- 28:06You might manually run diagnostics on every single
- 28:09node. Try to figure out what's not
- 28:11responding or what's working too slowly.
- 28:14Maybe it's just transient. Occasionally something just
- 28:16randomly happens. Or maybe you don't encounter any
- 28:23of these issues, and actually there's some other problem that
- 28:26has occurred. For example, if you have enough
- 28:29nodes trying to write a checkpoint to an object store at
- 28:33once, you can basically dedos your object store and you will
- 28:38just see that your checkpoint saving or loading silently
- 28:42fails. You can get similar issues if
- 28:46you have, say, a network file system.
- 28:48You're just putting so much load on every single piece that
- 28:52you're touching that any piece can fail at anytime.
- 28:57That's the lowest level. That's the hardware and then you
- 29:01have the software on top of it. So because we're still in the
- 29:06phase of the field where we're figuring out how to do all this,
- 29:10and there is increasing demand for training at such large
- 29:14scale, the software stacks are not mature.
- 29:18There are breaking changes and all the NVIDIA libraries, you'll
- 29:22get breaking changes and pies for it.
- 29:24You'll get breaking phase changes in hugging face
- 29:26libraries, whatever abstraction layers you're using.
- 29:31On top of those, try to handle large scale training stuff that
- 29:34will experience breaking changes.
- 29:36I'm just loading your data, its scale is hard.
- 29:39You're going to have some sort of library to do that.
- 29:42Everything is unstable and you spend a lot of time maintaining
- 29:46some kind of layer to abstract it away.
- 29:48You're checking for different Torch version numbers and your
- 29:51Python code and monkey patching different functions.
- 29:54And like Pytorch FSP, you're in every single one of those.
- 29:59Is something you learned the hard way that you didn't look at
- 30:01the code right? Some clean unit tests and say Oh
- 30:04yes, well of course for Torch 221 we need the monkey patch to
- 30:08function in the following way. It's more like something
- 30:10horrible happened. He threw an engineer month at it
- 30:13to try to get to the root cause of the issue and eventually you
- 30:16found, Oh my gosh, it's this incredibly subtle thing with how
- 30:18they're initialising the buffers or whatever.
- 30:21And then you lucky patch should you figure it out and hopefully
- 30:26it gets better overtime. So every piece of it is
- 30:29difficult and that's just whether the job works.
- 30:32We haven't gotten to whether as a job yields anywhere near the
- 30:36accuracy you want. So my view is that in the worst
- 30:41debugging in all of computer science is debugging.
- 30:45Deep learning accuracy is worse than distributed systems, worse
- 30:48than embedded systems because it is so hard to get signal about
- 30:53what's happening and so expensive.
- 30:55If the numbers are too low, there's no exception right
- 30:59there. There's no concrete behaviour.
- 31:03You diagnose that, says ohh, well, that's null.
- 31:05Well, of course it's not working.
- 31:07No, you just get numbers that are too low with almost no
- 31:11indication as to what's happening and it is extremely
- 31:15expensive to check what is happening.
- 31:18O You have to be incredibly disciplined, incredibly
- 31:21systematic, and and have in some cases just a little bit of black
- 31:27magic to guess what is going wrong and identify it so that.
- 31:33That's like. An overview that that's a huge.
- 31:36Paradigm shift right like, like and I think people struggle with
- 31:40all the time like you in computing systems.
- 31:42You want a right answer, right? There's like always an expected
- 31:44answer and here there isn't. Like we've literally we've found
- 31:50issues where we're not even computing the right thing and
- 31:52the model still like has good accuracy.
- 31:56Like, you know, it's like what? You know, like that where would
- 32:00that fly? Right.
- 32:01Like you can't approximately transfer bank funds like that.
- 32:04That doesn't that doesn't fly right.
- 32:05Like that's not going to work like you, you know.
- 32:08So it's like here but it's like hey, like ohh yeah.
- 32:10We've been doing that wrong the whole time.
- 32:12Like you catch a bug like a year later and some code that you
- 32:14wrote, you know and it's like ohh.
- 32:16Yeah. Like something underlying change
- 32:18that broke the how that behaves and we never caught it because
- 32:21we didn't have a test or something and and it's like well
- 32:24when we changed it the model performed worse like and you're
- 32:27like wait, what What's happening right.
- 32:29Like and so it's you know things are things are constantly like
- 32:32moving there's all these moving parts things are changing and
- 32:36and there's no right answer. Right.
- 32:37It's it's very much like I mean I I, you know you were asking
- 32:41about what we do what's our day-to-day like I I kind of tell
- 32:44what like you know my my family and my friends like who aren't
- 32:47in this like yeah. And honestly sometimes feels
- 32:49like just educating someone. Right.
- 32:51It's like what do we do right. It's like we we have no formula
- 32:54for how everyone should learn. Like there's that's very clear
- 32:57you know and so here's a everyone.
- 32:59Learns. Differently.
- 33:00Everyone excels at different topics and it's like, what do we
- 33:04do? We write a bunch of tests and we
- 33:05say, you know take your L Sats or take your Mcats or take your
- 33:10whatever. And if you do well on them then
- 33:12you get a score and maybe that you know that's that's what this
- 33:15is, right? It's not there's no perfect size
- 33:18to it anyway should perform. There's no algorithm that it's
- 33:20always going to get you the right answer.
- 33:22It's it's like you kind of just trying different things and and
- 33:26seeing how the thing responds essentially.
- 33:29Wow. So I feel for you guys just
- 33:34listening to that. I can feel the amount of
- 33:38experience and like pain that you've had to go through.
- 33:43And as you mentioned, these are not mistakes that come without a
- 33:50price tag. Like there was something that I
- 33:55still quote matte your one of your colleagues at Databricks
- 34:00about when he came on here. He was saying how you can spend.
- 34:0625. 30-40 days training a model and it's not until the 40th day
- 34:13that you realise this model actually isn't that good and we
- 34:18can't use it. And so you've put all of these
- 34:21resources into it, whether that is the people's time or the GPU
- 34:26costs or just like trying to learn and make it better and
- 34:32you've got effectively nothing to show for it because it's not
- 34:36like Ohh, well we can use this model in some cases.
- 34:40You can't like half ass it. It's kind of all or nothing.
- 34:44Is this model hitting the the needs that we have or is it not?
- 34:50And if it doesn't been 40 days later you're like ohh, I guess
- 34:54we gotta try this one again and let's see if we can not mess it
- 34:57up next time. Yeah right.
- 34:58So I imagine you you felt that a few times, so that that.
- 35:02Definitely. So this is one of the things
- 35:04that we always talk to customers about, right?
- 35:06It's like even the problem of like knowing that the model is
- 35:10meeting your need or it's addressing your problem is like
- 35:13is pretty hard, like having good evals for your specific use
- 35:17case, right. Is like honestly like that's
- 35:19step zero. Like I think like the first
- 35:21question we ask is like, OK, you want to train a model with us or
- 35:24you want to develop a new model with us.
- 35:26Like what? How are you going to know that
- 35:28that model is doing what you want?
- 35:30Like you know what are you doing right?
- 35:31Are you going to use kind of the those leaderboard metrics?
- 35:35Is that reflective of your use cases?
- 35:37You know, are you going if you're doing code generation,
- 35:39are you going to use human eval? Is that good enough for you?
- 35:41Is that is that you know or if you have like a super specific
- 35:45business, right like if you you want to automate some call
- 35:50centre interactions or something and you have like very specific
- 35:53product needs like how is that going to be captured in general
- 35:56kind of domain stuff that you're you know getting from scraping
- 36:00the Internet and so like but in those cases like how are you
- 36:02going to evaluate this model. So I think like that's huge.
- 36:05Like you know we we kind of say like don't even start until you
- 36:09until you've answered that question And and the problem
- 36:11with that is sometimes you can't answer it until you have a
- 36:13bubble to try it out with. And so like we are, it's kind of
- 36:17a bit of a chicken and egg ish type scenario, Davis.
- 36:20I know there's there. I mean there's quite a bit of
- 36:21work that we also kind of do to to kind of try to understand
- 36:25where we'll land, you know and I think.
- 36:28It it is. 8 It's impossible to know like what capabilities are
- 36:34going to get until you have the final thing, but.
- 36:37In. Terms of like looking at where
- 36:39we're going to land, you know, like one of the things that we
- 36:41actually look at quite a bit is scaling laws.
- 36:43And so we do a lot of work to kind of try to figure out, OK,
- 36:46like this is how we're trending, we're running evals constantly,
- 36:50right? When we figure out like, OK,
- 36:52these are the things that are important for the models that
- 36:53we're training. So again, it's not 100.
- 36:56Percent guarantee, but it's important to like kind of track
- 36:59your progress as you go. Like where are you, where are
- 37:02you going? And that's why again having
- 37:03those evals are super important. Like you you want to mix like
- 37:06you don't want, you want all the kind of general leaderboard
- 37:08evals, the mmus, the GSM 8 cases like all these other things.
- 37:12And then on top of that you want your own evals.
- 37:14We do vibe tricks as well, right.
- 37:16Like we we we frequently asked what do you know if if model
- 37:20can't answer who is trained by then you know like that's that's
- 37:24you know something that we want to make sure that the model
- 37:26understands. So there's a lot of things that
- 37:28you kind of do along the way. And I think we we've gotten a
- 37:31lot. We've gotten pretty good at
- 37:32trying to like figure out where we're going to land.
- 37:34Usually it's a surprise. Sometimes you're like, wow, I
- 37:36can't believe it's actually this good.
- 37:39And so I think that's. Been a really positive trend.
- 37:41You know I think we have to the rinse and repeat that and see if
- 37:44we can consistently land there. But so far we've been we've been
- 37:47pretty good at kind of trying to figure out OK we can we can kind
- 37:50of land here and the model is going to be fairly capable so
- 37:54and. Does the lack of consistency
- 37:57come from just that it's every time you're training models for
- 38:01customers it's a different scenario?
- 38:04Or is it because it's just like you find, oh, there was a
- 38:09breaking change in Pytorch and we didn't recognise it and so
- 38:12now we got to start that again, Or a little bit of both?
- 38:16It's probably it's. Probably both.
- 38:18I mean, I think like it depends also because we're breaking it
- 38:21up like if we're pre training, if we're doing some more domain
- 38:24adaptation, fine tuning other things on top of that.
- 38:28But I think there is. I mean part of it is like.
- 38:33Being it's just I think. And it's a it's a really hard
- 38:35problem. Like, I can't emphasise that
- 38:37enough. Like when a customer has, like I
- 38:39have this use case like it's it's very easy for people to be
- 38:42like, oh, let me just throw AI in there and I'll automatically
- 38:47figure out everything and it's the Holy Grail and you know.
- 38:51I've been reading some Twitter threads that say that AI could
- 38:54fix this, right? Yeah, yeah, exactly.
- 38:56And a lot. Of a lot of folks also I will
- 38:57admittedly like say I think a lot of people throw in like deep
- 39:00learning or generative AI where you probably can just get away
- 39:04with like statistical level model or something much simpler,
- 39:07some random forest. Yeah, you don't, you know.
- 39:09And so I think like first of all like even just defining your
- 39:12problem is super super important like and then and then
- 39:16understanding how you know how do you measure the effect enough
- 39:18to solving that problem. And so I but.
- 39:22I but yeah. And I think if you don't, if you
- 39:23don't nail that down, then yeah. I think like how do you know
- 39:26what data you're going to really need to like gather and collect?
- 39:29Like how are you going to assess the quality of your data if you
- 39:32if you don't know that this is representative of the problem
- 39:35and you want a reasonable distribute.
- 39:37What are we, you know, like technically, I think actually we
- 39:39want to we want a reasonable representation.
- 39:41We want a good distribution of like the problems that we're
- 39:44trying to solve in our data set. Right.
- 39:45And so. So how?
- 39:47Do you? How do you even know?
- 39:48That if you don't know how you're going to e-mail.
- 39:49So I think that's why again, like keep harping on that, but
- 39:52that's so important and then yeah.
- 39:54Things are constantly. Changing I think, you know Davis
- 39:57Davis was basically describing every single day for the last, I
- 40:01don't know you know several months where for a long time we
- 40:05had these aspirations of like, you know with Pie Torch we're
- 40:07like, oh, we're only going to pin pie Torch versions.
- 40:10We're only going to do things on stable releases.
- 40:12We're we're enterprise, right. We we only want, we want, we
- 40:15want like good release cycles. We want to do all this that was
- 40:18like such a pipe dream. Like we had to to get like all
- 40:21cutting edge features, you know? Then we found this out from
- 40:23other people too, like, Ohh, hey, like we always run Pytorch
- 40:26slightly internally and it's like, well, how does it break
- 40:29like all the time, constantly. Like we constantly have to fix
- 40:32it And it's like you know there's monkey passing and so
- 40:34there's this all this enormous complexity that gets added on
- 40:37because you're you're literally like, I mean it's like building
- 40:40an aeroplane while it's in the air and on fire and so like and
- 40:43somehow it can't crash. And if it does, you know you got
- 40:46to put the pieces back together and and take flight again, so.
- 40:50So yeah, I mean. It's it's constantly and then
- 40:53root causing that is huge right. Like getting in there and like
- 40:56Ashley figuring out OK it was this one line change or it was
- 41:00you know this monkey patch that we had or was this version
- 41:02conflict like we're using older CUDA kernel because we we we
- 41:06have a a mismatch on the base image versus what's running in
- 41:09the container. And like you know it's just like
- 41:11all these things like we we we overarching they call the
- 41:14undifferentiated stuff, right. Like a lot of people I think
- 41:18when they want to train at scale are like ohh like let me just
- 41:21try to get the cheapest number like the highest number of
- 41:23cheapest number of GPU's that I can from AW and I'll figure out
- 41:27the rest and it's like you've. Only solved.
- 41:31Maybe 5 to 10% of the problem, right?
- 41:33Like you're not even, you're like get out.
- 41:35Getting the GPU compute has been hard because of supply
- 41:38constraints. But longer term, right, I don't
- 41:41think that's the thing that's going to really create the value
- 41:44creation on top of this. Yeah, even now.
- 41:47Man, it's so funny you mentioned that because I think in the last
- 41:50week and a half I've seen three or four people have either come
- 41:55to me or I've seen posts about how, hey, we have excess or
- 41:59spare GPU capacity. In case anybody wants some.
- 42:03We're looking to fill up our GPU's.
- 42:06And yeah, yeah, it is very much like it.
- 42:09It reminds me of that classic paper by D Scully on Ohh.
- 42:13The model is only one part of the problem, and then you have
- 42:16all the infrastructure around it.
- 42:18GPU's are just another part of that problem.
- 42:20It's not like you get the GPUs and then everything is good.
- 42:23You're golden. You've got to really be thinking
- 42:26about each specific piece and how to efficiently take on each
- 42:31of these boxes, right? I mean it's.
- 42:34Like, you know, I mean, again, I'm a hardware guy, come from
- 42:36building chips. Like if you can't just buy an
- 42:38X86 processor and be like, cool, I have a computer, right?
- 42:41Like there's everything else that it has to plug into and
- 42:45you're you're all. I mean, don't get me wrong,
- 42:46building a chip is super hard and it takes a lot of people and
- 42:50time and money and resources to do it.
- 42:52But again, you're only part of the way there, right?
- 42:55If you, you got to, you got to put everything together.
- 42:58You gotta get the software just right.
- 43:01And then not only are we doing that for one box, we're doing
- 43:04that for, you know, hundreds or thousands at this point.
- 43:07And so you know, we we, this is adorable and I wouldn't quote me
- 43:11on this, but you know, we roughly would assume about one
- 43:14failure every thousand, couple thousand GPU hours.
- 43:18So when you're training on 3004 thousand plus GPU's, right,
- 43:23you're gonna see a failure like every hour, right.
- 43:27So and so that's the scale. And so, so and then think about
- 43:32like you're moving terabytes of data around, if not more.
- 43:36And so like resuming state takes forever, right.
- 43:40And so if you're failing every hour or couple of hours, like if
- 43:43it takes you 30 minutes to resume, you're wasting 10s of
- 43:47you know, you're wasting someone's salary easily a day if
- 43:51if you don't, if you don't make that stuff super fast, right.
- 43:54And so we call it the undifferentiated stuff.
- 43:57But to be honest, like do you want it?
- 43:58You know, like that's what I keep, that's what I tell
- 44:00everyone is like, do you want to spend your time there?
- 44:02Because like it, it's it's, it is very hard to get all that
- 44:05stuff, right? Right.
- 44:06Like you just want to go and buy, like you want to just go to
- 44:08Dell and buy a PC. Like why?
- 44:10Why would you? Why would you know very few
- 44:12instances where you want to build all of that on your own,
- 44:15hence. Why Davis stopped writing his
- 44:18newsletter and she. Probably focused on this.
- 44:22Yeah. Well, was it.
- 44:23I mean part of it is like that's the, I mean that's it, right.
- 44:25That's the value that we create like we we are like and and
- 44:30that's what's really different. I think about what we're doing
- 44:32is we're not just doing this once for a model and then
- 44:36wrapping it up behind an API where we're actually doing this
- 44:40once for ourselves. That's that's literally like I
- 44:43mean that's kind of part of my job is like I always say like my
- 44:45team is like you know, two sides of the same coin.
- 44:47One side works very closely with Davis and the research team.
- 44:50The other side is working with the product team and like our
- 44:53customers. And I think like our job is to
- 44:55like basically figure out how do we take this one thing that
- 44:58we've done, like we've pushed the envelope, we've developed
- 45:00these new capabilities, but then I got to rinse and repeat that
- 45:03another 100 or 1000 times on the other side, right.
- 45:05I got to make customers just as successful, if not more than we
- 45:08have been training models. And so that that's what we're
- 45:12doing. So all that pain and suffering
- 45:14that Davis was just talking about, right?
- 45:16Like we have to package that and productize it so other people
- 45:19don't face it right. I don't.
- 45:20Other people don't have to deal with it and it's a really nice
- 45:22experience for them and. Getting that consistency because
- 45:26it's. Like.
- 45:27You were talking about. It's like if you're.
- 45:30Out there and. You're adding the value of, hey,
- 45:34when we do create a model, we're going to ensure that it is of
- 45:38quality and that if there are these problems or these failures
- 45:44that are happening, we can at least make sure that we're the
- 45:48ones that are looking into them. And you don't have to do that.
- 45:51I think that's a strong statement that you're saying.
- 45:53And I do see the value in that 100%.
- 45:57Yeah, another. Surprising value proposition His
- 46:01with that it's extremely valuable to have a complete
- 46:07configuration that just works. O give me your question of what
- 46:12happens when you spend all this time training a model and it's
- 46:16just not good enough at the end. That's a really big risk for
- 46:20people investing, often millions of dollars training a model.
- 46:25So one of the surprising value for oppositions we've had is the
- 46:28ability to just hand people a configuration from images to
- 46:32hyperparameters to everything and be able to say, OK, just
- 46:36train this just pointed at your data.
- 46:40Maybe you could figure it a little bit if you have, say,
- 46:43really strong priors about some change that needs to be made and
- 46:48it'll pretty reliably work, as opposed to having to discover
- 46:52all of that. It's like it's.
- 46:53Like buying insurance for those training runs?
- 46:57Exactly. Just the.
- 46:58The reliability is so huge, especially for startups like
- 47:01you're a startup, you raise $10 million in cash and you send
- 47:046,000,000 trading. Your model.
- 47:07You know that kind of has. To work, you don't really get a
- 47:10second chance necessarily. And that's true both in terms of
- 47:15the MLS side like hyperparameters, and also to a
- 47:20lesser extent in terms of software.
- 47:22ANE like I can hand you 5 different code bases that all
- 47:28work, where all the tests ass and so on.
- 47:31But if you have to plug them together, the probability of
- 47:34your whole system actually working and not hitting a bunch
- 47:38of subtle subtle failures and version issues is very low O
- 47:42Having a happy path in terms of both hyperparameters and
- 47:47everything else that's necessary to make it work has proven to be
- 47:52surprisingly valuable for a lot of our customers.
- 47:55So there's another direction. That I want to go into since
- 47:58I've got you here and you both spend your days training models
- 48:05and thinking about sizes of models and architectures and
- 48:09models and then inference also once the model's out there And
- 48:13like I see you as understanding the system as opposed to just
- 48:19like the one piece. One thing that is very popular
- 48:23these days is a lot of people talking about how, OK, we've got
- 48:26the GT fours out there and those are great for when I want to get
- 48:31an MVP. But once I have something and I
- 48:35see that there's value, then I want to bring it in house and I
- 48:38want to make it faster and I want to make it more specific
- 48:43for that use case. I don't need the gigantic model
- 48:47that can do like 50 different things.
- 48:48I just need a much smaller model that is going to be able to do
- 48:53my one or two use cases, and so I think about.
- 48:59How people wrestle. With different questions, right.
- 49:05And it it's not just, I know there's a lot of interesting
- 49:08stuff whether it's like Ohh should we do rag or should we
- 49:11fine tune? And I'm not really even thinking
- 49:14about that. One question that I think about
- 49:16these days is. When do you say OK?
- 49:22I I want to train a model. Let's say that someone says I
- 49:25need to train my own model, but I just need like a 1 billion
- 49:31parameter model is. That even.
- 49:33Worth it? Are you going to see those types
- 49:36of like? Excel.
- 49:39Or are you going to see a 1 billion parameter model
- 49:42excelling in certain use cases if it is that very, very small
- 49:48model and or maybe it's that you say you guys advise, look, you
- 49:52know what, don't train a 1 billion parameter model from
- 49:55scratch. Let's take this model and let's
- 49:58distil it so we can make it 1 billion and it's going to be
- 50:01much faster. Like, there's all different ways
- 50:04that you can get to this end goal of how do we make it the
- 50:07most accurate and the fastest and the smallest as possible,
- 50:12but still hitting our needs. And so maybe you can, like, talk
- 50:19about all the different ways that you think through those
- 50:22problems these days, Yeah. I'll maybe I'll start high level
- 50:26and and then Davis, you know, you should fill in kind of the,
- 50:29the how to tune all of this stuff.
- 50:31But I think when we talk about like customers, I think what we
- 50:34see mostly is like, I think there's probably 4 dimensions
- 50:36that people really care about. And and it's really around like
- 50:39privacy, like privacy is number one for a lot of enterprise
- 50:42customers, like the most important thing.
- 50:46And. Privacy.
- 50:47It's like, yeah. I mean it's like I want to own
- 50:48the model. I mean I I'd love, you know not
- 50:50quite lumped in there but maybe said privacy and IP.
- 50:53Like I wanna I have unique data. I'm very good at solving this
- 50:56business problem. Now I fully subscribe that like
- 50:59hey if I'm not in this game I'm going to lose out like missing
- 51:01out on the Internet and you know in the late 90s or 2000s.
- 51:04And so I think people people kind of get that and they want
- 51:07to figure out how to deploy it. But privacy is like I want to
- 51:09you know I'm healthcare like I don't want to send by HIPAA
- 51:13whatever to the the the the sorry the rest APIs if you will,
- 51:17right the the private models because I don't know what
- 51:20they're going to do and and sure they can offer guarantees and
- 51:23all that but there's nothing like keeping it in your own
- 51:25house right. Like that's that's kind of like
- 51:26the main thing is is really important.
- 51:29The other is obviously quality which I think kind of you were
- 51:31you know kind of going and I think quality obviously
- 51:34especially open source like everyone cares about how do I
- 51:36get the highest quality at the lowest you know kind of model
- 51:39count. I want to run it on my laptop.
- 51:41I don't want an expensive GPU or something to run on and then.
- 51:44It's. Cost and performance and
- 51:46unfortunately like what it costs and performance and maybe all
- 51:48three of all four of these are not like completely independent
- 51:51variables, right. They're all kind of related and
- 51:53and you can kind of tune this entire space.
- 51:57But I think one of the other. Things that I think we really
- 51:59look at is. You know, if you look at like
- 52:02kind of. Like scaling laws, Chinchilla,
- 52:04right? That's good at telling you
- 52:05that's really focused on training, right?
- 52:07So for a like a given quality or or some some metric of quality,
- 52:12you know how much, What's the minimum?
- 52:14Amount of cost or. Compute that I have to spend to
- 52:18get there. But what those things?
- 52:21Said. That leave out and and actually
- 52:22like I had someone as part of the Mosaic team actually trying
- 52:26to bridge these two things together is, is the cost of
- 52:30inference, right. And so being able to like you
- 52:33know this is better to train as well.
- 52:34Like if you look at the difference between a 20 billion
- 52:37parameter model and a 30 billion parameter model, I mean it's,
- 52:40it's huge, it's it's actually over like 2X the cost and
- 52:44compute right, because it's, it's a quadratic relationship.
- 52:47And so I mean just think about a 1 billion versus 10 billion
- 52:50parameter model and so, so at the end of the day like you can
- 52:56over train a model and make it much cheaper to actually deploy.
- 53:00And in order to do that, you have to understand kind of all
- 53:03of it, right? You have to understand like OK,
- 53:05like what is the cost of deployment?
- 53:08If I, if I, if I train a 500 billion parameter model, like
- 53:13you know, it's going to be super expensive to serve.
- 53:16You know, if I need a lot of throughput, if I need a lot of
- 53:18users, do I need the generalizability that a 500
- 53:22billion parameter model, you know, if trained well can offer
- 53:25versus you know, some Can I get away with something that's a 30
- 53:28billion parameter model? And so I think you know, but and
- 53:32then I think the other part is the architecture of the model
- 53:34kind of helps here, right. This is why people start getting
- 53:36into like things like mixture of experts, where you draw out the
- 53:39kind of this compromise between model like parameter count, but
- 53:43also the inference cost goes down quite a bit.
- 53:47There's a lot of different. Jobs that you can tune during
- 53:50that you know and then also looking at like the amount of
- 53:52data that you have to collect. So, but yeah, I mean Dave is
- 53:55feel free to dive in. I just wanted to kind of say
- 53:57these are the dimensions, you know, that I think we generally
- 53:59see. Yeah, definitely.
- 54:03I think when making these choices, the basic framework is
- 54:08the same As for rolling out any sort of software or any sort of
- 54:12roduct feature, which is you should start with the simplest
- 54:15thing possible, and only if that's not good enough do you
- 54:20proceed to something more sophisticated.
- 54:23So if you can just query a third party API and that's good enough
- 54:28for your use case then you should probably just do that.
- 54:32Then if you have say privacy constraints or cost constraints
- 54:37or maybe latency constraints that maybe you deploy your own
- 54:40pre trade model. Let's take a generic mixed role
- 54:45or lawn or whatever it is and just put that behind an API and
- 54:51that. If that's not quite good enough,
- 54:52OK, maybe curate some in context examples to give it a better
- 54:57prompt. Try to squeeze more quality out
- 55:01of it, and if that's not good enough, maybe hook it up to a
- 55:04retrieval system, depending on the latency you have and how
- 55:08much complexity it adds to get that set up.
- 55:11And if that's not good enough, maybe fine tune it on a little
- 55:14bit of data and that's not good enough.
- 55:17Swap out a bigger bottle, maybe pre train your own model to a
- 55:22much larger scale, fine tuning or even continued retraining.
- 55:27The size here is a little bit of an open question, but there
- 55:29definitely seems to be alpha in doing some sort of domain
- 55:33adaptation with a retraining regural next token reduction.
- 55:39Retraining objective could be followed by fine tuning or
- 55:42something like ROHFF. So you're keep adding layers as
- 55:47needed rather than necessarily saying here a priori is the
- 55:53exact set of features or the exact pipeline we're going to
- 55:58need to hit this target. Unless maybe somehow you can
- 56:01forecast that this is so. This is such a good point and it
- 56:04reflects something that Sam who we had on the podcast probably
- 56:09like 2 weeks ago was talking about.
- 56:11And I mentioned it to you guys before we hit record.
- 56:13But it was along the lines of I haven't met a lot of people who
- 56:18said damn, I wish I would have architected a more complicated
- 56:22system. And this comes back to that
- 56:25exact point where it's just like if you can get away with just
- 56:29calling an API, do it. Don't even worry about like
- 56:34setting up any link chain or lum index or any of that.
- 56:37Like it's just the straight call to the API and you can get value
- 56:41out of that. Yeah, do that and try and go as
- 56:44simple as possible. And then I really like this idea
- 56:48of breaking down the levels of complexity that you've seen.
- 56:53And so you're like, alright, well yeah, there's API, there's
- 56:56alright then you can potentially bring it in house, you can set
- 57:01up a rag if you want. You can set up some fine tuning.
- 57:06You can try and go a bigger model if that's going to, if
- 57:10that's where you need to see like everything just to try and
- 57:14hit a little bit better accuracy on that.
- 57:19And we can't forget this idea that you're talking about
- 57:23Bendish is like. All of that's great.
- 57:27If you understand what the problem you're trying to solve
- 57:31for is, because otherwise you're just shooting for something that
- 57:36you don't know if it's actually that good or not, right?
- 57:39You're just saying, well, we could probably do better, but
- 57:42better against what? What is it that you're trying to
- 57:44solve for? Because you could always do
- 57:47better, right? Yeah, and.
- 57:49Some of this, by the way, translates to, I think, like
- 57:51almost organisational complexity and sophistication.
- 57:53Like, I think, you know, a lot of times there's a lot, there's
- 57:57so much information out there right now about this.
- 57:59And I think that it takes time to like, build and foster this,
- 58:03this type of expertise, right. Like we.
- 58:07We we spent a lot. Of time thinking about like the
- 58:09audience, right? So like we internally were like
- 58:12hey like when I when I talk to my team it's like Davis and the
- 58:15research team is customer 0. But what our internal research
- 58:20team does is like vastly different, right.
- 58:23Like this is you know like what the labs are doing the
- 58:27state-of-the-art all of that when we expose these prop these
- 58:31things as products to customers they have to be significantly
- 58:34simplified and streamlined for people.
- 58:36You know like we were talking about defaults earlier like I
- 58:39cannot like like like undervalue like the the it's just the value
- 58:45of a good default is massive right.
- 58:47If I if I actually like probably.
- 58:48And I I would guess if I looked at all of the configs that we
- 58:51look at and I just dipped them all and like looked at how many
- 58:55changes there were. Like there's a few like you
- 58:57could have hundreds of lines of a config and just probably see
- 58:59maybe a dozen lines change because people don't change that
- 59:03much stuff right. Like and and I, I frequently
- 59:06hear when I share with customers like, hey, like we just, we we
- 59:09did all these sweeps. It was like super expensive.
- 59:13But then we just use your defaults and they were like the
- 59:16best convergence that we were able to get.
- 59:18And it's like, yeah, because we like did that for you, right?
- 59:21Like we did all these sweeps and we've tried like to find good
- 59:25defaults, right. And so I think, but that's
- 59:27another way of breaking down that complexity.
- 59:30But I I would say like exactly what you're kind of saying,
- 59:33right? Is like if I'm just prototyping.
- 59:35If I'm trying to understand my problem, don't.
- 59:38Don't train A. Model like just start with
- 59:40something out there, right and and and only do it if like you
- 59:43think that solving the problem necessitates that customization.
- 59:48And I think what we see with most customers is they start
- 59:51small like the the ones that are the most successful like and you
- 59:55know we've written about like the reports we've done like you
- 59:57know several different customer stories out there like they
- 1:00:00start small, they start out like 1 billion, three billion
- 1:00:02parameter models. They work their way up
- 1:00:05internally. We do that too.
- 1:00:06That's how we manage complexity. We do like a bunch of small
- 1:00:09gating runs to like get things in a place where, OK, we can now
- 1:00:13like predictably understand that hey, if we were to like double
- 1:00:16the parameter count. Where would we go?
- 1:00:18Right. And I think as you continue to
- 1:00:20build that expertise as a team, you can take on more of these
- 1:00:25challenges, right. And then I hope you know also
- 1:00:27from the complexity standpoint, the tooling gets better.
- 1:00:30We're building different techniques that people can start
- 1:00:33using and deploying at scale, right, to actually improve the
- 1:00:36quality and several of those dimensions that we were kind of
- 1:00:38talking about. But I think yeah, I mean.
- 1:00:41It's just this all comes down to managing complexity.
- 1:00:44You know, you don't have to go train a 100 billion parameter
- 1:00:47model like on day one. You know, like.
- 1:00:50Don't. Don't be that person who goes to
- 1:00:51your like CTO or CIO or whatever it is like, ohh, yeah, you know,
- 1:00:55we're going to do this because like if you don't, if you
- 1:00:57understand it, you're just going to waste millions of dollars
- 1:00:59basically, yeah. Yeah.
- 1:01:02And you're not going to be in that job for too much longer,
- 1:01:04that's for sure. The, the one thing that I also
- 1:01:09wanted to dig into is the complexity on the data side and
- 1:01:14just like how hard it can be with the data pipelines because
- 1:01:19we all know and we've heard it like a million times, Ohh data
- 1:01:23is your mote, right. And so you still have a lot to
- 1:01:27do on the data side just in general I think and a lot of
- 1:01:33times that can be overlooked. So maybe like Davis, have you
- 1:01:37seen good ways of data pipelines being efficiently thought out?
- 1:01:43Or where are there parts, bottlenecks, areas that fail all
- 1:01:49of that fun stuff too? Yeah, there.
- 1:01:51Are so many pitfalls and potential failures here.
- 1:01:57So. A lot of it is just true of all
- 1:02:01of machine learning and data science.
- 1:02:03And data engineering is hard. Getting good data is hard,
- 1:02:06cleaning data is hard. And a lot of this holds
- 1:02:10independent of whether you're training LMS or doing any sort
- 1:02:13of large scale machine learning. In.
- 1:02:17The context of alms. You do hit a few extra problems
- 1:02:24that you may not have seen if you've been doing more
- 1:02:28traditional data science. One that sticks out.
- 1:02:31Is tokenization O? We don't train models on the raw
- 1:02:37UTF 8 or whatever encoding you have in your documents.
- 1:02:41We split the documents U into what we call tokens O, like the
- 1:02:46suffix Tihon might be a token, or those probably a token,
- 1:02:51right? It's this algorithm for
- 1:02:53splitting text into unique identifiers, and that process
- 1:03:00his has many subtle pitfalls, as many tokenizers, for example
- 1:03:07allow you to generate just completely invalid bytes.
- 1:03:13So you might have some amount of outputs that are just not UTF 8
- 1:03:16at all. You will also get weird
- 1:03:19coalescing of stuff like white space with other characters, so
- 1:03:23maybe like colon isn't a token. Colon space is a token.
- 1:03:27So we've had issues, for example, when trying to get the
- 1:03:31Falcon models to do math where we just could not get them to
- 1:03:36produce anything useful. It's just garbage.
- 1:03:38And then we realised, oh wait, we need a space at the end of
- 1:03:42the prompt. And then everything started
- 1:03:45working. There's.
- 1:03:47And that's not even. That uncommon?
- 1:03:49That's not some weird quirk of the Falcon models.
- 1:03:51We've had evals that work this way.
- 1:03:54We've had bug fixes in our evaluation programmes with that
- 1:04:00say add 10 or 20% accuracy once we fix them so.
- 1:04:04There's. All sorts of pitfalls there.
- 1:04:09There are also a bunch. Of challenges associated with
- 1:04:12even loading your data at scale. So if you've only operated A
- 1:04:19relatively small scale, you might be used to just loading
- 1:04:22your CSV file or whatever. Everything just runs on your
- 1:04:25laptop. You just point your spark
- 1:04:29programme and have ark file in 1/3 bucket, whatever.
- 1:04:34But when you have a sufficient number of nodes loading a
- 1:04:38sufficient amount of data, you hit a whole bunch of weird
- 1:04:42requirements around deduplication.
- 1:04:45Like you can't have different nodes request the same data.
- 1:04:48You're going to be requesting the same data 2000 times, and
- 1:04:51then your egress fees might actually matter.
- 1:04:53If you're in a remote object store or it's just incredibly
- 1:04:56slow. You also need to shuffling, or
- 1:04:59it turns out you get subtle convergence issues if you ever
- 1:05:02see your loss curves going up and down, probably you have bad
- 1:05:06shuffling. We call those runs away, boys.
- 1:05:10There's. Also, issues with resumption.
- 1:05:15If you want to load data at scale, like your job crashes and
- 1:05:19then you want to restart it, well OK are you going to
- 1:05:22redownload your data set from scratch?
- 1:05:24What happens if you want to on a different number of nodes that
- 1:05:27completely screw up your shuffling?
- 1:05:29There are also whole bunch of issues along those lines that
- 1:05:33make it such that you kind of need to use some library for
- 1:05:37this. We have one.
- 1:05:39I know other people have attempted to write them, but you
- 1:05:42just said a whole bunch of subtle pitfalls here that you
- 1:05:44may not be used to thinking about and how.
- 1:05:47Much of these like translate over to Alright cool, I want to
- 1:05:50fine tune a model. So a lot of it.
- 1:05:55Is a matter of scale rather than whether you're pretraining
- 1:06:00versus fine tuning, because fundamentally pre training
- 1:06:03versus fine tuning is kind of just a different loss function.
- 1:06:06Unless you're doing AHF, then you're using O.
- 1:06:11Things get a little more strange because there's a reward model,
- 1:06:14but I think very few people are actually doing RHF at this
- 1:06:18point, at least on on their own. So.
- 1:06:24It's more a matter of scale. Like if you're training
- 1:06:26something on 2 nodes and you have redundant downloads and
- 1:06:30your data set isn't that big and you can just redownload it every
- 1:06:32time the job crashes, then you can dodge a lot of this
- 1:06:35complexity. You don't have to worry about a
- 1:06:3830 or 60 minute ramp up time when your cluster doesn't cost
- 1:06:421000 cost thousands of dollars per hour.
- 1:06:45Yeah, but yeah, you'll hit a a bunch of barriers as you scale
- 1:06:49up, You know it. I'll put this.
- 1:06:51Another like it was interesting I think for me, and I was I
- 1:06:55think blissfully naive about, you know, data in general until.
- 1:07:01First of all, we scaled. And and and and I just don't
- 1:07:04mean scaled in terms of computing infrastructure but
- 1:07:06like we had to scale our token count to train you know pre
- 1:07:09trained useful models. But.
- 1:07:11Also you know then this little company called Databricks
- 1:07:15acquired Mosaic and new type of. Skill.
- 1:07:19Yeah, new new type of scale. But I mean, you know like
- 1:07:21managing data at scale and doing AI at scale, there's
- 1:07:25similarities, there's differences.
- 1:07:27But what I what the, the the kind of thing that drove at home
- 1:07:30for me was we had these data pipelines that you know do
- 1:07:33things like deduplication and filtering.
- 1:07:35And some of these things would take like hours, maybe days
- 1:07:38depending on like what we were, you know, kind of doing when we
- 1:07:42brought him in. And kind of you know basically
- 1:07:45we just went to the horde of like you know field engineering
- 1:07:47and kind of spark experts at Databricks and we're like help
- 1:07:51us how do we make these faster. And we got it down to like you
- 1:07:54know something that took days down to like a couple of hours.
- 1:07:57You're like, wow, like you know we're we're not you know we
- 1:08:01didn't start this data engineers you know and and it was like one
- 1:08:04of these things we're like, OK if you use the right tool for
- 1:08:06the job, if you if you use the system that's built to process
- 1:08:10data at scale. That's incredibly.
- 1:08:13Important and and I think when I you know driving it back like a
- 1:08:18couple. Enterprise.
- 1:08:18Is actually like a lot of customers like have a lot of
- 1:08:21data and so that whole pipeline, that whole ETL processing
- 1:08:26pipeline that you have to do, like there's this whole problem.
- 1:08:30Of. Like getting that data and then
- 1:08:32like whittling it down to like the Super high quality data in
- 1:08:35the right format that you actually need to do different
- 1:08:39types of training right. Like retraining kind of just
- 1:08:41takes just feed in all the text you can get right.
- 1:08:43But then you have things like instruction fine tuning.
- 1:08:46We're now you need to craft like proper response pairs.
- 1:08:49You want to add instructions on top of things.
- 1:08:51You might want to augment your data.
- 1:08:52You might want to like create synthetic data to add additional
- 1:08:57data and get your token counts up.
- 1:08:59So. There's like this whole.
- 1:09:00Sophisticated pipeline that I think is emerging that also has
- 1:09:04to happen at the scales that we're talking about.
- 1:09:07To actually be able to. Train like a really high quality
- 1:09:10model, right. So that's that's why this is
- 1:09:12like this is like this was such a big, you know, like a match
- 1:09:15made in heaven, right. It's like there's there's this
- 1:09:17gravity to data and this this gravity because of the scale of
- 1:09:22data that you know it was very interesting to look at like OK
- 1:09:26like is data going to kind of migrate to to training computer
- 1:09:30is training computing to migrate to data and kind of turns out
- 1:09:33like we just have to build a bridge between the two like the
- 1:09:36the gravity of both is very massive and and and that bridge
- 1:09:39that's what we that's what Davis was alluding to.
- 1:09:41Like we have this kind of data loader that now we're working on
- 1:09:44like really, really super optimising to kind of like move
- 1:09:46between these sort of these data processing compute clusters and
- 1:09:51as well as like our training clusters, right.
- 1:09:52So I think getting all of that right again is like one of that.
- 1:09:55It's like, you know, we say maybe it's the undifferentiated
- 1:09:57stuff, but it's the Super hard stuff at the end of the day and
- 1:10:00when it works, it's like magic, so.
- 1:10:03And you guys are lucky. I think you have probably some
- 1:10:05of the best Spark engineers in the business that you can lean
- 1:10:09on. Yeah.
- 1:10:10So it's like I imagine a lot of people wish that they had that
- 1:10:15type of person that they can just go and ping for questions.
- 1:10:19On the data engineering side, yeah, I'm.
- 1:10:22I'm also thinking about though, like when it comes to data
- 1:10:26quality, we hear that term being thrown around so much and.
- 1:10:33When you're. At this scale that you're
- 1:10:36talking about, like, how do you even deal with data quality?
- 1:10:40How can you ensure that the data quality is like the highest
- 1:10:44purest form? It's super hard.
- 1:10:49I think the core of the answer is look at your data.
- 1:10:54Sadly, there's there's really no substitute for that.
- 1:10:58You'll find all sorts of horrific things happening, like
- 1:11:02you might find that all of the tables and all of your markdown
- 1:11:05files got stripped away by whatever preprocessing you have
- 1:11:09O the textual reference table one and there just is no table
- 1:11:11one. I You'll see all sorts of
- 1:11:15horrific things like that, and it's also hard to manually.
- 1:11:19Looking at your data to some extent.
- 1:11:23If you're randomly sampling, there, at least initially, is
- 1:11:27probably enough broken stuff that you will find errors if you
- 1:11:32sit and look at your data. There is also some amount of
- 1:11:35stuff you can do at scale, but automating it is awfully
- 1:11:40difficult because every data set is ugly in its own way.
- 1:11:43Every data set needs to be cleaned in its own way, and what
- 1:11:47good data even means is going to depend on your exact problem.
- 1:11:52So there's some stuff. You can do like you put in some
- 1:11:55filtering heuristic and that gives you a subset of your data,
- 1:11:59and then you're training a simple model on it.
- 1:12:02And maybe if the number is higher than it was with the
- 1:12:05different subset of your data, you conclude that your filtering
- 1:12:08heuristic was helpful. But even that can be very
- 1:12:11difficult because one of the things we've seen and other
- 1:12:15groups have seen is that you don't get that much signal and
- 1:12:18data quality until you're operating a pretty large scale.
- 1:12:21You need pretty good models in many cases to.
- 1:12:26Have data. Quality and or quantity become
- 1:12:29the bottleneck. So it's not something where you
- 1:12:32run it on your laptop in 10 minutes like ohh, the SVM got
- 1:12:3693% accuracy instead of 91. And so we trust that as a
- 1:12:39reliable signal, more like, well OK, that was a GPU week of time
- 1:12:47on 7 billion parameter model and it kind of seems like it did
- 1:12:50better. And if you throw enough
- 1:12:53computer, enough experiments at it, you kind of get a feel for
- 1:12:57what's working. But the over stuff you can be
- 1:12:59confident in is usually when there's just an outright problem
- 1:13:02that you can programmatically fix, like all the tables getting
- 1:13:04dropped. Yeah.
- 1:13:05There's there's talk about the horrific stuff that happens like
- 1:13:09when you're doing some processing, there's also just
- 1:13:11horrific things and data sets. Like, you know, I mean, I can't
- 1:13:15something like, please like pay your data engineers more because
- 1:13:19they have to go through this stuff and sometimes you just
- 1:13:21have to like like imagine like getting into the depths of the
- 1:13:24Internet, right. It's like it's there's just some
- 1:13:27stuff in there that like just the depths of.
- 1:13:29Reddit. Yeah, these poor folks have.
- 1:13:31To go through and and get you know, figure out what to do with
- 1:13:34it. So it's so.
- 1:13:36Funny, we need to create the Data Engineer Appreciation Day
- 1:13:40and we cry need two of those a year.
- 1:13:43It's not enough to just have one.
- 1:13:45They have really gotta have to fellas, this has been so
- 1:13:50awesome. I really appreciate the both of
- 1:13:52you coming on here and schooling me on this and just like taking
- 1:13:58the time to break this down, it was fascinating from my side.
- 1:14:04I love what you are doing and Mosaic.
- 1:14:06I know that you've got all kinds of fun stuff lined up that
- 1:14:10Denny, our mutual friend who also is working at Databricks
- 1:14:14project and he is. He keeps dropping bread crumbs
- 1:14:18about how you're coming out with some really fun stuff really
- 1:14:22soon, but he doesn't share anything else which is killing
- 1:14:24me. So hopefully we will be able to
- 1:14:28show off what you all create in the near future.
- 1:14:31Yeah, we can't. Wait to share it with you and it
- 1:14:33was thanks for having us this was this was so much fun.
- 1:14:35Thanks, tonne of. Fun.
- 1:14:39Yep. And Davis, I'll.
- 1:14:40Be patiently waiting for when the GPU training jobs go down
- 1:14:44and you get back on to that newsletter.
- 1:14:48Yeah, definitely. That's how you know something
- 1:14:50big is coming. Yeah, yeah, Davis puts that puts
- 1:14:53it out. You're like Ohh man mosaics
- 1:14:55gonna, you know mosaic database gonna drop something here is it?
- 1:14:59He got a rest just. Ohh Classic.
- 1:15:03Well, thanks fellas.