Skip to main content

Train in place on n-dimensional cloud tensors: the data-loader orchestration layer on top of solved async IO (obstore / zarr v3 / icechunk).

Project description

insitubatch

Train in place on n-dimensional cloud tensors.

insitubatch is the data-loader orchestration layer that sits on top of already-solved async cloud IO (obstore / zarr v3 / icechunk). It turns an existing Zarr archive into a shuffled, split-aware, GPU-saturating PyTorch source — with no reshard — and a Python hot path that scales with chunks, not samples.

The IO race is over (obstore/icechunk saturate the NIC). The loader race is open. insitubatch builds the layer that projects like light-speed-io and hypergrib stopped one step short of. See DESIGN.md.

Why

The classic PyTorch DataLoader spreads work across worker processes, each running a synchronous __getitem__. Against cloud Zarr that means no shared chunk cache (every worker re-reads the same chunk), no way to drive async obstore, and dask thread pools nested inside forked workers. insitubatch inverts it: one async event loop drives concurrent reads; a bounded shuffle-block buffer assembles batches; torch runs num_workers=0.

Status

🚧 Pre-alpha skeleton. Abstractions and control flow are in place; the live store read in io.py and the GPU path are stubbed. Not yet usable for real training — this is the design substrate.

Install (dev)

uv sync                  # core engine + dev tools
uv sync --extra torch    # add the torch IterableDataset surface
uv sync --extra gpu      # CUDA box only: cupy + kvikio zero-copy path

Shape of the API (target)

from insitubatch import split_by_chunk, ArrayGeometry, SplitName
from insitubatch.source import InSituDataset
from torch.utils.data import DataLoader

geom = ArrayGeometry("t2m", shape=(8760, 721, 1440), chunks=(24, 721, 1440), dtype=...)
manifest = split_by_chunk(geom, fractions=(0.8, 0.1, 0.1))

ds = InSituDataset(store, {"t2m": geom}, manifest, SplitName.TRAIN,
                   batch_size=32, block_chunks=16)

# parallelism lives in insitubatch's event loop, not in workers:
loader = DataLoader(ds, batch_size=None, num_workers=0)
for epoch in range(n_epochs):
    ds.set_epoch(epoch)
    for batch in loader:
        ...

License

MIT — see LICENSE.

Project details


Download files

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

Source Distribution

insitubatch-0.0.1.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

insitubatch-0.0.1-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file insitubatch-0.0.1.tar.gz.

File metadata

  • Download URL: insitubatch-0.0.1.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for insitubatch-0.0.1.tar.gz
Algorithm Hash digest
SHA256 6b5f03ea00afd7324f90c595f0adf9407c8511ee76ac632762dd9994341e4aa4
MD5 f4b21aeb5034ecf58aa6c0998d9386a6
BLAKE2b-256 23fe2259893f2dc997de1f4a4134db882e89179e4d67ac47e356aca19a0dfee4

See more details on using hashes here.

Provenance

The following attestation bundles were made for insitubatch-0.0.1.tar.gz:

Publisher: release.yml on emfdavid/insitubatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file insitubatch-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: insitubatch-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for insitubatch-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c1c55582fc9cc08f2b54dd4af44acb8e75b691024edfd8b937bfad23601ae06b
MD5 9b8e2f3cee3af11c1a5b95327177bb69
BLAKE2b-256 c8f91ee7de407332ede238c8a3db714d154aa96d81fc9da3b132914c2d8ff82a

See more details on using hashes here.

Provenance

The following attestation bundles were made for insitubatch-0.0.1-py3-none-any.whl:

Publisher: release.yml on emfdavid/insitubatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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