Skip to content

How to work with pin_memory? #7

Description

@tea1528

Really appreciate a great blog and clear demo.

I implemented my own version of COCO loader based on your TorchSerializedList and the default RAM usage decreases significantly. However, when I set pin_memory=True in PyTorch dataloader, I see that USS gets increased quite a lot while the shared memory stays the same for the default COCODetection and TorchSerializedList

  RSS USS Shared
default / pin_memory=True 7.31GB 3.45GB 3.87GB
default / pin_memory=False 4.31GB 455.76MB 3.87GB
shm / pin_memory=True 4.72GB 3.65GB 1.22GB
shm / pin_memory=False 1.72GB 508.69MB 1.22GB

From a quick search, the shared memory doesn't seem to work with pin_memory well according to this thread
. Detectron2 repo doesn't seem to use any pin_memory in the dataloader. Can you provide your thoughts on relationship of using the serialized dataset with pin_memory=True?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions