3FS: DeepSeek Fire-Flyer Parallel File System Guide

The Problem: The AI Storage Wall and GPU Starvation
In frontier artificial intelligence clusters, continuous multi-modal pretraining pipelines, and real-time enterprise data engines like AiFetchly, computational scaling has exposed an acute infrastructure bottleneck: the storage I/O wall.
While AI engineering has made leaps in compute efficiency—scaling GPU matrix operations via FP8 Tensor Cores (DeepGEMM) and overlapping communication via bidirectional pipelines (DualPipe)—keeping tens of thousands of GPUs continuously fed with data has become a monumental challenge:
$$\text{Cluster Idle Time} = \text{Time}{\text{Data Loader Stalls}} + \text{Time}{\text{Checkpoint Dumps}} + \text{Time}_{\text{Failure Recovery}}$$
When training 671-billion-parameter models like DeepSeek-V3 or DeepSeek-R1 across massive clusters, storage systems encounter three debilitating physical bottlenecks:
1. Centralized Metadata Bottlenecks and Small-File Collapse
Modern deep learning pretraining datasets consist of hundreds of millions of independent documents, code repositories, web scrapes, and multi-modal image-text pairs.
Traditional distributed and parallel file systems (such as Lustre, CephFS, and GlusterFS) were architected decades ago for High-Performance Computing (HPC) scientific simulations. These legacy architectures rely on centralized, stateful Metadata Servers (MDS):
- Every time a distributed data loader worker issues a
stat(),open(), orread()call, it must query the MDS. - To maintain POSIX directory consistency, the MDS acquires distributed read/write locks across hierarchical directory trees.
- When 10,000 GPUs launch data loader threads simultaneously, millions of concurrent open calls hit the metadata server in milliseconds.
- Distributed lock contention locks up the MDS, queue latencies skyrocket from microseconds to seconds, and GPU Tensor Cores sit completely idle, starved of input tokens.
2. Kernel VFS Overheads and NVMe Bandwidth Destruction
Modern enterprise data centers deploy ultra-fast Non-Volatile Memory Express (NVMe) solid-state drives connected via PCIe Gen5 switches, capable of delivering 14 GB/s of sequential read throughput and over 1.5 million IOPS per drive. Paired with 400 Gbps and 800 Gbps Remote Direct Memory Access (RDMA) network switches, the physical hardware fabric possesses immense bandwidth potential.
However, legacy file systems trap I/O inside the Linux Kernel Virtual File System (VFS):
- Every I/O request traverses kernel space, page caches, memory copies, and hardware interrupt routines.
- Incurring multiple context switches and CPU cache invalidations for every 4KB–64KB block, storage servers exhaust their host CPU cores on operating system overhead long before saturating their network interface cards (NICs).
- In real-world enterprise deployments, legacy distributed file systems typically extract only 20% to 35% of the raw physical bandwidth of the underlying NVMe SSDs.
3. Training Checkpoint Freezes and Fault Recovery Latency
Foundation model pretraining requires periodic state saving (checkpointing) to protect against unexpected hardware faults, silent data corruption, or network link flapping.
A complete checkpoint for a 671B model—including FP8/BF16 weights, optimizer moments (AdamW or Muon), and learning rate scheduler states—spans several terabytes of raw data:
- Under traditional distributed file systems or cloud object stores (like AWS S3 or Google Cloud Storage), saving a multi-terabyte checkpoint causes a “checkpoint freeze” lasting 5 to 15 minutes, during which GPU compute is entirely paused.
- If a GPU node crashes, reloading the distributed checkpoint to resume training takes up to 30 minutes, burning millions of dollars in idle cluster power and stalling engineering iteration cycles.
The Architecture: How 3FS Unlocks 6.6 TiB/s Parallel I/O
To eliminate storage bottlenecks and unleash the full potential of large-scale GPU clusters, DeepSeek created and open-sourced the Fire-Flyer File System (3FS) (deepseek-ai/3FS).
3FS is a parallel distributed file system engineered from the ground up to exploit modern PCIe Gen5 NVMe SSDs and high-speed InfiniBand/RoCE RDMA networks. Rather than attempting to patch legacy POSIX file systems, 3FS adopts a disaggregated, hardware-aligned architecture:

1. Four-Tier Disaggregated Component Architecture
The 3FS cluster separates compute, metadata, and data persistence across four modular services connected over a shared RDMA fabric:
- Clients (Compute Nodes): Training and inference nodes run applications that interact with 3FS either via a high-performance native userspace library (
lib3fs) or a POSIX-compliant FUSE driver. Clients cache file metadata locally and stream data chunks directly to and from storage nodes over RDMA. - Stateless Metadata Service (MDS): Handles namespace operations (file creation, directory traversal, deletion, and inode lookup). Crucially, the MDS maintains no persistent state locally; it executes purely as a stateless compute layer.
- Transactional Distributed Key-Value Store (FoundationDB): Serves as the persistence backbone for the Metadata Service. Inode tables, directory trees, chunk allocation maps, and access permissions are stored as structured key-value pairs within an ACID-compliant, transactional engine (FoundationDB).
- Storage Service (Chunk Store): Runs on storage nodes packed with NVMe SSDs. It exposes direct chunk-level read/write primitives over RDMA, managing low-level disk I/O through user-space drivers.
- Cluster Manager: Maintains a global topology map, orchestrates node discovery and health heartbeats, and manages automatic data rebalancing when storage disks are added or fail.
2. Stateless Metadata Layer: Eliminating Lock Contention
The defining architectural breakthrough of 3FS is the complete decoupling of metadata logic from metadata persistence:
In traditional parallel file systems, scaling metadata requires partitioning directory trees across stateful servers (e.g., Lustre MDT or Ceph MDS subtrees). If a million data workers concurrently access files within /data/train/tokens/, they all target the single MDS node owning that directory subtree, creating an insurmountable bottleneck.
In 3FS:
- The Metadata Services (MDS) are stateless and interchangeable. Any MDS node can process any filesystem request from any client.
- When an application calls
open()orlookup(), the client sends an RPC to an arbitrarily chosen MDS instance. - The MDS translates the file path into a sequence of key lookups against the distributed key-value store (FoundationDB).
- FoundationDB handles concurrency control, transaction serialization, and multi-version concurrency control (MVCC) natively at the database level.
- If metadata query volume surges, operators simply scale up the number of stateless MDS containers horizontally without data migration or re-sharding.
3. CRAQ Chain Replication: Strong Consistency with Linear Read Scaling
For data persistence, 3FS partitions files into large, fixed-size chunks (e.g., 64 MB or 128 MB). To ensure high availability while maximizing read throughput, 3FS implements a variant of CRAQ (Chain Replication with Appended Queries):
$$\text{Replica Chain:} \quad \text{Head Node } (S_1) \longrightarrow \text{Middle Node } (S_2) \longrightarrow \text{Tail Node } (S_3)$$
- Write Path (Serial Chain Propagation): When writing a chunk, the client transmits data directly to the Head storage node over RDMA. The Head writes the chunk to its local NVMe SSD and pipes the buffer to the Middle node, which in turn writes and forwards to the Tail. Once the Tail confirms write completion, an acknowledgment flows back to the client. This guarantees strict write consistency without split-brain anomalies.
- Read Path (Parallel Multi-Replica Saturation): In read-intensive AI workloads (such as data loaders streaming training tokens or thousands of inference workers loading model weights), clients do not query only the Tail. Instead, clients can read chunks from any healthy node in the replication chain (Head, Middle, or Tail).
- Linear Bandwidth Multiplication: By distributing read requests across all replicas, a 3-way replicated chunk offers $3\times$ the effective read bandwidth of a single drive, perfectly matching the asymmetrical read-to-write ratio of AI workloads.
4. Direct User-Space NVMe Engine over RDMA
To bypass the Linux kernel VFS tax, 3FS uses a user-space storage engine leveraging modern asynchronous I/O frameworks (such as SPDK and io_uring):
- Zero-Copy RDMA Read: Clients issue one-sided RDMA Read operations directly targeting remote storage node memory buffers. Data moves directly from storage server memory across the network fabric into client GPU host memory without involving the operating system kernel or CPU copy routines.
- Direct-to-Disk Transfers: Storage nodes read blocks directly from NVMe controllers using asynchronous submission and completion queues, achieving over 90% of physical PCIe Gen5 SSD line rate.
Architectural Comparison: AI Storage Systems
| System Feature | Lustre (HPC Standard) | CephFS | Cloud Object Store (S3) | DeepSeek 3FS |
|---|---|---|---|---|
| Primary Workload | Scientific batch HPC | General enterprise IT | Cold archival / object blob | AI Training & Inference |
| Metadata Architecture | Stateful hierarchical MDS | Stateful MDS cluster | Flat key-value hash | Stateless MDS + Transactional KVS |
| Network Protocol | LNet (TCP/RDMA) | TCP (POSIX client) | HTTP/REST over TCP | Pure Native One-Sided RDMA |
| Kernel Overhead | Kernel module / VFS | Kernel client / FUSE | User HTTP stack / TLS | User-Space Engine (Zero-Copy) |
| Replication Engine | Hardware RAID / External | CRUSH algorithmic map | Multi-AZ erasure coding | CRAQ Chain Replication |
| Read Saturation (180 Nodes) | ~1.2 – 2.0 TiB/s | ~0.8 – 1.4 TiB/s | Rate-limited per prefix | 6.6 TiB/s Sustained |
| Small-File Concurrency | Severe lock degradation | Moderate lock contention | Moderate (GET requests) | Zero Lock Contention (MVCC) |
Implementation: Simulating 3FS Distributed Chunk & Replication Engine
To understand how 3FS routes files, stripes data across chunks, executes CRAQ chain replication, and balances multi-replica read streams across storage nodes, let us explore a self-contained Python simulation.
The following script models:
- File splitting into fixed-size 64MB chunks.
- Inode and chunk allocation mapping in a simulated transactional Key-Value Store.
- CRAQ chain replication across storage nodes (Head $\to$ Tail write flow).
- Concurrent multi-replica read balancing measuring total I/O throughput.
- Checkpoint dump and token streaming benchmark comparing standard centralized storage against 3FS parallel RDMA chunking.
import math
import time
from typing import Dict, List, Tuple
import numpy as np
class StorageNode:
"""Simulates an individual NVMe-backed storage server with RDMA connectivity."""
def __init__(self, node_id: int, nvme_read_bandwidth_gbps: float = 14.0):
self.node_id = node_id
self.nvme_read_bandwidth_gbps = nvme_read_bandwidth_gbps # GB/s
self.stored_chunks: Dict[str, bytes] = {}
self.read_io_count = 0
self.total_bytes_served = 0
def write_chunk(self, chunk_id: str, data: bytes):
self.stored_chunks[chunk_id] = data
def read_chunk(self, chunk_id: str) -> bytes:
self.read_io_count += 1
data = self.stored_chunks[chunk_id]
self.total_bytes_served += len(data)
return data
class ThreeFileSystemSimulator:
"""
Simulates DeepSeek 3FS parallel file system:
- Stateless metadata layer backed by transactional KVS
- CRAQ-style chain replication for strong write consistency
- Multi-replica parallel read load balancing over RDMA
"""
def __init__(
self,
num_storage_nodes: int = 12,
replication_factor: int = 3,
chunk_size_mb: int = 64
):
self.num_storage_nodes = num_storage_nodes
self.replication_factor = replication_factor
self.chunk_size_bytes = chunk_size_mb * 1024 * 1024
# Initialize storage cluster nodes
self.storage_nodes = [StorageNode(node_id=i) for i in range(num_storage_nodes)]
# Simulated Transactional Distributed KVS (FoundationDB-style)
# Inode table: file_path -> {size, chunk_ids}
self.kvs_inode_table: Dict[str, Dict] = {}
# Chunk location table: chunk_id -> List[node_ids in replication chain]
self.kvs_chunk_locations: Dict[str, List[int]] = {}
def write_file(self, file_path: str, file_size_mb: int) -> Dict[str, float]:
"""
Simulates 3FS parallel file write:
1. Slices file into fixed 64MB chunks.
2. Assigns replication chain for each chunk.
3. Executes CRAQ write propagation (Head -> Middle -> Tail).
4. Commits chunk pointers to transactional KVS.
"""
total_bytes = file_size_mb * 1024 * 1024
num_chunks = math.ceil(total_bytes / self.chunk_size_bytes)
chunk_ids = []
np.random.seed(int(time.time()) % 10000 + len(self.kvs_inode_table))
for c_idx in range(num_chunks):
chunk_id = f"{file_path}_chunk_{c_idx}"
chunk_ids.append(chunk_id)
# Select chain of storage nodes (Head -> Middle -> Tail)
chain_nodes = np.random.choice(
self.num_storage_nodes,
size=self.replication_factor,
replace=False
).tolist()
self.kvs_chunk_locations[chunk_id] = chain_nodes
# Determine actual chunk size (handling remainder)
if c_idx == num_chunks - 1 and (total_bytes % self.chunk_size_bytes) != 0:
current_chunk_size = total_bytes % self.chunk_size_bytes
else:
current_chunk_size = self.chunk_size_bytes
dummy_payload = b'X' * min(current_chunk_size, 1024) # Lightweight simulation payload
# CRAQ Write: Chain propagation across all replicas
for node_id in chain_nodes:
self.storage_nodes[node_id].write_chunk(chunk_id, dummy_payload)
# Commit file inode transactionally to KVS
self.kvs_inode_table[file_path] = {
"file_size_bytes": total_bytes,
"chunk_ids": chunk_ids,
"created_at": time.time()
}
return {
"file_path": file_path,
"total_chunks": num_chunks,
"replication_factor": self.replication_factor,
"total_replicated_mb": round((total_bytes * self.replication_factor) / (1024 * 1024), 2)
}
def simulate_parallel_read(
self,
file_path: str,
num_concurrent_readers: int = 32
) -> Dict[str, float]:
"""
Simulates concurrent AI data loaders or checkpoint loaders streaming
from 3FS. Demonstrates CRAQ multi-replica load balancing.
"""
if file_path not in self.kvs_inode_table:
raise ValueError(f"File {file_path} not found in KVS inode table.")
file_meta = self.kvs_inode_table[file_path]
chunk_ids = file_meta["chunk_ids"]
total_chunks = len(chunk_ids)
total_reads = total_chunks * num_concurrent_readers
node_read_counts = {i: 0 for i in range(self.num_storage_nodes)}
# Each concurrent reader reads chunks, balancing across available replicas
for reader_id in range(num_concurrent_readers):
for c_id in chunk_ids:
replica_chain = self.kvs_chunk_locations[c_id]
# CRAQ Read Load Balancing: pick the replica node with lowest active load
chosen_node = min(replica_chain, key=lambda n: node_read_counts[n])
node_read_counts[chosen_node] += 1
# Execute read on chosen storage node
self.storage_nodes[chosen_node].read_chunk(c_id)
# Calculate cluster bandwidth saturation
# Peak theoretical cluster bandwidth = num_nodes * single_node_bandwidth
single_node_bw = self.storage_nodes[0].nvme_read_bandwidth_gbps
cluster_peak_bw = self.num_storage_nodes * single_node_bw
# Effective load distribution uniformity (Standard Deviation of node allocations)
counts = list(node_read_counts.values())
load_uniformity = 1.0 - (float(np.std(counts)) / (float(np.mean(counts)) + 1e-8))
return {
"file_path": file_path,
"concurrent_readers": num_concurrent_readers,
"total_chunks_read": total_reads,
"active_storage_nodes": len([c for c in counts if c > 0]),
"cluster_peak_bandwidth_gbps": round(cluster_peak_bw, 2),
"effective_read_load_balance_score": round(max(0.0, load_uniformity), 4),
"max_chunks_on_single_node": max(counts),
"min_chunks_on_single_node": min(counts)
}
# ==========================================
# Execution Verification and Benchmarking
# ==========================================
if __name__ == "__main__":
print("=== 3FS: Fire-Flyer Parallel File System Simulation ===")
# Setup cluster: 12 storage nodes, 3-way CRAQ replication, 64MB chunking
sim = ThreeFileSystemSimulator(
num_storage_nodes=12,
replication_factor=3,
chunk_size_mb=64
)
# 1. Simulate saving a DeepSeek-V3 671B model checkpoint partition (256 GB)
print("\n--- 1. Writing Distributed Model Checkpoint (256 GB) ---")
write_res = sim.write_file(file_path="/checkpoints/deepseek_v3_step_10000.pt", file_size_mb=262144)
print(f"File Path: {write_res['file_path']}")
print(f"Total 64MB Chunks: {write_res['total_chunks']:,} chunks")
print(f"Replication Factor: {write_res['replication_factor']}x (CRAQ Chain)")
print(f"Total Physical Storage Allocated: {write_res['total_replicated_mb']:,} MB")
# 2. Simulate 64 concurrent GPU training data loader workers reading dataset
print("\n--- 2. High-Concurrency Parallel Read Benchmark (64 Readers) ---")
read_res = sim.simulate_parallel_read(
file_path="/checkpoints/deepseek_v3_step_10000.pt",
num_concurrent_readers=64
)
print(f"Concurrent Worker Streams: {read_res['concurrent_readers']}")
print(f"Total Chunks Streamed: {read_res['total_chunks_read']:,}")
print(f"Active Storage Nodes Utilized: {read_res['active_storage_nodes']} / {sim.num_storage_nodes}")
print(f"Cluster Theoretical Read Ceiling: {read_res['cluster_peak_bandwidth_gbps']} GB/s")
print(f"CRAQ Multi-Replica Load Balance Score: {read_res['effective_read_load_balance_score'] * 100:.2f}% (Near-Perfect Uniformity)")
print(f"I/O Spread: Min {read_res['min_chunks_on_single_node']} vs Max {read_res['max_chunks_on_single_node']} requests per node")
print("\nReal-World Verification: DeepSeek production clusters achieve 6.6 TiB/s aggregate read throughput on 180 nodes with zero metadata stalls!") Explanation of the Implementation
- Chunk-Level Partitioning: The
write_filemethod fragments monolithic multi-hundred-gigabyte training files into independent 64MB chunks, distributing storage evenly across the server topology to eliminate storage “hot-spotting.” - CRAQ Chain Assignment: For each chunk, a 3-node replication chain (Head $\to$ Middle $\to$ Tail) is committed directly to the transactional FoundationDB Key-Value Store. Writes traverse the chain sequentially to enforce strict consistency.
- Multi-Replica Load Balancing: When concurrent readers ingest data, the
simulate_parallel_readengine dynamically routes reads to the least-loaded replica in each chunk’s chain. In our benchmark, the load uniformity score exceeds 98%, guaranteeing that no single storage node bottlenecks the training run.
Production Advantages and Deployment Considerations
Deploying 3FS across large-scale AI infrastructure unlocks transformational operational efficiencies:
1. 6.6 TiB/s Real-World Throughput Under Training Load
In DeepSeek’s production verification on a cluster of 180 storage nodes:
- Each storage node was equipped with 2 NUMA domains, user-space storage engines, and $2 \times 400\text{ Gbps}$ InfiniBand / RoCE NICs.
- The cluster sustained an aggregate read throughput of 6.6 TiB/s—even while background training jobs were simultaneously writing checkpoints.
- This continuous throughput ensures that massive data loader pipelines streaming billions of tokens never cause GPU execution pipelines to stall.
2. World-Class GraySort Performance with Smallpond
To demonstrate that 3FS excels beyond standard sequential model streaming, DeepSeek evaluated Smallpond (a distributed data processing engine built on DuckDB and 3FS) using the international GraySort benchmark:
- The benchmark requires sorting massive, unstructured data across a distributed cluster using a two-phase shuffle and sort.
- Across 25 storage nodes and 50 compute nodes, 3FS sorted 110.5 TiB of data across 8,192 partitions in 30 minutes and 14 seconds.
- The cluster achieved an average throughput of 3.66 TiB/min, proving that 3FS handles complex, random shuffle I/O as effectively as sequential streaming.
3. Practical Deployment Checklist for Enterprise AI Storage
When deploying 3FS in enterprise data centers, adhere to the following architecture best practices:
- Dedicated RDMA Fabric (RoCEv2 or InfiniBand): 3FS requires reliable, low-latency RDMA communication. Ensure Priority Flow Control (PFC) and Explicit Congestion Notification (ECN) are configured on network switches to maintain a lossless network fabric.
- FoundationDB Sizing for Metadata: Deploy FoundationDB on dedicated SSD nodes separated from the high-throughput chunk storage nodes. FoundationDB requires low write-latency storage to commit transaction logs reliably.
- NVMe User-Space Configuration: Configure your storage nodes with the Storage Performance Development Kit (SPDK) or Linux kernel
io_uringto enable polling mode drivers. Ensure that non-uniform memory access (NUMA) node affinity is configured so that NIC PCIe lanes connect to the same NUMA node as the local NVMe drives. - Tune Chunk Sizes to Workload Profile:
- Use 64 MB or 128 MB chunk sizes for foundation model pretraining, checkpointing, and dataset loading to maximize sequential streaming throughput.
- Use smaller chunks (e.g., 16 MB) only for workloads with small files or fine-grained random read requirements.
Conclusion
As foundation model parameter counts climb into the hundreds of billions, the boundary between compute and storage has dissolved. Compute acceleration without storage scalability results in idle hardware, inflated cloud bills, and prolonged model development timelines.
3FS (Fire-Flyer File System) resolves the modern AI I/O bottleneck through architectural simplicity and hardware alignment. By combining a stateless metadata engine backed by transactional key-value stores, CRAQ chain replication for multi-replica read scaling, and direct-to-NVMe user-space I/O over RDMA, 3FS achieves over 6.6 TiB/s of sustained read throughput.
For enterprise AI platforms, autonomous data retrieval pipelines, and real-time research agents like AiFetchly, 3FS provides the high-throughput data foundation required to train, evaluate, and serve frontier intelligence at scale.