This code base is dedicated to experiments and benchmark for NYULH Image Data Base.
convert format includes code for converting Dicom files to tar, tar.gz, HDF5 and HDF5 with Blosc.
dataloader includes Dataset Class loads data in each type of format into a dataset as inputs of DataLoader.
-
Convert CXR14 into FP16 pixel array and save them as DICOM to create a mimic NYULH radiology image dataset
-
Convert CXR14 Dicom into
- tar
- tar.gz
- HDF5
- HDF5 with Blosc
- HDF5, single file (all studies in one single HDF5)
- HDF5 with Blosc, single file (all studies in one single HDF5)
-
For DICOM with metadata, write the headers from dicom and save them into a csv for data ingress to databricks
-
Write a data loader for each format of the data, train Densenet with
- batch size = 256 and
- 8 H100 GPUs
-
Experiment with combinations of different parameters
- worker = 1, worker = 20
- GPU = 1, GPU = 8
-
Regression test by HPC team
- Convert time from DICOM to each file format
- Data loader I/O time
- Avg. model train time per epoch
| tar | tar.gz | HDF5 | HDF5 (Blosc) | HDF5, single file | HDF5, single file (Blosc) | |
|---|---|---|---|---|---|---|
| File Count | 112,120 | 112,120 | 112,120 | 112,120 | 1 | 1 |
| Disk Usage | ||||||
| % of Original Size | ||||||
| Convert Time |
| Configuration | Metric | tar | tar.gz | HDF5 | HDF5 (Blosc) | HDF5, single file | HDF5, single file (Blosc) |
|---|---|---|---|---|---|---|---|
| 1 Workers 1 GPU | Loading Time | ||||||
| 1 Workers 1 GPU | Avg. Training Time /epoch | ||||||
| 20 Workers 1 GPU | Loading Time | ||||||
| 20 Workers 1 GPU | Avg. Training Time /epoch |
| Configuration | Metric | tar | tar.gz | HDF5 | HDF5 (Blosc) | HDF5, single file | HDF5, single file (Blosc) |
|---|---|---|---|---|---|---|---|
| 1 Workers 8 GPUs | Loading Time | ||||||
| 1 Workers 8 GPUs | Avg. Training Time /epoch | ||||||
| 20 Workers 8 GPUs | Loading Time | ||||||
| 20 Workers 8 GPUs | Avg. Training Time /epoch |
| Format | 1 GPU Time | 8 GPU Time | Speedup Factor | Comment |
|---|---|---|---|---|
| HDF5, single file | ||||
| HDF5 (Blosc) | ||||
| tar.gz | ||||
| tar | ||||
| HDF5 | ||||
| HDF5, single file (Blosc) | GIL challenge |
| Format | 1 worker | 20 workers | Speedup Factor | Comment |
|---|---|---|---|---|
| HDF5, single file | ||||
| HDF5 (Blosc) | Training time is longer than non-compressed HDF5 because decompression takes time | |||
| tar.gz | ||||
| tar | ||||
| HDF5 | ||||
| HDF5, single file (Blosc) | Lock Contention (GIL bottleneck) |
| Format | Pros | Cons |
|---|---|---|
| tar.gz | “Linear” performance Saves the most space |
Long conversion time |
| HDF5 | Fast data loading and training Simple |
Doesn’t save much space |
| HDF5(Blosc) | Fastest data loading and training Saves a lot of space |
Can be slower when computational resources are limited |
| HDF5, single file (Blosc) | Saves space Takes advantage of HDF5 file structure Fairly shorter conversion time |
Requires users to write a custom DataLoader to avoid GIL bottleneck |
GPU Utilization Heavily dependent on optimal dataloading.Users need to pay attention, particularly when requesting multiple GPUs.