/data filesystem on fal is a distributed, parallel storage system. It performs best when multiple files are read concurrently. Sequential file reads β loading one weight file at a time β significantly underutilize the filesystem and result in slower cold starts.
The Problem
Most model loading libraries (HuggingFace, PyTorch) read weight files sequentially β one shard at a time. On a distributed filesystem, this leaves most of the available bandwidth idle:The Solution: Pre-Read Files in Parallel
Before loading your model, pre-read all weight files into the OS page cache using parallel I/O. When the model loader then reads the files, theyβre already cached in memory and load instantly.from_pretrained() call then reads from cache instead of the network.
Using It in Your App
Add the pre-read step at the beginning of yoursetup() method, before model loading:
Python Helper
For a cleaner approach, wrap it in a function:When to Use This
How It Works
falβs/data is a distributed filesystem that can serve many files concurrently at high throughput. When you read files sequentially, you use only a fraction of the available bandwidth. The xargs -P 32 approach fires off 32 concurrent cat commands, each reading a different file. The OS caches the file contents in memory (page cache), so when your model loader reads the same files moments later, it reads from RAM instead of the network.
Comparison with FlashPack
Both techniques can be combined β use parallel pre-reading as a quick improvement, then migrate to FlashPack for even faster loading.
FlashPack
High-throughput tensor loading at up to 25 Gbps
Persistent Storage
How /data works and caching behavior