<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kumu Data Team on Medium]]></title>
        <description><![CDATA[Stories by Kumu Data Team on Medium]]></description>
        <link>https://medium.com/@karlitodata?source=rss-d16f85f2dbd7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_KXoWjW9tU9Y9aEdx81w0Q.png</url>
            <title>Stories by Kumu Data Team on Medium</title>
            <link>https://medium.com/@karlitodata?source=rss-d16f85f2dbd7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 06:40:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@karlitodata/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ML Engineering at Kumu: Turning Models into Products]]></title>
            <link>https://medium.com/@karlitodata/ml-engineering-at-kumu-turning-models-into-products-b2b4faeb2b40?source=rss-d16f85f2dbd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2b4faeb2b40</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[ml-engineering]]></category>
            <category><![CDATA[kumu]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Kumu Data Team]]></dc:creator>
            <pubDate>Mon, 10 Oct 2022 07:22:02 GMT</pubDate>
            <atom:updated>2022-10-10T07:27:55.086Z</atom:updated>
            <content:encoded><![CDATA[<p>By <a href="https://www.linkedin.com/in/david-john-ricafort/"><strong>DJ Ricafort</strong></a><strong>, </strong><a href="https://www.linkedin.com/in/renzabergos/"><strong>Renz Abergos</strong></a><br>Edited by <a href="https://www.linkedin.com/in/milestorinong/">Miles Ong</a>, <a href="https://www.linkedin.com/in/jerome-celeres-6224001a6/">Jerome Celeres</a></p><p>Let’s face it, Machine Learning has become such a buzzword where everyone wants in, but not a lot of people understand the effort to actually make use of it. Machine Learning Engineering (MLE) is the process of combining software engineering and data science skills in order to turn machine learning models into usable products. It involves training models, exposing these through inference endpoints, and optimizing data processing and retrieval in order to achieve production-level latency and stability.</p><p>In reality, some companies are able to build machine learning models, but are not able to take advantage of its full potential. While data teams have already figured out how to develop machine learning models, most of them are stuck running in offline code editors such as Jupyter notebooks. This is because deploying models in a live environment requires the set of skills that aren’t typically found in data scientists. Models are then left to be in the research or exploratory phase and not actually used as a product.</p><h3>MLE in Kumu</h3><p>In Kumu, we have a lot of use cases for AI products — content recommendations, user moderation, and video analytics. All of which can potentially bring massive business value to our product. In order to extract concrete business value, these models are served as API or inference endpoints that other Product teams can easily integrate with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gezfScGG123Zrw-R6REMkQ.png" /><figcaption>Data Lifecycle (Image by Author)</figcaption></figure><p>However, with a rough ratio of one ML engineer to three data scientists, there’s a clear bottleneck with the scale at which these AI products can be rolled out. On top of that, since these are production services, it takes time to build and maintain uptime, latency and efficiency.</p><h3>The Early Days of Model Deployment in Kumu</h3><p>As part of our standard data science workflow, Data Scientists would typically spend long hours to prepare their data, run exploratory analysis, design features, and train their models. Depending on model complexity, models would pass offline testing after around two weeks of model development. Afterward the model object is turned over to the MLE Team for deployment. Pre- and post-processing functions are applied to standardize error handling and formatting for the data that comes in and goes out of the model service. Once this is done, <a href="https://www.bentoml.com/">BentoML</a>, an open-source model deployment framework, is used to containerize the model which is then passed on to <a href="https://aws.amazon.com/sagemaker/">AWS SageMaker</a> to host the model as an endpoint.</p><p>The entire deployment process would take one ML engineer roughly 1–2 weeks of undivided attention to finish (but let’s be real, this never happens lol). What would consume a lot of time are the back and forth discussions between ML engineer and data scientist on how to retrieve the input features, optimize the code, and work through complexities of having to handle different kinds of model frameworks (e.g. TensorFlow, CatBoost, PyTorch). Around three models would be produced every two weeks, but it would take roughly 3–4 weeks for all of these to be deployed. It was frustrating for data scientists to wait long for their models to get deployed, but also exhausting for ML engineers to continuously deploy models with a seemingly unending backlog.</p><p>It was obvious that the current deployment process was not sustainable. We needed to reassess how we were doing things and work smarter because we knew that simply hiring more ML engineers would just be a bandaid solution until more data scientists were hired as well. We searched externally and conveniently found this guide: <a href="https://cloud.google.com/architecture/mlops-continuous-delivery-and-automation-pipelines-in-machine-learning">MLOps: Continuous delivery and automation pipelines in machine learning</a>, published by the Google Cloud Architecture Center. This easily became a reliable reference point in how we thought about approaching this challenge moving forward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fbXBDXe4UbHMcdn3AM9PKA.png" /><figcaption>Reference: MLOps Level 0 taken from Google Cloud Architecture Center <a href="https://cloud.google.com/architecture/mlops-continuous-delivery-and-automation-pipelines-in-machine-learning">MLOps: Continuous delivery and automation pipelines in machine learning</a></figcaption></figure><h3>Templates are 🔑</h3><p>We realized that in order to minimize the dependency on our ML Engineers, we needed to find a way to streamline the deployment process. What took the most time is considering how each model needed to be saved, depending on the model framework it was using. After numerous manual deployments, we were able to create a template that abstracted this tedious, but repetitive task. This meant that any data scientist using any supported model framework could submit their model to the template and the output would be a production-ready API endpoint.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46bb3825672417c1ee6020ca8ff3fbf9/href">https://medium.com/media/46bb3825672417c1ee6020ca8ff3fbf9/href</a></iframe><p>This self-serve template allowed the data scientists to deploy their own models and gave them more control over their work. Furthermore, the implementation of this template also drastically cut down the deployment time from one week down to half a day 🤯. This gave the MLE Team the time and energy to focus on building out this platform and solving an even bigger problem: How do we scale this service in production?</p><h3>End-to-End MLE Lifecycle</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hnh-OfTsEJeR7ObeOkCvGg.png" /><figcaption>Reference: MLOps Level 1 taken from Google Cloud Architecture Center <a href="https://cloud.google.com/architecture/mlops-continuous-delivery-and-automation-pipelines-in-machine-learning">MLOps: Continuous delivery and automation pipelines in machine learning</a></figcaption></figure><p>After taking a step back, we saw that any ML-driven product consists of the following: a problem statement, hypothesis (feature), data extraction, exploratory analysis, feature generation, model training, testing, deployment, and monitoring. While each component could vary for each model, we noticed that there was a repetitive cycle. For most of these steps, our data scientists would go through countless trials and errors until a sufficiently performant and reliable model is produced. Ultimately, we needed to govern releases of our models in order to ensure that the iterations are actual improvements over previous versions.</p><p>We then decided to focus on 3 key areas to achieve this:</p><ol><li>Code Maintainability</li><li>Automated Tests and Deployment</li><li>Deployment Governance</li></ol><h3>Code Maintainability</h3><p>In traditional software development, Github is widely used to easily track code changes across versions. This helps developers to have a version history of what changed and who made the change. It was also convenient because we could easily revert mistakes that were pushed into production. The same principle can be applied to machine learning models. Although Github is commonly used for observing changes in scripts, it can also be used for tracking changes in Jupyter notebook IDEs.</p><p>In Kumu, most of our data scientists do their analysis and model experimentations using Databricks or Sagemaker notebook cloud services which run on top of a Jupyter notebook IDE. With Github’s native integrations to these cloud services, we were able to manage code changes in the notebooks of our machine learning pipelines such as data extraction, data validation, feature generation, model training, and model creation. Any changes in each step of the pipeline are saved to our Github repository.</p><p>Apart from using version control on notebooks, we also enforced coding standards in Python such as <a href="https://peps.python.org/pep-0008/">PEP8</a>, which serves as the style guide for writing clean and understandable code. We automate this checking process through a CI/CD platform called Github Actions. We made use of pre-commit hooks, which scan and notify code changes that do not follow a specific style guide. This helped us to enforce a standardized formatting style to the code base. Furthermore, it detects unused variables and imports to ensure that codes written use the resources efficiently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dq6p4SoQFYR982_rxD8KOQ.png" /><figcaption>Automated standardization checks and formatting for code maintainability (Image by Author)</figcaption></figure><h3>Process Automation</h3><p>It wasn’t enough that deployments were templated because, once they were in production, models had to be constantly monitored and retrained on a daily basis. It was a nightmare having three to five live models simultaneously, needing to manually rerun pipelines for it, and verifying that each was deployed successfully.</p><p>Because of this, we decided to use <a href="https://airflow.apache.org/">Airflow</a> as our orchestration tool, to automatically run these recurring jobs reliably with Airflow Directed Acyclic Graphs (DAGs). Each DAG would be scheduled to triggered at a certain time each day, which ran the model deployment steps sequentially:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rdJN6CFTxjTXPw0TdK1HEg.png" /><figcaption>Airflow DAG logic (Image by Author)</figcaption></figure><p>The first step is to run a query that generates an updated dataset and feed it into the model for retraining. After the model artifact has been generated from retraining, an API call will be sent to Github Actions to trigger the start of the deployment job. The deployment workflow runs the following steps:</p><ol><li>Provision an EC2 server as a job runner</li><li>Install necessary dependencies (e.g. third-party libraries or packages) of the model</li><li>Package the model using BentoML</li><li>Deploy to production servers</li></ol><blockquote>💡 <em>Note: We initially considered using Lambda functions. But because of the execution time limits, we decided that having a provisioned EC2 would provide more stability.</em></blockquote><p>Apart from deployment success, an important consideration for stability is ensuring that the endpoint is ready for production-level traffic. As industry practice, we run load tests as part of the automated workflow to simulate how the endpoint handles even beyond peak traffic levels. If the results at the 90th percentile (P90) show to be within our latency and error rate threshold, then the model endpoint is good to go.</p><p>Similarly with the deployment flow, the following is done to conduct the load testing:</p><ol><li>Provision an EC2 server as a job runner</li><li>Install dependencies for running the load test such as locust (load testing framework), Python, etc.</li><li>Perform load testing using pre-set configurations (e.g. model endpoint url, number of users, duration, etc.)</li><li>Log the results for reporting and consideration</li></ol><p>The crucial part is ensuring that the relevant stakeholders know what’s going on, which leads us to our next and last aspect — Deployment Governance.</p><h3>Deployment Governance</h3><p>After all of these steps, the last and most crucial part of the process is ensuring the relevant stakeholders know what’s going on. Having model deployment governance means that apart from visibility, they also have the capability to respond to issues. With the deployment workflow, the process is abstracted to the point where maintenance effort is minimized, but the essential steps will still require human intervention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*5jAqE-vRHV8WU__VvArNaw.png" /><figcaption>Sample automated Slack alert triggered by deployment pipeline (Image by Author)</figcaption></figure><p>That’s why regardless of the results of the automated pipeline, Slack alerts are sent to a public channel where it’s convenient to jumpstart discussions. Otherwise, the tasks are self-recurring with minimal overhead. However, full automation can also endanger the stability of the platform by introducing unintended changes. A guardrail is enforced by notifying and requiring stakeholder’s confirmation before a significant change is released to production. An automated Github Actions workflow triggered for any environment will require <a href="https://docs.github.com/en/actions/managing-workflow-runs/reviewing-deployments">approval</a> from reviewers (e.g. Data Science Manager or Tech Lead) before proceeding with the deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IdHOx2DhZzSaoQl4w7DHBA.png" /><figcaption>Sample review and approval of deployment using Github Actions (Image by Author. Taken from Github)</figcaption></figure><p>Lastly one of the bigger pain points we’ve experienced is how to fix issues when they slip into production? Designing services that are more configuration-driven eliminates the headache of having to debug code on-the-spot and rush the entire develop-test-deploy cycle. Being able to apply changes with a simple parameter is especially helpful on the infrastructure side in configuring the type of instance to be used or the auto-scaling policies for the endpoints.</p><h3>Conclusion</h3><p>Code maintainability, automation, and governance brought significant impact to our team. From a labor-intensive and bottleneck-prone deployment process that would push out 1 model every 2 weeks, the MLE Team is now able to support Data Science projects at a virtually limitless capacity with minimal additional headcount.</p><p>It’s clear that the demand for machine learning has heavily outpaced the supply at which teams are able to keep up. This can be an overwhelmingly complex challenge, but trust that it definitely is doable with the proper MLE strategy. Before you know it, you’ll be unlocking much smarter and scalable features that will open doors to so much more possibilities. Welcome to the world of machine learning!</p><p>We’re a bunch of nerds who work together, but have a strong advocacy for tech in the Philippines. If you have any questions, thoughts or simply want to discuss, we’d love to chat! Feel free to reach out to us by email at <a href="http://data@kumu.ph/">data@kumu.ph</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2b4faeb2b40" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“That Escalated Quickly”: Kumu’s Big Data Journey]]></title>
            <link>https://medium.com/@karlitodata/that-escalated-quickly-kumus-big-data-journey-aff78731849b?source=rss-d16f85f2dbd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/aff78731849b</guid>
            <category><![CDATA[philippines]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Kumu Data Team]]></dc:creator>
            <pubDate>Fri, 20 Aug 2021 05:20:45 GMT</pubDate>
            <atom:updated>2021-09-01T08:26:08.152Z</atom:updated>
            <content:encoded><![CDATA[<p>By <a href="https://ph.linkedin.com/in/elyse-go-282424112">Elyse Go</a>, <a href="https://ph.linkedin.com/in/miles-torin-gabriel-ong-482109154">Miles Ong</a> <br>Edited by <a href="https://ph.linkedin.com/in/jerome-celeres-6224001a6">Jerome Celeres</a>, <a href="https://sg.linkedin.com/in/jbolilia">Justin Bolilia</a></p><h3>Background</h3><p><a href="https://www.kumu.live/">Kumu</a> is primarily a live streaming service with the dream of becoming <em>the</em> super app for <strong>Filipinos</strong>. Proudly homegrown, Kumu offers a platform for Filipino content creators to showcase their talent on a global stage. Every feature and design of the app is centered around the Filipino market both in the Philippines and abroad.</p><p>At Kumu’s current scale, we:</p><ul><li>Generate over <strong>eight (8) Terabytes</strong> of raw data per month</li><li>Process around <strong>two (2) Petabytes</strong> (into reports) per month</li><li>Send out <strong>thousands of fresh personalized recommendations</strong> per minute</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*dNupadFf5nnYdO3BHjtOCg.png" /><figcaption>Image by Author</figcaption></figure><p>When you have this much data to work with and you stick to conventional data science methods, costs inflate, simple tasks take hours, and complex computations become major bottlenecks. The whole data science feedback loop (training, check results, modify) is staggeringly long that it becomes inefficient to optimize your model. In this article, we are here to share some of the ways on how we handle BIG data.</p><h3>Say hello to new-found friends</h3><p>With the amount of data generated and processed in Kumu, it becomes crucial to handle them efficiently. Our data architecture is made to modularly scale as the data grows by having a distributed ecosystem of services. With the use of these tools, a new set of rules come into play like:</p><ul><li><strong><em>CSVs to Parquets:</em></strong> While CSVs are great for smaller datasets, they lose their efficiency as you hit the millionth-row mark. Parquet’s columnar storage is optimized for choosing a section of columns, unlike CSV’s row-based storage which is optimized for reading a sequence of rows. Columnar storage makes it easier to pull parts of a record which shortens read latency and gives more scalability as data increases. On top of that, Parquet files also store the data’s schema. This splits the data into multiple parts which allow us to load one file at a time or only one file part.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xz1bB-s078NIQCA20-9DZQ.png" /><figcaption>From apache parquet’s website: <a href="https://parquet.apache.org/">https://parquet.apache.org/</a></figcaption></figure><ul><li><strong><em>Loading all the data to Sampling:</em></strong> The luxury of loading an entire dataset into your notebook and browsing it quickly with .head() and .info() no longer applies. Loading large files tend to eat up a lot of memory killing the kernel after a few small data transformations. Each simple task takes minutes to complete, and the model has not been trained yet. You then start to proactively think about the data needed for the task, and sampling becomes a necessary pre-processing step. This is similar to how most optimization steps involve some form of random sampling like in Randomized Search or Stochastic Gradient Descent.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*V_dR_Kbz0UXUBjPbYuWKcw.png" /><figcaption>Worse than a breakup text (Image by Author. Taken from <a href="https://jupyter.org/">Jupyter’s</a> web application)</figcaption></figure><ul><li><strong><em>Traditional SQL to Spark:</em></strong> Although it’s not a direct comparison, there is some case to discuss this since both process large amounts of data and both can be coded in SQL. Spark’s strength lies in its ability to perform parallel processing and its ability to install Python packages and supports ML pipelines.</li><li><strong><em>More than just notebooks:</em></strong> Often enough most data science work is contained in .ipynb files. However, as we automate repetitive processes that may run across different services, the importance of using a lightweight file such as .py becomes necessary.</li></ul><h3>How we do it in Kumu</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6bpHiKSmuuU_M4M6" /><figcaption>Peep into Kumu’s Pipeline (Photo by <a href="https://unsplash.com/@xoforoct?utm_source=medium&amp;utm_medium=referral">EJ Strat</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a>)</figcaption></figure><h3>Establishing a solid data pipeline</h3><p>A strong data pipeline is one of the most important foundations of a data-centric company. Ensuring there is good data quality that is in a usable form makes the model development cycle much more efficient. However, this becomes increasingly challenging as your data scales. Data engineers provide the velocity needed in executing any data-related initiative.</p><h3>Infrastructure is key</h3><p>The company’s growth (and consequently, the increased volume of data) should never be the reason why people can’t do their jobs. At the same time, just throwing RAM at these kinds of data problems is a good way to get your Finance Team on your backs (Yikes!). When we talk about data infrastructure in Kumu, we always think of <strong>Scalability</strong> and <strong>Efficiency</strong>.</p><h3>Build for the Future (Scalability)</h3><p>Scale is relative per company, but what matters is (1) where you are now and (2) where you see yourself in the foreseeable future. During the earlier days of the Kumu, the first data pipeline built was designed using a <a href="https://blog.hubspot.com/website/serverless-functions#:~:text=A%20serverless%20function%20is%20a,new%20code%20faster%20and%20easier.">Serverless Functions</a> Architecture. In a true startup fashion, it was scrappy and did the job; it processed Terabytes of data coming in per day at that time. However, as soon as we hit rapid growth, the pipelines would break almost every week due to the sheer volume of data that was coming in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5iXJT7KsitH2VFraCzn5-w.png" /><figcaption>Architecture with Serverless Functions (Made with <a href="http://draw.io/">draw.io</a>)</figcaption></figure><p>We realized that processing <em>today’s</em> data was not good enough. We needed to build a pipeline that would have no problem running even if the data suddenly grew by 10X. This is where big data <em>actually</em> becomes useful. We transitioned our pipelines on managed <a href="https://www.infoworld.com/article/3236869/what-is-apache-spark-the-big-data-platform-that-crushed-hadoop.html">Spark</a> clusters that take advantage of distributed computing. Now when incoming data is unprecedentedly massive, the clusters just spin up the additional instances and keeps the pipeline running smoothly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YviPmJqpEfmYKfOSQJyKBA.png" /><figcaption>Architecture with Spark Clusters (Made with <a href="http://draw.io/">draw.io</a>)</figcaption></figure><h3>Work Smart with Data (Efficiency)</h3><p>One of the most common misconceptions is that throwing more compute resources at a pipeline solves the problem. A lot of times, a cheap and impactful fix lies in the code. Small adjustments like caching a <a href="https://databricks.com/blog/2015/02/17/introducing-dataframes-in-spark-for-large-scale-data-science.html#:~:text=In%20Spark%2C%20a%20DataFrame%20is,richer%20optimizations%20under%20the%20hood">DataFrame</a> before transformations or dropping unneeded columns make a world of difference, especially with data at scale. These kinds of optimizations come only after you’ve reached a certain level of familiarity with both the underlying data structures and data transformations. This entails getting down and dirty with the data, but this <em>will</em> save a ton of time and money in the long run.</p><p>Doing a lot of specialized transformations can get a bit tricky though. Dependencies among tasks are difficult to manage, especially when you’re running dozens of processes simultaneously. This is where <a href="https://airflow.apache.org/">Airflow</a> comes in. To put it simply, it’s an orchestration tool that manages the scheduling and sequencing of tasks within your pipeline. This kind of precision allowed us to run our pipelines with a high level of consistency and ultimately makes our data much more reliable.</p><h3>Conclusion</h3><p>If there’s one thing to take away from this article, it’s to be proactive in monitoring your data and scaling your workflow. These issues might seem foreign for now, but as the Philippines becomes more data driven, companies will inevitably face big data problems.</p><p>For job seekers, having these skills in your toolbox could be your edge against other candidates. For data professionals, don’t wait until your architecture struggles before making that shift. Finally, one important topic we didn’t get to discuss (because it deserves an article of its own) is deployment which we will cover in a future post. Stay tuned!</p><p><em>If you are interested in working with big data or building out scalable data platforms, you can join us by sending your CV to </em><a href="/service/mailto:elyse@kumu.ph"><em>elyse@kumu.ph</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aff78731849b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>