Interface for datasets that are too large to use `InMemoryDataset`
#4,543 opened on 2022幎4æ26æ¥
Repository metrics
- Stars
- Â (19,985 stars)
- PR merge metrics
-  (å¹³åããŒãž 35d 1h) (30d ã§ 14 merged PRs)
説æ
ð The feature, motivation and pitch
There are several examples of datasets for molecular property prediction where each individual graph example easily fits in memory but there are too many examples to fit within the InMemoryDataset interface. One solution is to save each example in its own .pt file but this introduces a significant filesystem overhead to access each example.
A better solution is to partition the data such that there are many graphs serialised within a single .pt file. The number of graphs can be considered a chunk_size parameter which is independent from the training batch_size. This ChunkedDataset interface would be expected to scale to as large a dataset as desired while avoiding the significant overhead of having one graph per file.
The design idea is roughly:
ChunkedDatasetinherits from the PyGDatasetinterface- Accepts a
chunk_sizeargument - Has an abstract method
process_chunkthat accepts a list of data objects that can be processed and saved as a single.ptfile.
Other considerations:
- The training batch size should not depend on the
chunk_sizeso the dataset ChunkedDatasetshould support splitting to read from parallel workers as well as random shuffling
Alternatives
No response
Additional context
No response