Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 9 min read Case study mediumAdept

Xet is on the Hub

Hugging Face migrated its first model and dataset repositories from Git LFS to Xet storage, which uses content-defined chunking (~64 KB chunks aggregated into ~64 MB blocks) so that only changed bytes are uploaded. The migration moved 4.5 TB and ~6% of Hub download traffic in one day and exposed two production issues. First, unaligned range requests from hf_transfer forced CAS to stream whole blocks, a 4:1 read amplification. Adding chunk-length metadata to the block format fixed this and cut GET latency ~35%. Second, unflushed page cache during uploads caused disk throttling and pod load imbalance, which was mitigated with per-pod concurrent upload limits. The core lesson is that incremental migrations of real traffic surface problems test environments can't.

Assumes: Git LFS basicscontent-addressed storageobject storage like S3

Related posts

  • Migrating the Hub from Git LFS to Xet

    Hugging Face mediumAdept

    Hugging Face moved 500,000 repositories and about 20 PB from Git LFS to its Xet content-addressed storage with almost no user disruption. Two pieces made that possible. A Git LFS Bridge lets older clients keep working by returning presigned URLs and reconstructing files from chunks in S3. A webhook-driven background pipeline, with an orchestrator batching files into jobs of 1,000 files or 500 MB for worker pods, migrates LFS content without locks. Scaling to multi-petabyte accounts exposed three problems: a cross-mount `/tmp` move bug that filled disks, an undersized CAS, and network/EBS I/O bottlenecks on the workers. After fixes, CAS throughput rose from about 35 Gb/s to peaks near 300 Gb/s.

  • From Chunks to Blocks: Accelerating Uploads and Downloads on the Hub

    Hugging Face mediumAdept

    Hugging Face's Xet storage backend uses content-defined chunking for deduplication but avoids per-chunk overhead by aggregating chunks into content-addressed blocks of up to 64MB and using shards to map files to chunks. That cuts CAS entries roughly 1,000x. A global index over key chunks, a 0.1% subset picked by hash modulo, exploits spatial locality to find shards for deduplication without a network query per chunk. On a 191GB repo of 29 Gemma-2-9B GGUF quantizations, only about 97GB of unique blocks were stored, nearly halving upload time. Local chunk caching also avoids re-downloading unchanged data.

  • Rearchitecting Hugging Face Uploads and Downloads

    Hugging Face mediumAdept

    Hugging Face's Xet team is replacing the Hub's direct-to-S3 uploads and CloudFront downloads with a content-addressed store (CAS) built on "dumb reads, smart writes": reads fetch reconstruction info from CAS, and writes are chunked, deduplicated and validated before reaching S3. Byte-level handling gets around CloudFront's 50GB file limit, enables format-aware dedup and compression for Parquet and Safetensors, and adds audit telemetry. Analysis of 8.2M upload requests (130.8 TB from 88 countries) in one day showed the top 7 countries produce 80% of bytes, so CAS nodes will run in three AWS regions: us-east-1 and eu-west-3 with 4 nodes each, and ap-southeast-1 with 2. Hugging Face accepts an estimated 12% drop in aggregate first-hop bandwidth, expecting other optimizations to offset it.

  • From Files to Chunks: Improving HF Storage Efficiency

    Hugging Face mediumAdept

    Hugging Face's Xet team plans to replace file-level Git LFS storage with content-defined chunking (CDC), where a rolling hash over a sliding window sets variable-size chunk boundaries and chunks are deduplicated in a content-addressed store, so edits only upload and store changed chunks. A prior XetHub benchmark on the CORD-19 dataset showed roughly 50% gains, with storage dropping from 8.9 GB to 3.52 GB and download time from 51 to 19 minutes. On two versions of GPT-2's safetensors file, CDC cut total storage by 53%. Fine-tuned models and checkpoints show 30-85% dedup ratios, which could save about 100 TB immediately, and Xet-backed repos are targeted for early 2025.

  • Meta’s AI Storage Blueprint at Scale

    Meta Engineering mediumAdept

    Meta rebuilt its BLOB-storage stack on top of the Tectonic block layer to stop storage from stalling GPUs in AI training. The rebuild collapsed multi-layer metadata into a flat ZippyDB schema with O(1) path-to-block lookups, replaced the dataplane proxy with a fat client SDK that streams directly from Tectonic, and deployed regional stacks colocated with GPUs. Hot spots and spikes are absorbed by a distributed data cache in spare GPU-host memory (Owl, ~80% hit rate) and a read-plan metadata cache (1-2 ms). Tail latency is handled with hedged reads, and checkpoint egress spikes with client-side dynamic concurrency control. To cut multi-hour cross-region ingestion, storage is treated as a tiered cache: host memory and flash as L1/L2, regional flash as L3 with TTL/LRU eviction, HDD-backed global storage as the source of truth, plus an explicit prefetch() API for on-demand hydration.

The quest for software engineering knowledge.

Look:
Layout: