Skip to content

Internal ensembling in Aurora models - #199

Open
Agnieszka Słowik (Slowika) wants to merge 22 commits into
microsoft:mainfrom
Slowika:agaslowik/ensemble-members-internal-to-aurora
Open

Agnieszka Słowik (Slowika) wants to merge 22 commits into
microsoft:mainfrom
Slowika:agaslowik/ensemble-members-internal-to-aurora

Conversation

@Slowika

@Slowika Agnieszka Słowik (Slowika) commented Aug 13, 2026 •

Copy link
Copy Markdown

Addressed Issue #192.
Developed with the aid of AI, in line with the Code of Conduct.
Jonathan Weyn (@jweyn) Wessel (@wesselb)

Problem

Running an N-member ensemble currently requires a loop that calls Aurora.forward()/rollout() once per member, and then manually combining the results. This under-utilises the GPU (N separate launches) when the GPU is capable of storing all of the ensemble state.

Change

Add a num_ensemble_members constructor argument to Aurora (default 1, fully backwards compatible). When set to N > 1, forward()/rollout() run all N members as a single, fused batched computation internally, rather than N separate calls. This is useful when combined with stochastic=True: since the backbone's existing per-batch-element noise injection means every instance receives independent noise.

This is purely an additional option: looping over forward()/rollout() to implement ensembling remains fully supported and unaffected.

Design notes

  • Batch's public shape contract is untouched: no new dimension, no new methods. The batch-dimension tiling used to fuse the computation is a private implementation detail (_tile_batch/_split_batch in aurora/batch.py), never exposed on Batch itself.
  • forward()'s return type is now Batch | list[Batch]: a plain Batch when num_ensemble_members == 1 (no change from today), or a list[Batch] of N standard-shaped batches: pred[m] is member m's ordinary, individually inspectable Batch.
  • rollout() follows the same contract per yielded step, keeping the tiled representation internal across autoregressive steps for efficiency, and temporarily forcing model.num_ensemble_members = 1 during its loop (restored via try/finally, even on early generator closure) so nested forward() calls don't re-tile.
  • Warns if num_ensemble_members > 1 is requested on a non-stochastic model, since all members would then be identical.

Tests

Added tests/v1p5/test_ensemble.py covering:

  • _tile_batch/_split_batch round-tripping
  • constructor validation/warnings
  • forward()'s single-Batch vs. list[Batch] return contract
  • member divergence under stochastic=True vs. identity under stochastic=False
  • rollout()'s per-step output shape plus num_ensemble_members restoration (including on early .close()).

@Slowika
Agnieszka Słowik (Slowika) marked this pull request as ready for review August 13, 2026 12:11
@Slowika
Agnieszka Słowik (Slowika) requested a review from a team August 13, 2026 12:11
@Slowika Agnieszka Słowik (Slowika) changed the title Add support for internal ensembling in Aurora models. Add tests. Internal ensembling in Aurora models Aug 13, 2026
@Slowika
Agnieszka Słowik (Slowika) force-pushed the agaslowik/ensemble-members-internal-to-aurora branch from 118564d to f0fa368 Compare August 13, 2026 14:48
@wesselb

Copy link
Copy Markdown
Collaborator

Thanks Agnieszka Słowik (@Slowika) for opening a PR! I replied on the issue and mentioned the idea of using the batch size to produce multiple ensemble members simultaneously. Do you think that approach would suffice, or does this capability need to be added to the model explicitly?

@Slowika

Copy link
Copy Markdown
Author

Thanks Agnieszka Słowik (Agnieszka Słowik (@Slowika)) for opening a PR! I replied on the issue and mentioned the idea of using the batch size to produce multiple ensemble members simultaneously. Do you think that approach would suffice, or does this capability need to be added to the model explicitly?

I've addressed your feedback. Should be ready for review now! Jonathan Weyn (@jweyn)

@wesselb Wessel (wesselb) 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.

Thanks for the changes, Agnieszka Słowik (@Slowika)! This is looking much simpler now. Really great! :) I've left some Claude-assisted comments. After those, I think this is ready to be merged!

Comment thread aurora/__init__.py
Comment thread aurora/batch.py
Comment thread aurora/rollout.py Outdated
Comment thread aurora/rollout.py Outdated
Comment thread aurora/rollout.py
Comment thread tests/v1p5/test_ensemble.py Outdated
@Slowika

Copy link
Copy Markdown
Author

Hi Wessel (Wessel (@wesselb))! Thank you for the review. I addressed all comments and made some of the suggested changes. For the remaining Claude suggestions, they contradict your suggestions in the issue, especially regarding tiling. Could you please have another look?

@wesselb

Copy link
Copy Markdown
Collaborator

Thanks, Agnieszka Słowik (@Slowika)! I've replied to all outstanding comments.

Comment thread docs/models.md
@Slowika

Copy link
Copy Markdown
Author

Hi Wessel (Wessel (@wesselb))! Thank you for the review :). I have addressed all comments and made the suggested changes.

@wesselb Wessel (wesselb) 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.

Thanks, Agnieszka Słowik (@Slowika)! This is looking great now. A few more comments and suggestions. I'd be happy to merge this in after those. :)

snip: deleted Claude comment about the PR description

Comment thread aurora/batch.py Outdated
Comment thread aurora/batch.py Outdated
Comment thread docs/models.md
Comment thread docs/models.md Outdated
Comment thread tests/v1p5/test_ensemble.py Outdated
Comment thread tests/v1p5/test_ensemble.py
Comment thread tests/v1p5/test_ensemble.py Outdated
Comment thread tests/v1p5/test_ensemble.py Outdated
Co-authored-by: Wessel <wessel.p.bruinsma@gmail.com>
Co-authored-by: Wessel <wessel.p.bruinsma@gmail.com>
Co-authored-by: Wessel <wessel.p.bruinsma@gmail.com>
Co-authored-by: Wessel <wessel.p.bruinsma@gmail.com>
Co-authored-by: Wessel <wessel.p.bruinsma@gmail.com>
Co-authored-by: Wessel <wessel.p.bruinsma@gmail.com>
Co-authored-by: Wessel <wessel.p.bruinsma@gmail.com>
Co-authored-by: Wessel <wessel.p.bruinsma@gmail.com>
@Slowika

Agnieszka Słowik (Slowika) commented Oct 8, 2026 •

Copy link
Copy Markdown
Author

Thanks for the review, Wessel (@wesselb)! Your comments have been addressed and I agree with all of your suggestions.

I just need one final re-approval before this PR can be merged.

This branch has not been deployed

No deployments
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.

Make the number of ensemble members internal to the Aurora model.

2 participants