DistributedBucketSampler
Models & Types ยท AiDotNet.Data.Sampling
Combines distributed partitioning with bucket batching for efficient distributed NLP training.
Inheritance: DataSamplerBase โ DistributedBucketSampler
Implements: IBatchSampler
How It Works
Each rank receives a disjoint partition of the dataset (like DistributedSampler), then within that partition, samples are grouped by length into buckets for efficient batching (like BucketBatchSampler). This minimizes padding waste in distributed sequence model training.
Constructors
| Constructor | Summary |
|---|---|
DistributedBucketSampler(int[] sampleLengths, int numReplicas, int rank, int batchSize, int numBuckets, bool shuffle, bool dropLast, int? seed) |
Creates a new distributed bucket sampler. |
Properties
| Property | Summary |
|---|---|
bool DropLast { get; set; } |
|
int BatchSize { get; set; } |
|
int Length { get; } |
Methods
| Method | Summary |
|---|---|
IEnumerable<int[]> GetBatchIndices() |