Skip to content

How can I use PertData with PyTorch DDP DistributedSampler? #100

@l024258

Description

@l024258

I’m training a perturbation‑prediction model using datasets managed via GEARS PertData, and I need to run multi‑GPU training with PyTorch Distributed Data Parallel (DDP). What’s the recommended way to connect a PertData dataset to a DataLoader that uses torch.utils.data.distributed.DistributedSampler so that each rank gets a disjoint shard, preserves split integrity (train/val/test), and supports epoch‑level shuffling?

I’m specifically looking for guidance or example code for:

  • Converting or wrapping PertData into a PyTorch‑style dataset that DistributedSampler understands
  • Handling split selection (train, val, test) so that all ranks see consistent subsets
  • Ensuring deterministic shuffling across epochs via sampler.set_epoch(epoch)
  • Best practices around rank/world size, seed control, and worker initialization

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions