Skip to main content

Abstract Dataloader: Dataloader Not Included

What is the Abstract Dataloader?

The abstract dataloader (ADL) is a minimalist specification for creating composable and interoperable dataloaders and data transformations, along with abstract template implementations and reusable generic components, including a pytorch interface.

Metadata─────────────────┐
   │                     ▼
   └────►Sensor   Synchronization
           │             │
           └────►Trace◄──┘
                   │
                   └────►Dataset───►Transform

The ADL's specifications and bundled implementations lean heavily on generic type annotations in order to enable type checking using static type checkers such as mypy or pyright and runtime (dynamic) type checkers such as beartype and typeguard, even when applying functor-like generic transforms such as sequence loading and transforms.

[!TIP] Since the abstract dataloader uses python's structural subtyping - Protocol - feature, the abstract_dataloader is not a required dependency for using the abstract dataloader! Implementations which follow the specifications are fully interoperable, including with type checkers, even if they do not have any mutual dependencies - including this library.

For detailed documentation, please see the project site.

Why Abstract?

Loading, preprocessing, and training models on time-series data is ubiquitous in machine learning for cyber-physical systems. However, unlike mainstream machine learning research, which has largely standardized around "canonical modalities" in computer vision (RGB images) and natural language processing (ordinary unstructured text), each new setting, dataset, and modality comes with a new set of tasks, questions, challenges - and data types which must be loaded and processed.

This poses a substantial software engineering challenge. With many different modalities, processing algorithms which operate on the power set of those different modalities, and downstream tasks which also each depend on some subset of modalities, two undesirable potential outcomes emerge:

  1. Data loading and processing components fragment into an exponential number of incompatible chunks, each of which encapsulates its required loading and processing functionality in a slightly different way. The barrier this presents to rapid prototyping needs no further explanation.
  2. The various software components coalesce into a monolith which nominally supports the power set of all functionality. However, in addition to the compatibility issues that come with bundling heterogeneous requirements such as managing "non-dependencies" (i.e. dependencies which are required by the monolith, but not a particular task), this also presents a hidden challenge in that by support exponentially many possible configurations, such an architecture is also exponentially hard to debug and verify.

However, we do not believe that these outcomes are a foregone conclusion. In particular, we believe that it's possible to write "one true dataloader" which can scale while maintaining intercompability by not writing a common dataloader at all -- but rather a common specification for writing dataloaders. We call this the "abstract dataloader".

Setup

While it is not necessary to install the abstract_dataloader in order to take advantage of ADL-compliant components, installing this library provides access to Protocol types which describe each interface, as well as generic components which may be useful for working with ADL-compliant components.

The abstract_dataloader is currently distributed using github:

pip install git+git@github.com:WiseLabCMU/abstract-dataloader.git

[!IMPORTANT] To use the optional pytorch integrations, we also require either torch >= 2.2 (first version to add torch.utils._pytree.tree_leaves) or torch and optree >= 0.13 (first "mostly stable" version) in order to have access to a fully-featured tree manipulation module. The included torch extra will install the latest pytorch and optree, with constraints torch >= 2.2 and optree >= 0.13.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abstract_dataloader-0.2.0.tar.gz (97.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abstract_dataloader-0.2.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file abstract_dataloader-0.2.0.tar.gz.

File metadata

  • Download URL: abstract_dataloader-0.2.0.tar.gz
  • Upload date:
  • Size: 97.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.16

File hashes

Hashes for abstract_dataloader-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a4b72b5549f72ef3616afc12216a10ff5f8576420ee081c33a9781e60942f4c3
MD5 5bd1aa807ca54917dbe962354fbba4ef
BLAKE2b-256 25aaca837dba0992a081f25b2b75c626eec0d60a8310a4c8ff0521c287f31fa2

See more details on using hashes here.

File details

Details for the file abstract_dataloader-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for abstract_dataloader-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e7122dda33504c10ba927557d35168787ba9e0726ee389c39b98dd0bcdd9caa
MD5 adbbcb01dcb34a7d6a2207e07917fa42
BLAKE2b-256 2d84014f1bb6ed589f9f11af39734d100025ab512d70912996bf6fe0c7c3bcdd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page