<?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 Harry Glaser on Medium]]></title>
        <description><![CDATA[Stories by Harry Glaser on Medium]]></description>
        <link>https://medium.com/@modelbitharry?source=rss-c4c8982a1503------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*5f53IUyFaUC3qyE-</url>
            <title>Stories by Harry Glaser on Medium</title>
            <link>https://medium.com/@modelbitharry?source=rss-c4c8982a1503------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 14:37:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@modelbitharry/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[Moving off of Spark: The advantages of a Modern ML Stack built on Snowflake]]></title>
            <link>https://medium.com/snowflake/moving-off-of-spark-the-advantages-of-a-modern-ml-stack-built-on-snowflake-64f164a29df6?source=rss-c4c8982a1503------2</link>
            <guid isPermaLink="false">https://medium.com/p/64f164a29df6</guid>
            <category><![CDATA[snowpark]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Harry Glaser]]></dc:creator>
            <pubDate>Thu, 04 Jan 2024 16:32:10 GMT</pubDate>
            <atom:updated>2024-01-04T16:32:10.112Z</atom:updated>
            <content:encoded><![CDATA[<p>A modern ML stack built on Snowflake has many advantages, including:</p><ul><li>It runs in Snowflake’s modern, secure, fully managed cloud environment.</li><li>It runs in pure SQL and Python, rather than depending on legacy technologies like Spark. This also has an added recruiting advantage!</li><li>It leverages cutting-edge technologies coming out of Snowflake like SnowPark Container Services and SnowPark ML</li><li>It makes use of infrastructure-as-code practices, bringing standards like CI/CD, code review, branching, dev/stage/prod environments and more to your ML practice.</li></ul><p>In this post we’ll walk through what this type of modern ML stack looks like, explore its advantages in more detail, and take a look at some of the challenges you may run into when migrating to this stack and how to overcome them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sm3nxUdE_KCi3K2M" /><figcaption>Photo by <a href="https://unsplash.com/@arronchoi?utm_source=medium&amp;utm_medium=referral">Arron Choi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>The Modern ML Stack</h3><h4>Data lives in the Snowflake Warehouse</h4><p>The foundation of the modern ML stack is the data store itself, which will be your Snowflake warehouse. All your business data will reside in tables in databases in the warehouse. This means that the source of truth for your ML stack will be the same as the source of truth for the rest of your business data. This is obviously ideal, and eliminates any data redundancies in the organization. It also removes the need for the ML team to try to replicate the job of the data engineer in setting up processes to move data to their own source of truth. The data engineers fully own getting data into the organization’s sole source of truth, the data warehouse.</p><h4>Data models are built in a modeling tool like dbt</h4><p>Using a tool like dbt, data models are built as views and tables in the data warehouse. The definitions of these data models will be code that is managed like any other code in the organization. It will be stored in a git repo (automatically if you’re using dbt Cloud), and processes like code review can be brought to bear by more mature organizations.</p><p>Training and testing data for machine learning specifically can be defined in these data models. This is not strictly necessary for one-off models, but shared definitions and common datasets can be pushed into the data modeling later in dbt for maximal efficiency and reuse.</p><h4>ML training and inference code are written in notebooks</h4><p>Shared cloud notebooks like <a href="https://hex.tech/">Hex</a>, <a href="http://www.deepnote.com/">DeepNote</a> and <a href="https://colab.google/">Colab</a> are good choices for teams that value collaboration. Local Jupyter notebooks or VSCode notebooks are also good choices if the local Python environment is desirable. The notebook can pull down data and train locally, or it can push training code to a remote execution environment like <a href="https://doc.modelbit.com/jobs/">Modelbit Training Jobs</a>. In the future, SnowPark may extend functionality for running Python training code directly in the notebook.</p><p>In all of these examples, the results are the same: A model artifact will exist in the notebook, and the training code will also be in the notebook itself. The training code should be versioned in git. When using a remote execution environment like Modelbit Training Jobs, Modelbit will automatically version the exact training code that produced the model artifact in your git repo. If training purely locally, the notebook itself should be checked into the company’s git repo.</p><h4>Inference code is deployed to the warehouse</h4><p>Typically once a model artifact is produced, some Python code will be written around the model to produce an inference. This code as well as the model itself needs to be pushed to Snowflake, where it will run directly in the warehouse to produce inferences. This can be accomplished using the SnowPark API to deploy to a Python UDF or to deploy to SnowPark Container Services.</p><p>For access to more sophisticated workflows including a model registry, version control, logging, observability and alerting, an MLOps platform that leverages SnowPark under the hood such as <a href="https://www.modelbit.com/">Modelbit</a> is ideal. By running modelbit.deploy() inside the notebook, the inference code will be stored in your git repo, the model will be versioned in the registry, and the Python code and model will be deployed to Snowflake. Logging, observability and alerting will be stood up automatically, and third-party integrations are available to various more sophisticated systems for all of those use cases.</p><h4>Inferences can be run on a schedule inside dbt</h4><p>From there, one-off inferences are as simple as running select statements in the warehouse, e.g.:</p><pre>select get_an_inference_from_my_model(feature1, feature2, ...);</pre><p>For inferences that should run when new data is available, or on a schedule, simply call this SQL function from inside a dbt model. Depending on the materialization strategy for that dbt model, your ML model can therefore run every time dbt is run, or it can be run on-demand when the dbt model is accessed.</p><p>In this way, the ML model is fully integrated into the business systems and the rest of the data stack.</p><h3>Advantages of the Modern ML Stack</h3><p>This stack has a number of advantages. Let’s walk through them:</p><h4>It runs in Snowflake’s modern, secure, fully managed cloud environment</h4><p>Other ML stacks, such as Databricks’s stack, must be deployed on-premises. This presents your organization with additional cost. It also either imposes a tax on your engineering team to manage it, or requires that your data team learn enough DevOps to manage an on-premises deployment. None of these setups are ideal. The Modern ML Stack runs on top of Snowflake and takes full advantage of Snowflake’s scalability and security.</p><h4>It runs in pure SQL and Python, rather than depending on legacy technologies like Spark</h4><p>Spark played an important role in scaling data storage and access at a time when SQL-based warehouses could not scale. This is no longer the case, and warehouses like Snowflake scale as well as enterprises need them to. Thus, it’s no longer necessary to make teams deal with legacy technologies like SparkSQL and PySpark. Native SQL and Python are better.</p><p>As a bonus, no longer requiring Spark knowledge broadens the pool of engineers and data scientists you can hire from, which presents cost and convenience benefits to your organization.</p><h4>It leverages cutting-edge technologies coming out of Snowflake like SnowPark Container Services and SnowPark ML</h4><p>A key feature of the Modern ML Stack is the way it deploys your models directly into your Snowflake warehouse. This means you can take full advantage of SnowPark Container Services and SnowPark ML today. It also means that as Snowflake continues to innovate in this area, with future features around model registries, model training and more, your organization is positioned to take advantage of that innovation on day one.</p><h4>It makes use of infrastructure-as-code practices</h4><p>By defining all your infrastructure in code in your git repo, you can leverage a number of best practices as your organization matures:</p><ul><li>Code Review: Ensure peers on your team are reviewing training code, inference code, and models before they are deployed.</li><li>CI/CD: Run tests and other necessary processes as part of the model deployment process.</li><li>Branching and dev/stage/prod environments: Allow each data scientist and model developer to work on their own development branch. Allow them to push to staging environments that mimic production for final testing. Allow them to merge staging to production to ensure that production is fully predictable.</li></ul><h3>Challenges in moving to the Modern ML Stack</h3><p>As teams move away from legacy environments to the modern ML stack, we see them encounter a number of challenges along the way. Let’s take these one by one, and understand how the best teams overcome them.</p><h4>Rethinking their workflows from “notebook-centric” to “cloud-centric”</h4><p>Data scientists who have spent their careers thinking in terms of “lone-wolf notebooks” will need to shift their thinking. Data scientists are used to developing in notebooks, and that will not change. However, when the model is ready for production, data scientists may be accustomed to a world where they simply tee up their notebook to run every day to pull the newest data, run a batch of inferences, and write the results to their data store.</p><p>This process is obviously brittle and lacks all the advantages described earlier in this post. Data scientists need to go through a shift in thinking where the notebook becomes their local workspace, but when they are ready for their model to interact with the wider world, they push the code out to Snowflake rather than pulling the data in.</p><p>In pushing the code and model out, they run through the code review, CI/CD, and other processes that ensure the code and model are ready for prime time. These are healthy processes that help the data scientist grow in their capabilities and ultimately their career. Sometimes, we see data scientists need coaching through this transition.</p><h4>Training teams on code review and CI/CD best practices</h4><p>Relatedly, some teams have never interacted with code review practices and CI/CD systems before. This is an opportunity for these teams to level up, becoming more familiar with modern practices and techniques. A simple training or two often does the trick. This should be presented as an opportunity for these teammates to learn skills that will become key resumé items, helping them further their careers.</p><h4>Ensuring collaboration between data science and data engineering teams</h4><p>In deploying the model into the warehouse, teams encounter a key moment of collaboration between the data science team developing the model and the data engineering team that “owns” the warehouse and the data modeling system (e.g. dbt).</p><p>We sometimes encounter organizations where these teams are fully siloed and have not meaningfully collaborated before. In these organizations, there’s sometimes fear of collaborating for the first time.</p><p>This step requires leadership buy-in: It’s great for the whole team that once the model is in production, data engineering will help maintain it. Maintenance, safety, security and scalability are key strengths of the data engineering team, and those strengths will now be brought to bear on the organization’s machine learning process.</p><p>We see successful leaders step in at this stage and actively manage the collaboration between data science and data engineering teams until a successful cadence and culture is established.</p><h3>Final Thoughts</h3><p>The Modern ML Stack brings many advantages to an organization, both hard business wins as well as cultural and process improvements. The transition should be actively managed in order to ensure success, and the resulting breaking down or barriers and improvements in team productivity should be embraced. The ability to transition to modern technologies and processes allows the full power of machine learning to be brought to bear for an organization.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64f164a29df6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/snowflake/moving-off-of-spark-the-advantages-of-a-modern-ml-stack-built-on-snowflake-64f164a29df6">Moving off of Spark: The advantages of a Modern ML Stack built on Snowflake</a> was originally published in <a href="https://medium.com/snowflake">Snowflake Builders Blog: Data Engineers, App Developers, AI, &amp; Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>