<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Damian Brady</title>
    <description>The latest articles on DEV Community by Damian Brady (@damovisa).</description>
    <link>https://dev.to/damovisa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F73442%2F8f4466ef-cb6a-4956-b3e3-c23fda2b9857.jpg</url>
      <title>DEV Community: Damian Brady</title>
      <link>https://dev.to/damovisa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/damovisa"/>
    <language>en</language>
    <item>
      <title>MLOps, or DevOps for Machine Learning</title>
      <dc:creator>Damian Brady</dc:creator>
      <pubDate>Mon, 28 Oct 2019 02:18:30 +0000</pubDate>
      <link>https://dev.to/damovisa/mlops-or-devops-for-machine-learning-1ign</link>
      <guid>https://dev.to/damovisa/mlops-or-devops-for-machine-learning-1ign</guid>
      <description>&lt;p&gt;Over the past year or so, I've been spending a lot of time in the world of machine learning and data science. Not as a data scientist, but as a DevOps practitioner*.&lt;/p&gt;

&lt;p&gt;I wanted to know - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How do machine learning projects work? &lt;/li&gt;
&lt;li&gt;Who is involved? &lt;/li&gt;
&lt;li&gt;What is the process like from idea through to running in production?&lt;/li&gt;
&lt;li&gt;Most importantly - can DevOps help?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/vgsj2QCJGv7Xi/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/vgsj2QCJGv7Xi/giphy.gif" alt="I want to learn all the things"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;*As an aside, I tried about 4 different words before "practitioner". It feels so businessey. But here we are.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Learning Machine Learning
&lt;/h1&gt;

&lt;p&gt;When I first encountered any kind of machine learning, it was at university in the form of "deep neural networks". It wasn't my project, but another student's.&lt;/p&gt;

&lt;p&gt;He had great success with it, so I spoke to him about what was involved. After 5min, &lt;strong&gt;I was lost&lt;/strong&gt;. It felt &lt;em&gt;so&lt;/em&gt; inaccessible.&lt;/p&gt;

&lt;p&gt;Non-linear activation functions, multi-dimensional calculus, stochastic gradient decent... I would have spent as much time with a dictionary as with a computer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/1oHOrPkIa9qHuJcW4Z/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/1oHOrPkIa9qHuJcW4Z/giphy.gif" alt="What even is this I'm so confused"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, as any good student would do... I dropped it and started my career writing Visual Basic for the government.&lt;/p&gt;

&lt;p&gt;Fast forward a few years, and I'm working at Microsoft as a Cloud Advocate. I'm here because I've apparently convinced the company that I know about DevOps and can communicate those ideas well. Sure. I'll take it.&lt;/p&gt;

&lt;p&gt;The great thing about being in this role is I have access to fantastic experts in &lt;em&gt;other&lt;/em&gt; fields, who are great at communicating. Enter &lt;a href="https://twitter.com/sethjuarez" rel="noopener noreferrer"&gt;Seth Juarez&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If I had to put my knowledge of AI and ML on a scale against Seth's, it would look a bit like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F8zhttgpq14fade8tajmu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F8zhttgpq14fade8tajmu.jpg" alt="Damo vs Seth - knowing stuff about ML"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's taken a while, and a lot of experimentation and conversations, but I feel like I've got a handle on what's involved in a machine learning project.&lt;/p&gt;

&lt;p&gt;I mean, you probably shouldn't hire me to build a predictive model for you just yet, but I'm no longer completely clueless.&lt;/p&gt;

&lt;h1&gt;
  
  
  About that process
&lt;/h1&gt;

&lt;p&gt;One of the things that all these conversations taught me was that the majority of ML projects don't have a great story when it comes to DevOps.&lt;/p&gt;

&lt;p&gt;But let's back up a bit - isn't DevOps traditionally used to help deliver software?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Yes. And machine learning is software.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fgiphygifs.s3.amazonaws.com%2Fmedia%2Fap6wcjRyi8HoA%2Fgiphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fgiphygifs.s3.amazonaws.com%2Fmedia%2Fap6wcjRyi8HoA%2Fgiphy.gif" alt="It's true. ML is software."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;"MLOps", or "Machine Learning Operations" seems to be the term that much of the industry has landed on. I don't &lt;em&gt;love&lt;/em&gt; it - it implies a narrow focus on operationalizing the results of a machine learning project and not the broader idea of creating value - but if that's the term used, I'll play along.&lt;/p&gt;

&lt;p&gt;I really prefer "DevOps for Machine Learning". The reason? "DevOps" can &lt;strong&gt;absolutely&lt;/strong&gt; apply to machine learning projects - without even stretching the definition.&lt;/p&gt;

&lt;h2&gt;
  
  
  DevOps
&lt;/h2&gt;

&lt;p&gt;Let's quickly look at Microsoft's DevOps definition:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;DevOps is the union of people, process, and products to enable continuous delivery of &lt;strong&gt;value&lt;/strong&gt; to our end users&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The important part of this definition is the word "value". DevOps isn't about features or bug fixes or infrastructure as code, it's about &lt;em&gt;value&lt;/em&gt;. ML is software that provides value.&lt;/p&gt;

&lt;p&gt;For example, if you're working on producing a predictive model for evaluating lending risk for a bank, what's more valuable than improving the accuracy of that model?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fgiphygifs.s3.amazonaws.com%2Fmedia%2FrM9Cl7MZphBqU%2Fgiphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fgiphygifs.s3.amazonaws.com%2Fmedia%2FrM9Cl7MZphBqU%2Fgiphy.gif" alt="So valuable! High Five!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Back to the process
&lt;/h1&gt;

&lt;p&gt;DevOps is full of great practices and patterns, and most of these can be applied to ML projects.&lt;/p&gt;

&lt;p&gt;For me, the main differences between a machine learning project and a software development project come down to the following two distinctions:&lt;/p&gt;

&lt;h2&gt;
  
  
  There's a lot more experimentation
&lt;/h2&gt;

&lt;p&gt;When writing a new feature in a piece of software, you &lt;em&gt;generally&lt;/em&gt; know what you need to do up front.&lt;/p&gt;

&lt;p&gt;For example, for a new "customer orders" report, you know there's probably a database query, some data processing logic, and a few screens or pages of some kind of reporting UI. There's a direction right away, even if you may have to try a few things.&lt;/p&gt;

&lt;p&gt;ML Projects often involve a lot more experimentation. While the end goal is generally known, the path to that goal is often far less clear. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/xT0xewLy70uaFY3Vte/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/xT0xewLy70uaFY3Vte/giphy.gif" alt="So many options it's hard to know which way to go"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are countless algorithms you could use and limitless ways to transform the data and select features. Undiscovered outliers, biases in the data, or poorly-tuned hyperparameters could push you off course for weeks.&lt;/p&gt;

&lt;p&gt;Experience is important, and great data scientists have a feel for what will work, what to look for, and how to solve these tricky problems.&lt;/p&gt;

&lt;p&gt;Data science is a specialist art form.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/lp0nBuaRjcj13j3nMH/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/lp0nBuaRjcj13j3nMH/giphy.gif" alt="Data science is an art"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All that said, &lt;strong&gt;the actual execution of these experiments is ripe for automation&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The training, scoring, evaluation and testing are all things that require scripts and processing. And DevOps helps us with this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Training runs are like really expensive builds
&lt;/h2&gt;

&lt;p&gt;When we build our software on a build server, it's usually a process measured in minutes. Maybe hours if we're unlucky. That means CI is definitely something we should do&lt;/p&gt;

&lt;p&gt;Producing a predictive model on an ML project might take weeks.&lt;/p&gt;

&lt;p&gt;Each training run may require many thousands of compute hours on expensive GPU-laden machines and cost a senior developer's salary each time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/zlNrCRIG5PIys/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/zlNrCRIG5PIys/giphy.gif" alt="Training can be expensive"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So you may not want to do a &lt;em&gt;full&lt;/em&gt; training run for every small change (like you would with continuous integration). You &lt;em&gt;may&lt;/em&gt; want to do a run with a subset of data to prove the idea first. Or maybe you just want to run tests or linting (it is code after all)?&lt;/p&gt;

&lt;p&gt;Even so, the idea of a "training run" as a parallel to a "build" makes sense to me.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A build is essentially a compute-intensive process that produces an artifact that can be deployed or used by other software.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A training run is the same - except it's also very data-intensive.&lt;/p&gt;

