Replace PyArrow Table with HuggingFace datasets.Dataset.from_parquet() for memory-mapped Arrow access. This avoids loading the entire parquet file into RAM per DataLoader worker. Before: 8 workers × 4GB parquet = ~32GB RAM (OOM on 30GB machines) After: memory-mapped cache shared across all workers via OS page cache - First load builds Arrow cache (~76s one-time cost) - Subsequent loads: <1s (reads from cached .arrow file) - Process RSS: ~2.1GB vs ~4.1GB+ per worker previously - Enables using num_workers=8 on machines with 30GB RAM Tested: full pipeline (dataset → dataloader → forward pass) verified working with 4 workers on g6.2xlarge (L4 GPU, 30GB RAM). |
||
|---|---|---|
| .. | ||
| eval_images | ||
| __init__.py | ||
| lm_dataset.py | ||