← Back to AI Infrastructure Mind Map
⚡Flashcard Drill➔
🖥️ AI InfrastructureID: data-loading

Data Loading & IO

训练数据加载与 IO
🎯Core Definition
Training data loading and IO optimization. WebDataset packs samples sequentially into tar shards read as streams, replacing random reads of millions of small files with sequential IO; format choice: TFRecord (fixed-length records plus index, TensorFlow ecosystem), Parquet (columnar, for feature stores and analytics), Arrow (columnar in-memory format, zero-copy across languages). IO is overlapped with compute: the data pipeline (read → decode → augment → batch) runs in parallel with GPU forward/backward, using prefetch to hide IO latency — e.g. `tf.data.Dataset.prefetch(1)` or a multi-worker PyTorch DataLoader with `prefetch_factor`; with ideal overlap the total time is Ttotal≈max⁡(Tio, Tcompute)T_{\text{total}} \approx \max(T_{\text{io}},\, T_{\text{compute}}) instead of the sum.
💡Use Cases
with TB-scale datasets the GPU often idles waiting for data (low GPU utilization plus busy CPU/disk points to an IO bottleneck); distributed training needs per-rank shards with global shuffle between epochs; interviews ask how to detect a data bottleneck, when to pick each format, and how prefetch raises throughput.
⚡Key Problems Solved
versus per-file random reads, millions of small files flood inode lookups and disk random IO, cutting throughput by one to two orders of magnitude versus sequential reads; WebDataset's sequential tar-shard streaming suits both local disks and object stores, and multi-worker prefetch plus local caching (NVMe/page cache) hides IO latency behind compute, recovering GPU utilization and shortening training time by the bottleneck ratio.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Data Loading & IO.
Use Cases
In production engineering, what are the primary use cases for Data Loading & IO and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Why do many small random reads kill data loading? How does WebDataset's sharded tar fix it?
2
When to use TFRecord vs Parquet vs Arrow?
3
How to tell whether the bottleneck is data loading or compute? Which tools pinpoint it?
4
How do prefetch and multi-worker loading overlap IO with compute? Ideal total time?
5
How are data sharded per rank and globally shuffled across epochs in distributed training?
📖 In-depth Guide:📄 mlops-and-testing →
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "Data Loading & IO"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
🎯 Drill This Card Now➔
← Previous CardModel Weight & Checkpoint StorageNext Card →Data Pipelines & Streaming

🔗 More AI Infrastructure Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/AI_Infra/card/data-loading