&lt;p&gt;The same DevOps techniques around CI, pull request builds, and even security, performance, and load testing can apply.&lt;/p&gt;

&lt;h1&gt;
  
  
  Same same, but different
&lt;/h1&gt;

&lt;p&gt;The skills required to produce a good result may be very different. The cadence of work may be slower at first, and less cleanly broken down.&lt;br&gt;
The tools used day to day might be very different.&lt;/p&gt;

&lt;p&gt;But ultimately it's all writing code, running automated tasks, and deploying the artifacts safely.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If it's &lt;strong&gt;not&lt;/strong&gt; all in code and in source control, it should be!&lt;/p&gt;

&lt;p&gt;If model training requires manual work, it should be automated!&lt;/p&gt;

&lt;p&gt;If deployment is manual and scary, it should be automated and gradual!&lt;/p&gt;

&lt;p&gt;Finally, if the project is "done" when the model is in production, it can get stale and stop delivering value. There's a great opportunity to continue delivering value by using telemetry, monitoring, and ideally automated retraining strategies.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Apply DevOps practices to your ML projects. Work on delivering value more effectively on a continuous basis.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fg0j1f2gs1j6lpqibe4hi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fg0j1f2gs1j6lpqibe4hi.png" alt="Friends don't let friends deploy models manually"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Find out more
&lt;/h1&gt;

&lt;p&gt;There will be more blog posts drilling into some of these ideas in much more detail.&lt;/p&gt;

&lt;p&gt;I've been &lt;a href="https://www.youtube.com/watch?v=ClPcKZHMFBg" rel="noopener noreferrer"&gt;speaking about MLOps or DevOps for Machine Learning at a few events recently&lt;/a&gt;, and there are more to come.&lt;/p&gt;

&lt;p&gt;You can find out what Microsoft has been doing in the MLOps space on our &lt;a href="https://docs.microsoft.com/en-us/azure/machine-learning/service/concept-model-management-and-deployment?WT.mc_id=mlops-blog-dabrady" rel="noopener noreferrer"&gt;Azure Machine Learning docs pages&lt;/a&gt;. We have some amazing tooling to help solve a lot of MLOps problems, and there's so much more to come!&lt;/p&gt;

&lt;h1&gt;
  
  
  Related events
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Microsoft Ignite
&lt;/h2&gt;

&lt;p&gt;One of the big events on the Microsoft calendar is &lt;a href="https://ignite.microsoft.com" rel="noopener noreferrer"&gt;Microsoft Ignite&lt;/a&gt;. At time of writing, it's in less than a week - November 4-8.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F9welhibbb4bpw48vh2du.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F9welhibbb4bpw48vh2du.jpeg" alt="ms-ignite-logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I'll be delivering a &lt;a href="https://myignite.techcommunity.microsoft.com/sessions/83003?source=sessions" rel="noopener noreferrer"&gt;session on exactly this topic&lt;/a&gt; on Thursday afternoon. I'd love you to come along!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Also...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you're going to Ignite and have an interest in MLOps, I'd love to speak to you!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'll even have some of those "friends don't let friends" stickers in the image above. Just ask! 😀&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/damovisa/status/1188642000708358145?s=19" rel="noopener noreferrer"&gt;Send me a message on Twitter&lt;/a&gt;, or just come by the Debug Bar in the Hub. I'll be there 11am-1pm Monday and Tuesday, from 1pm-4pm Wednesday, and from 12pm-2pm Thursday.&lt;/p&gt;

&lt;h2&gt;
  
  
  Microsoft Ignite The Tour
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.microsoft.com/en-au/ignite-the-tour/?WT.mc_id=mitt-blog-dabrady" rel="noopener noreferrer"&gt;Microsoft Ignite The Tour&lt;/a&gt; is an event that Microsoft is running in 30 cities across the world, starting just after Ignite and running through to May next year.&lt;/p&gt;

&lt;p&gt;The AIML50 session is focused completely on MLOps. I won't be delivering any of the tour sessions, but the presenters are amazing. Even though it won't be me saying the words and running the demos, the session is my work and I'm really proud of it.&lt;/p&gt;

&lt;p&gt;Don't miss the (free) event when it comes to your city!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>mlops</category>
      <category>machinelearning</category>
      <category>datascience</category>
    </item>
  </channel>
</rss>
