libffcv / ffcv

FFCV: Fast Forward Computer Vision (and other ML workloads!)
https://ffcv.io
Apache License 2.0
2.84k stars 178 forks source link

Advice on increasing dataloading speed given ample resources - os_cache no effect? #207

Open phelps-matthew opened 2 years ago

phelps-matthew commented 2 years ago

Hi there - thank you for releasing a much needed data loading library for the pytorch community.

I've read over all the information in the performance guide and am empirically finding approximately equal performance across a wide variety of settings. I'd love to hear if there is anything I might be missing.

Context:

Observations:

Curiosities:

Overall I would say my training speed is by no means bad or worse, but I did expect a much larger improvement with os_cache in particular. Appreciate any advice, thanks!

Extra: My deecoding pipeline is very basic.

   pipeline = {
        "x_img": [
            SimpleRGBImageDecoder(),
            ToTensor(),
            ToDevice(device, non_blocking=True),
            # channel_last = True set by default, but maintains NCHW shape
            ToTorchImage(),
            NormalizeImage(mean, std, type=np.float32),
            Grayscale(),
        ],
        "x_2d": [
            NDArrayDecoder(),
            ToTensor(),
            ToDevice(device, non_blocking=True),
        ],
        "hbox_norm": [
            NDArrayDecoder(),
            ToTensor(),
            ToDevice(device, non_blocking=True),
        ],
        "box_norm": [
            NDArrayDecoder(),
            ToTensor(),
            ToDevice(device, non_blocking=True),
        ],
        "q": [
            NDArrayDecoder(),
            ToTensor(),
            ToDevice(device, non_blocking=True),
        ],
        "trans": [
            NDArrayDecoder(),
            ToTensor(),
            ToDevice(device, non_blocking=True),
        ],
        "so3": [
            NDArrayDecoder(),
            ToTensor(),
            ToDevice(device, non_blocking=True),
        ],
        "annot": [BytesDecoder()],
    }