---
title: "Improving machine learning iteration speed with faster application build and packaging"
description: "Meta cut ML engineers' build and packaging overhead by double-digit percentages by tackling build non-determinism, pruning dependencies, and replacing monolithic XAR executables with an incremental Content Addressable Filesystem (CAF)."
url: "https://swe.quest/articles/improving-machine-learning-iteration-speed-with-faster-application-build-and-76fe5935fe0be272"
canonical: "https://engineering.fb.com/2024/01/29/ml-applications/improving-machine-learning-iteration-speed-with-faster-application-build-and-packaging/"
source: "Meta Engineering"
published: "2024-01-29"
difficulty: "medium"
kind: "Case study"
reading_minutes: 5
tags: ["build-systems","developer-productivity","ml-platform","storage-systems","python"]
---

# Improving machine learning iteration speed with faster application build and packaging

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2024-01-29, 5 min read, Case study. Original: [https://engineering.fb.com/2024/01/29/ml-applications/improving-machine-learning-iteration-speed-with-faster-application-build-and-packaging/](https://engineering.fb.com/2024/01/29/ml-applications/improving-machine-learning-iteration-speed-with-faster-application-build-and-packaging/)

## Summary

Meta cut ML engineers' build and packaging overhead by double-digit percentages by tackling build non-determinism, pruning dependencies, and replacing monolithic XAR executables with an incremental Content Addressable Filesystem (CAF). Non-determinism from compilers and build rules is mitigated inside the Remote Execution service that Buck2 sends nearly all build actions to, so stable warm revisions can reuse cached outputs. CAF describes each executable as a flat manifest of content digests, skips uploads already in CAS, and fetches only missing content via per-host CAS daemons that share data peer-to-peer over Owl. Btrfs compression and copy-on-write keep on-disk size close to XAR while sharing files across executables. Planned next steps are lazy on-demand fetching (LazyCAF) and putting all ML engineers on uniform revisions to raise cache hit rates.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Build systems](https://swe.quest/tags/build-systems.md) (Engineering practices)
- [Developer productivity](https://swe.quest/tags/developer-productivity.md) (Engineering practices)
- [ML platforms](https://swe.quest/tags/ml-platform.md) (AI & ML)
- [Storage systems](https://swe.quest/tags/storage-systems.md) (Infrastructure)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- build caching and remote execution ([easy posts on Build systems](https://swe.quest/tags/build-systems.md?difficulty=easy))
- content-addressable storage
- Python executable packaging ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))

## Keywords

Buck2, XAR, Content Addressable Filesystem, CAS, Owl, Btrfs, Remote Execution, LazyCAF

## Related posts

- [Large-scale distributed builds with Microsoft Build Accelerator](https://swe.quest/articles/large-scale-distributed-builds-with-microsoft-build-accelerator-9baa9a7436e8437c.md): Engineering@Microsoft · 2021-08-18 · Easy · 4 min read · Build systems, Developer productivity, Caching
  Microsoft's BuildXL distributes and caches builds for its largest codebases.
- [Optimizing Our E2E Pipeline](https://swe.quest/articles/optimizing-our-e2e-pipeline-880da9c129e2726b.md): Slack Engineering · 2025-04-14 · Medium · 5 min read · CI/CD, Build systems, Testing, Developer productivity, Cost optimization
  Slack cut redundant frontend builds in its monorepo E2E pipeline by using \`git diff\` three-dot notation against \`main\` to detect whether a PR touches frontend code, and when it doesn't, serving a recent production frontend build from S3 through an internal CDN instead of rebuilding.
- [Build faster with Buck2: Our open source build system](https://swe.quest/articles/build-faster-with-buck2-our-open-source-build-system-ede49d4bb9123548.md): Meta Engineering · 2023-04-06 · Medium · 7 min read · Build systems, Rust, Open source, Developer productivity
  Buck2 is Meta's from-scratch rewrite of Buck, open sourced with a Rust core and all language rules written in Starlark, and it completes builds about twice as fast as Buck1 internally.
- [5 Things you didn’t know about Buck2](https://swe.quest/articles/5-things-you-didn-t-know-about-buck2-e7af8905ffa26190.md): Meta Engineering · 2023-10-23 · Easy · 3 min read · Build systems, Rust, Developer tools, Open source
  Buck2, Meta's open-source successor to the Buck build system, completes builds roughly 2x faster than Buck1 in internal tests.
- [Build better software to build software better](https://swe.quest/articles/build-better-software-to-build-software-better-5c6078f2e1d6c4da.md): Slack Engineering · 2025-11-06 · Medium · 17 min read · Build systems, Developer productivity, CI/CD, Refactoring & migrations, Caching
  Slack cut the 60-minute build pipeline for Quip and Slack Canvas's backend by applying classic software engineering principles (hermetic, idempotent, granular units of work and clean separation of concerns) before adopting Bazel.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
