Project-MONAI / Project-MONAI/MONAI

PersistentDataset and CacheDataset hybrid

Open
#6,753 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Contribution wanted enhancement Feature request
Dominant language
Python
Stars
8.7k
Forks
1.6k
Avg merge
5d 1h
Merged PRs (30d)
20

Description

Is your feature request related to a problem? Please describe.
CacheDataset preprocesses the non-random transforms and loads the data into RAM.
PersistentDataset preprocesses the non-random transforms into pickled files on its first run, and any subsequent run reads them on the fly and applies the random transforms only.

However, when prototyping, you often rerun a setup with different hyper-parameters, and you end up waiting each time for the CacheDataset to preprocess the non-random transforms all over again. Using PersistentDataset on the other hand, won't require preprocessing them again at each run, but could still be slower than CacheDataset as it reads objects from the drive instead of RAM.

Describe the solution you'd like
I propose a combination of the two, that could also be framed as an extension to PersistentDataset that will allow loading of the pickled files into RAM. This way, the non-random transforms are only ever done once instead of always redoing them when loading the data into RAM.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name any files, tests, or entry points. Start by locating the CacheDataset and PersistentDataset implementations and their dataset tests, then determine how cached pickles could be loaded into RAM without repeating preprocessing. Done should include the hybrid behavior and coverage for repeated runs and random transforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.