2024-10-21
HPC file systems tuned for
Metadata updates
Warning
Major performance degradation for… entire system/all users!
Tip
Use file systems well!
Many data types
.csv, ….txt, .json, ….jpeg, .tiff, ….mp4, …Many small files == many metadata operations
Reading CSV is… very slow
Alternatives:
Can be read by pandas/polars/R
Parquet
Arrow
Tip
Read/write multiple “files” per operation
Random 200,000 reads of 100,000 “files” (\(\le\) 1,024 chars)
| data format | time (s) | metadata IOPs |
|---|---|---|
| naive | 64.7 | 100,000 |
| ZIP file | 97.4 | 1 |
| dataset | 22.7 | 3 |
Read 100,000 “files” (\(\le\) 1,024 chars)
| data format | time (s) | metadata IOPs |
|---|---|---|
| naive | 74.7 | 100,000 |
| ZIP file | 3.1 | 1 |
| dataset | 17.2 | 3 |
Warning
Don’t use ASCII files!
Advantages
Mostly for numerical data
Tip
Data layout matters a lot!
| layout | time (s) |
|---|---|
| row-major | 144.4 |
| column-major | 8760.6 |
| stacked | 8346.8 |
Random 10,000 reads of 2,000 matrices (648 \(\times\) 1152 \(\times\) 4, uint8)
Many formats: JPEG, GIF, PNG, TIFF
Can have
Store as
uint8How? Use Hugging Face 🤗 datasets library
Contiguous read
| data format | time (s) | nr. metadata IOPs |
|---|---|---|
| naive | 12.6 | 2,000 |
| HDF5 | 15.7 | 1 |
| datasets | 14.3 | 3 |
Warning
Reading individual files \(\mapsto\) many more metadata IOPs
Random 10,000 reads of 2,000 matrices (\(648 \times 1152 \times 4\), uint8)
| data format | Scenario 1 | Scenario 2 | ||
|---|---|---|---|---|
| time (s) | metadata IOPs | time (s) | metadata IOPs | |
| naive | 41.2 | 10,000 | 11.0 + 36.9 | 2,000 |
| HDF5 | 144.4 | 1 | 10.6 + 41.2 | 1 |
| datasets | 64.5 | 3 | 17.0 + 52.4 | 3 |
Running script loads lots of modules/packages == lots of metadata operations
Solution: use containers
Apptainer is supported on VSC-systems
lmod module loads + Python script module load \(\mapsto\) 14 seconds, gazillion IOPs--fakeroot).local et al.Tip
Remember: machine learning is not I/O bound: it’s all about metadata IOPs!
If necessary, take trainings
Contact support