/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 (Hugging Face, 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.
-L follows symlinks. -print0 and -0 keep file names with spaces or quotes intact.
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:Hugging Face Cache
In a Hugging Face cache, the files insnapshots/<commit>/ are symlinks into blobs/. Without -L, find -type f matches none of them. The command reads nothing and still exits 0.
Pre-read the snapshot folder, not the repo folder (models--org--name). The repo folder also holds old revisions, so you read more data than the model uses. snapshot_download(..., local_files_only=True) returns the snapshot folder without downloading anything:
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.