Bringing Decades of DevOps Experience To Deep Learning

Jesse Freeman · Reversim Summit 2019 transcripts · Markdown

Machine transcript. It can contain errors. Click a time to play the video from that point.

00:10 So, um I guess I'm one of the uh few English-speaking presentations. So, hopefully you can follow. Um cuz I've seen some pretty slides, but I haven't been able to really understand much. Um so, that being said, I'll try to speak as clear as possible, but I'm from New York, so hopefully my accent doesn't get uh in the way. Uh, the idea behind this talk is really something that we're trying to figure out how to take these concepts that we've seen in DevOps and apply them to data science. And what we're seeing in data science is that there's really no automated systems for understanding how to automatically deploy code, automatically commit and validate it, uh, how do you automate systems. And the idea of taking the notion of what DevOps is for the development world and apply it to deep learning to DevOps is something that we're very interested in. So, uh, as you heard in my introduction, I'm Jesse Freeman. Um, and I'm a chief evangelist at Missing Link, which is a local company here uh, in Tel Aviv. And

01:36 my background actually isn't in, uh, in computer vision or deep learning. Uh, I come from software development. So, um, I've been in New York for a long, long time, and I've built everything from, uh, Aristo Records websites for Pink, Usher, Outcast, name a music artist, I probably built their websites in the early 2000s. Uh, I worked for the New York Jets, which was a American football team, like a football, um, team. Uh, Major League Baseball, um, our other big pastime. Um, but I've also built everything from, uh, huge enterprise apps for banks, uh, to mobile apps. I built HBOs, uh, one of HBO's first mobile apps. And the list goes on and on and on. And I've built a lot of these big software, um, uh, sites and apps, and then got into gaming. So, for the past eight years, I've been doing stuff at Microsoft and Amazon doing gaming. And I've always been really fascinated with AI and deep learning. Um, but the challenge is, is that I've always sort of not understood how to get into it. And a lot of it's because where I come from, it just the tools don't seem as robust as what I'm used to in the development side of it. So, uh, one of the reasons I joined Missing Link is because they're doing something that I relate to very well, which is the idea of automating uh, deep learning. And a lot of the stuff that I did in my own software development really came from the idea of automating. So, I would automate all of my code. I have stuff that I'm so obsessed with automation that I even have uh, Google scripts that will take my code and automate them and turn them into tutorials. And I really love this concept of we have these really great things that are machines, and they can do your bidding for them until they take over the world and then reverse that on us.

02:57 Um, but what I really want to talk about sort of is what I'm seeing today in the struggles that data scientists have and um, we'll do a little exercise. If everyone can close your eyes or if you're not comfortable, maybe like close one eye, and think of a time where you were working on a project and you lost it, or if you're not a developer, you were trying to find a photo and you deleted a whole bunch of photos, or just think of like the worst experience you've had with a document or any important file and that you've lost it. And now take that thought and apply it to something as critical as trying to detect cancer, uh, to trying to detect uh, dangerous areas in maps, uh, to anything that computer vision and deep learning is trying to solve right now, right? We wouldn't want to have the people who are creating these types of solutions lose their data or not be able to reproduce those examples. And that's sort of what's happening right now. Um, because the the challenge is that in order for data scientists to actually do the science part of their job, there's a lot of work that they have to get to. Um, a lot of it's just the understanding the notion of how do you set up a computer in order to actually run your experiments? How do you manage all the data? How do you go through all of the logistics to just actually getting into the algorithms and getting into the training part of it.

04:17 So, a big part of this really is the uh, concept of training a model, right? And this is where the the meat of this exists. Now, the challenge is that as a data scientist, you're probably running hundreds of experiments. You're probably running them uh, a couple a day, depending on how long these experiments run, they may run over the course of a couple of days. And the challenge is is that uh, since these take so long to run, sometimes you don't know there's a problem, or in order to speed up your development, you may need to train multiple models at the same time or go back and forth and test them. And this winds up with a lot of repetition over and over again. But when something breaks, it's incredibly hard to backtrack from that process and really understand what went wrong. Um, especially if you need to go back and compare two different experiments and if you're not keeping really good notes, if you're not really versioning them well, you run into the risk of you might lose your work. And I'll keep talking about this theme constantly. Because uh, when it comes to training a model, if you're trying to debug it, it's not like regular programming. It's not very easy to go through and debug all of the steps because of the way that it actually is going through the training process.

05:29 So, maybe the model had the bug, right? Uh, which version of the model did I actually use? Um, what what were the changes? Uh, each model has different changes, right? Am I tracking those changes? Um, what if the training data itself actually had the problem? Um, and then the list goes on and on. Which version did I use and who actually on the team made those changes and can I reproduce those changes? And unfortunately, right now in the space, it's really difficult to answer these. These shouldn't be really hard, um, problems to solve, but a lot of the times, since data scientists don't come from an engineering background, they may not know the best practices that engineers have been using for years. Also, it's uh, really a challenge for a lot of data scientists to coordinate computers. And we're seeing this in companies. Um, I'll talk about some fun examples that we've we've learned from other companies we've talked to and what they're doing currently, but a big part of this is if you're trying to scale your deep learning, you need multiple computers and you need to recreate the same environment, you need to be able to reproduce that.

06:33 You need to get the data on there, you need to train it, you need to do all these things and you need to scale that over and over again. And it's really hard to coordinate that, especially if you don't come from a DevOps background. And perhaps the last and most challenging issue is actually reproducing an experiment. How accurate can a data scientist reproduce an experiment? And to give you an example, let's say you're doing medical research and if you're being audited because something went wrong, can you go back months or a year to how you exactly trained or tested that model to the exact specific specifications and reproduce that to see what the problem is? And this is something that we're going to see a lot more in the space is that as deep learning gets more technical into more like serious issues, uh, you're going to have to be accountable for it and being able to reproduce and validate those experiments and explain them to the people who are looking for answers, especially uh, government bodies that are looking to validate it, is going to become a big problem.

07:33 So, a lot of this brings us to the idea of these things of AI first companies, and this is a really big buzzword in the industry, but really right now the big AI first companies are you're thinking Facebook, uh, Uber, Amazon, Microsoft, Google, all of these big companies that have huge infrastructures that can do all of this in-house. They have their own frameworks, they may be releasing and open-sourcing them, they may have a closed source. But these companies have the tools to do it. And what we're seeing is that there's a lot of new companies that are springing up who don't have the same resources, but they want to be AI first companies, too. A lot of small startups that are dealing with large volumes of data or services to other volumes of data, and they need to be able to reduce the cost of experimenting, that they need to be able to reproduce these things correctly, and also that they need to scale it and do it in a way that they can handle versus companies that have infinite resources to to throw at these solutions. And at the end of the day, when we talk to data scientists, a lot of the problems that we see when we peel back the surface is that it's sort of a tangled mess. How they're doing it, there's no consistency right now.

08:39 Everyone has their own way of doing it, everyone's using their own framework, even worse if you're trying to change frameworks or you see you're going down a path, it's very hard to change that. So, how do we fix it? Well, if we look at what the tools are that they're using, the reality is that the tools are just really primitive right now. This is still in the early stages. When I started experimenting with this and getting into it, I was really shocked to see that most of it is around SSH. You're doing stuff on the command line. There's no IDEs that really help automate this. The frameworks are getting better and they're allowing more people to come in and do it, but it's very hard to just get everything up and running if you're new or keep it running if you don't know where the problems are underneath the hood. So, we'll take a quick step back because this is a common problem that we see in software development. Um, it's so common that not only did I see it just from software development for web development for 25 years, um, it actually goes back even further. And when we think about the beginning of this, um,

09:41 Most people here probably think of the first computers are around like the 1940s, these really big main frames, rooms this big and punch cards and stuff like that. But if we actually go back a little bit further, the first computer that we know of that was ever built and shipped was the Antikythera mechanism. And this is a Greek device. This is what it looks like today or what's left of it. Um and what's interesting about this is that this was accurate to the point where it could predict the um moon, the orbit of the moon around the earth, which is a little bit irregular. It can predict the position of the sun and it could also predict eclipses decades in advance. And this, you know, was built by the Greeks. We had no idea that this thing even existed until it was found in 1901. Because it was lost at sea 2,200 years ago. And like a lot of software that's designed and developed rapidly, um it wasn't documented. Nobody knew it existed. So when it was lost, when the only version that we know of was lost, no one knew how to reproduce it.

10:45 And machines like this weren't reproduced and built again until the 14th century. So if you think about it, the first machine was actually lost while being shipped at sea. And there was no way to reproduce it or rebuild it, right? And we shouldn't have that same problem 2,000 years uh into the future, right? And if you go back even just 30 years ago, computers were tied so closely to the software that ran on it in order to get a new uh operating system or a new update to your computer or or whatever the machine was that were running it, you had to buy a whole new machine, right? And this was a big problem. And it wasn't until recently that software has gotten a lot better. And the idea is that there's a big shift back in the 90s um towards these larger software teams. So most people think of this analogy of like Steve Jobs and Steve Wozniak uh building the Apple computer in their garage, right? Uh and a lot of companies grew out of garages, right out of their home, right out of their basement.

11:46 But by the 90s, software became so complicated that it was impossible for one person or a small team to do it. You needed these much larger teams. And as these uh pieces of software grew, they wound up getting split into two different branches. Uh there was a group of developers and their job really was to push the software forward. They're the ones who added new features, they're the ones who innovated, and inadvertently, they're the ones who actually also made the system a little bit more unstable. Then there was operations, and these were the these were the people who ran the servers, they ran the machines, they ran the deployment, and these two groups were separate and at odds because operations' whole point is to keep everything stable. So you had developers pushing one way to push things forward, but making it unstable, and operations trying to push back the other way to keep things stable. And so sort of from this uh friction between these two groups became the evolution of what we call DevOps. Um, but it's a little bit more special than that.

12:47 It actually grew into something that now is a actual culture. And so um the So the idea behind uh DevOps really is this idea of practices that allow you to automate software development in a way that's completely consistent and reproducible, and that when you deploy it, if you detect a change, you're able to bring uh that back, fix it and go back into deployment. And the whole goal of it is to always make sure that you're maintaining the highest amount of quality. Bugs happen, things happen. Nobody's perfect, right? But you have to be able to fix a mistake in order to keep things as stable as possible. And so this really gave rise to this idea of a test-first culture. And it started on the software side, where developers started saying, you know what, I'm not 100% sure my code's going to run, or I'm building a very small piece in a much bigger system. How do I test and validate this? And so we wound up coming up with these ideas of automated testing, being able to commit a piece of code, have it run through test and have it actually validate that, okay, we're like 99% sure that if we push this into the bigger piece of software, everything is going to run.

14:00 And over time, as we got better and better at this, we really started automating it. And we made sure that every aspect of the development side was automated, building the testing into the tooling itself. The tools got better and every time we compiled and deployed, the developer was sure that the code was going to pass the test and that it would go out correctly. And these two things really came about because of the automated testing that was starting to get developed recently and version control. And Git, which we sort of take for granted now, really is the most modern of the version control systems and version control systems have been around forever, but it wasn't until Git really sort of made a easier way to distribute software, an easier way for other developers to integrate and an easier way for actually to validate the the the actual code you're writing, that this started taking off. And what we started seeing was this huge shift from one, thinking about shipping the machine itself with everything on it and that's it, to shipping large pieces of software to what we see now, which is shipping much smaller pieces of software.

15:08 And so there's a 2018 report, a Dora report, and companies that ship um smaller uh updates have a less than a 7% chance of failure versus companies that do much larger updates, they get almost a 50% failure rate. And this is a huge shift in thinking. You might say, well, of course, if I ship if I ship little changes, there's a better chance that it's going to succeed because I'm not dealing with so many moving parts, right? But it took a long time for us to get there. And it really is clear when you look at Netflix and how they think about DevOps. So in 2018, uh Netflix uh went to a conference and spoke about how they can consider DevOps part of their uh company and what they said was really kind of earthshattering to the way the software is currently done. It's the idea that they're actually pushing out thousands of meaningful changes daily. And you think about that, right? We we went from simple changes uh based on machines to now all day long they're constantly pushing out changes, constantly pushing out fixes.

16:12 And this is a huge shift. But what really happened, right? How did we get here? And it's because over time we were able to empower the developers themselves to be responsible for validating and shipping their own code. Instead of for a developer having to wait for a DevOps person to go through and give them permission or push the code live, each developer is able to do that. And what happened is that companies like Netflix actually built this into the culture of their company. And there's a difference between having a set of standards and a culture. Because the culture means that everyone is responsible for this. Every developer is responsible for their own piece of code and their own change. And when you distribute this, what winds up happening is that every engineer also feels empowered to not only make that change, but to also be able to fix it if something goes wrong. And who better to actually fix the change than the person who wrote it themselves?

17:12 So that's sort of a a summary of how we got to the idea of DevOps. And now I want to introduce you to the concept of how do we take those same ideas and instead of empowering developers, how do we empower the data scientists? And I see this in a lot of meetings. Whenever we're meeting with companies and if we're talking with the engineering side, they're always like they get it immediately, they understand exactly what we're trying to tell them. But data scientists sort of have their own way of doing it and they don't understand these processes. So to make things sort of simple, the way that we sort of bucket the idea of deep ops is into three categories. And it really revolves around the code, the data and the computers themselves. So we'll start with the code side of things. Now, we all sort of understand the concept of tracking our changes, right? Um this is pretty common. Everyone's using version control, I hope, right?

18:13 If not, you're throwing it in like Dropbox and praying that that that works. Um, but data scientists may not be versioning and a lot of the times they're making all these iterative changes, right? They're changing a hyper parameter here, they're adding a layer here, and it's a lot of changes back and forth. So how do you track all of those changes? So, um I love the story. One company that we spoke to, they actually make all their data scientists uh write down on a piece of paper, the most analog thing possible in this day and age, um and they have to write down what they did, what the experiment was and why and they share it. So this is a about 100 data scientists are doing this process. Um so they're working on the most advanced AI stuff imaginable, using the most arcane process possible, right? Um and even worse is there's no knowledge transfer. Um if you look at it on a very basic level, just for me getting started, uh in in computer science, like I just try to download someone's example code and there's no real way to reproduce it exactly how that person had the environment set up.

19:21 There's no real knowledge transfer. There may be a read me file, there may be something very basic. But the reality is that if you're dealing with really complicated projects and a data scientist leaves and another one comes in, how do you transfer that knowledge? This is a big challenge in development. Especially imagine, you know, you're dealing with these complex models and all you have is just a collection of built trained models, uh data and a bunch of computers that may not run again. So, you know, what we see is that if if the data scientists aren't actually tracking what they're doing, they aren't committing their code, they aren't keeping up-to-date and in a way that's documented well enough to share with others, the risks are pretty obvious, right? You just lose all your work. Everything can just fall apart at any moment. So, one of the things that we believe in really is automating it. And so here's an example of a project I'm running. Um, so coming from my gaming background, I don't know if anyone here is an old Mac fan, there's a game called Marathon and Marathon was the precursor to Halo.

20:23 And one of the cool things about that game is that you could uh, um, you walked around it sort of like Doom, but the story was all in these little computer terminals. So you went up to a terminal and you read the story. So what I've been doing is training a model. I've taken all of the terminals from the original Marathon games and I'm training the model to create new stories for a text adventure game that I'm basing on it. Because I'm trying to see, can I teach a machine to build text adventure games, right? And it's taking me a lot of time because it has to go through a lot of uh, has to go through a lot of text. Um, and as I'm going through and training, there's something that um, I want to show. Every time that I actually go through and train the model, every time I run the experiment, there's a few things you see on the bottom here. First, it's always keeping track of the command that I'm running, so I know what scripts were running. Um, then it also actually commits the code for me. And every time I run the command uh to train, it automatically commits that version of the code, so I don't have to think about it. And then we keep track of some other stuff.

21:24 But really, this is how I want the system to be. As a person who doesn't feel like committing a code every time I want to run an experiment, or if I'm running several different variations of it, I just want to have it automatically done. So this is all being committed to a shadow repo, and I don't have to think about it, right? And there's not really many solutions out there that even do this, and data scientists could work for months on a project before they actually commit their code. So, the code is always the most important part, right? Being able to track this code, but in a way where it's transparent and that the history of every single change is documented so that at any point I can go back in time and see what happened from one experiment to another experiment in the code and use the diff that's built into GIF and or Git in order to actually validate it. Uh the other part uh is organizing data. So, a lot of data scientists we talk to, um, number one way that they keep track of their data is in folders.

22:24 Lots of folders, right? That's cool. Folders were like awesome when, you know, Steve Jobs introduced the Apple and no one had ever seen a folder in a desktop metaphor before. But it's that's not a way you want to keep track of important data like medical records. So, uh last month I gave a talk on how to manage uh this open uh uh data set called the Chest X-ray 14 uh data set. And it's uh a small data set of 45 gigs of medical images, right? And um as someone who's just doing little experiments, this is a large set of data, um, but usually the companies that we talk to are dealing with terabytes upon terabytes of medical images, right? And you can't just keep them in folders. Well, how do you actually organize this stuff? Um, well, you can use a database and this works to some extent, but when you're dealing with computer vision and you're dealing with large images and uh all the metadata that's associated with it, it becomes really difficult, especially because of the fact that databases aren't um mutable. What ends up happening is is that if you make changes to the data set, you you lose that version of it, right?

