ElasticDistributedSampler

Models & Types ยท AiDotNet.Data.Sampling

Distributed sampler that evenly divides data across multiple workers with elastic scaling support.

Inheritance: DataSamplerBase โ†’ ElasticDistributedSampler

How It Works

Ensures each distributed worker sees a non-overlapping subset of the data each epoch. Supports dynamic resizing when workers join or leave (elastic training). Each worker gets dataset_size / num_replicas samples per epoch.

Constructors

Constructor Summary
ElasticDistributedSampler(ElasticDistributedSamplerOptions options) Creates a new elastic distributed sampler.

Properties

Property Summary
int DatasetSize { get; } Gets the total dataset size.
int Length { get; }
int NumReplicas { get; } Gets the current number of replicas.
int Rank { get; } Gets the current rank.

Methods

Method Summary
void Rescale(int numReplicas, int rank) Dynamically updates the number of replicas and rank for elastic scaling.