feat: Add batched tensor expansion utilities for O(S) ensemble unroll…#489
Open
Debadri-das wants to merge 3 commits intomllam:mainfrom
Open
feat: Add batched tensor expansion utilities for O(S) ensemble unroll…#489Debadri-das wants to merge 3 commits intomllam:mainfrom
Debadri-das wants to merge 3 commits intomllam:mainfrom
Conversation
Contributor
Sir-Sloth-The-Lazy
left a comment
There was a problem hiding this comment.
Just a heads up you missed the case when S == T . Love the idea !
Contributor
Sir-Sloth-The-Lazy
left a comment
There was a problem hiding this comment.
is this intentional ?
Collaborator
|
linking #226 and #332 here, to remember the potential connection. this is one for @joeloskarsson to review. |
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
This PR introduces a standalone batch-expanding PyTorch utility (
expand_ensemble_batchandfold_ensemble_batch) to optimize tensor manipulation for Ensemble Lateral Boundary Conditions (LBCs) and probabilistic forecasting variables.Motivation and Context: Currently, probabilistic processing of$S$ ensemble members often relies on sequential $O(S)$ sequential bottlenecks, these functions leverage
forloops. To support the upcoming model refactoring and probabilistic capabilities without introducingtorch.repeat_interleave()and.view()to dynamically flatten state tensors(B, ...) -> (B * S, ...). This enables optimized parallelized operations over the GPU without permanently mutating standard AR model dimensions.Dependencies: None. Built strictly with standard PyTorch tensor primitives.
Issue Link
#49 and #62
Type of change
Checklist before requesting a review
Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
Author checklist after completed review
Checklist for assignee