23:31 Also, let's say I want an example, I just wanted to find patients that were ages 60 to 30 and didn't have any medical problems. And how do I do that subset? Well, I can go through and write a Python script to manually do it, or if I have a database that understands all the metadata that's associated with each image, I can write a query. So here is just a simple query, but in addition to just writing a query which you get with any database, uh one of the things that I can also do is have this system actually split it for me. So you see at the end, there's a split and it's going to give me the train, uh it's going to give me the test, the train and the validate data back for me. So, a lot of this stuff is being done by hand, and if you're copying these folders over and over again, you wind up corrupting them. Uh, also, I don't want to have to think about when new data gets introduced into the system. I want this stuff to be versioned. I want a database system or a data volume that's actually going to version all the data. So, again, when I have to go back and look at an experiment, if I see that the data is changed, I can test it at a specific point in time.

24:32 So, managing data is also incredibly critical and it's probably one of the biggest areas that's lacking right now in the field is that there's no real uh um easy way uh that everyone is uh considering to do this. So, then the last part is the idea of managing computers, right? And uh on the DevOps side, uh the Ops people have done this for years now. It's pretty easy to automate uh an AWS uh instance to spin it up and to have this reproduced over and over again, right? But a lot of the companies we talk to uh aren't using this. They're using spreadsheets in order to keep track of what computer is up and running. Uh data scientists have to SSH into a machine and see if it's running and if it's not, then they have to wait. Um, so it's, you know, 2019, right? And data scientists are still SSHing into a machine to see if it's up and running. The worst part, at least the worst one that I heard was that it was just so complicated for the data scientists to run the GPUs that they just leave them running constantly.

25:34 They just don't turn them off, right? So, um, outside of the environmental implications of that, um, it's just a huge waste of money. You're talking hundreds to thousands of dollars a month because a data scientist just doesn't feel like shutting down a GPU because they don't want to bring it back up again, right? And I understand this because um configuring machines for deep learning is really complicated. It's not just as simple as startup, you know, an AWS instance, it's how do I get the right versions of Python? How do I get everything in there? How do I reproduce the environment uh directly? Do I have a docker image that needs to be uh implemented on it? Oh list goes on and on. What if I need GPUs? What if I need CPUs, right? And if anyone's done this on AWS and you look through the list of every option known to man of different variations of computers, it's really complicated. So, what if this whole system could just be automated? What if you can just say, you know what, I just want a CPU that's uh this power and just run.

26:36 And not only that, but every time I run my project, it just automatically takes the sample, the project, the code that's already been committed, puts it onto an instance of uh of a server somewhere and then runs it. Or even better, what if I want to run it locally? So, here, every time I'm going through and training my model for uh my text adventure game, I don't have to think about it. I just tell it to train, it takes all of my code in my environment and pushes it to a new computer. And if I keep doing that, it keeps pushing it to new computers. So, if I tell it, I want to run 20 computers concurrently, give me back the results when it's done. Because I've had some of these running for 12 hours, 2 days, I don't know, whatever I feel like just seeing, you know, I want to analyze every single letter in the story, tell me what you get back. That might take me a couple of hours. So, I don't have to think about it, I just have it all automated. And that really is it at the end, is that being able to make sure that you're able to automate um every aspect of it, that every time that you want to rerun an experiment, you not only have the right code, that you also have the right data set and the right version of the data set in time, and that the computer is reconfigured immediately to that instance, so that you have everything exactly how you want it, and you can go back and forth.

27:51 And unfortunately, um, there's a lot of tension right now in the two sides. Similar to what we saw with the developers and the operations, is that the data scientists are doing things their way and the uh engineers, the data engineers want to do things uh their way, and neither one of them can agree, right? And we're hoping to try to get this a little bit closer so that everyone's on the same page and we can empower data scientists to be more productive in their job without having to think about it. And so, regardless of whatever tool you use out there, um, there are lots of different solutions. The the thing that I want to really uh stress is the idea that the only way that we're ever going to fix this problem isn't just by tools, it's about creating a culture. And it's the idea that we can actually take the same concepts that we've learned historically from other development fields, apply them now to deep learning, to computer vision, to AI in general, and actually help move this industry a little bit forward.

28:54 So, that's uh that's my spiel. Um, I do know some Yiddish. Um, and like three words in Hebrew. But uh thanks for watching and I'm happy to answer any questions if anyone has it or I'll hang out here and

← Entity and Word Embbeding: Evaluation and Out-Of-Box Thinking · Labeling against all odds →