Skip to content

Enforce that global batch size is not larger than the available dataset#55

Merged
PatrickRMiles merged 1 commit into
LBANN:mainfrom
michaelmckinsey1:check-globalbatch
Apr 22, 2026
Merged

Enforce that global batch size is not larger than the available dataset#55
PatrickRMiles merged 1 commit into
LBANN:mainfrom
michaelmckinsey1:check-globalbatch

Conversation

@michaelmckinsey1

Copy link
Copy Markdown
Collaborator

Default config is 5 categories * 144 instances = 720 pairs
3 (category, instance) pairs -> 2 * n_fracts_per_vol / 2
720 / 3 = 240 total volumes/examples
180 training samples from 75/25 split

global batch size = batch_size * (world_size / prod(dc_num_shards))

So in order to ensure the same optimizer step doesn't process duplicate samples, we want global_batch_size <= training samples.

We could create a larger version of ScaFFold/datagen/ifs_weight/weights_ins145.csv, but adding more instances dilutes the samples, because all are variations of a single instance

(original) 1,1,1,1,1,1,1,1,1,1,1,1
vs
0.9,1,1,1,1,1,1,1,1,1,1,1

This isn't an issue in practice, because while at larger scales we need bigger world_size we also need more sharding, which keeps global batch size relatively low. I'm adding this check to ensure training quality is not influenced by duplicate samples.

@michaelmckinsey1 michaelmckinsey1 self-assigned this Apr 22, 2026
@michaelmckinsey1 michaelmckinsey1 changed the title Enforce that global batch size is not larger than the dataset Enforce that global batch size is not larger than the available dataset Apr 22, 2026

@PatrickRMiles PatrickRMiles left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@PatrickRMiles
PatrickRMiles merged commit 0c140d5 into LBANN:main Apr 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants