-
Notifications
You must be signed in to change notification settings - Fork 5
Implement GNO head #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
aprokop
wants to merge
22
commits into
ORNL:main
Choose a base branch
from
aprokop:gno_head
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
c2b25c2
isgraph -> tkhead_type
aprokop d186696
Let Flow3D dataset to also provide geometry information
aprokop 2d3c001
Add GNO tokenizer head
aprokop b140104
Update inference
aprokop 4f34379
Address older review comments
aprokop dcbb0e6
Rename "geometry" to "grid_coords"
aprokop 9b6a021
Relax uncessesarily tightened cases
aprokop 2918550
Switch imod_bottom to imod
aprokop 687234b
Do not pass geometry to get_unified_preembedding
aprokop c909789
Inherit ModifiedGNOBlock from GNOBlock
aprokop 8ef1d66
Use torch instead of numpy to construct meshgrid
aprokop 33a6581
Rename geometry to grid
aprokop c1a69d8
Remove extra fluff from custom neighbor search
aprokop 7bb8421
Minor fixes
aprokop 93ccbe2
Use geometry mask
aprokop d86dfb7
Flatten geometry grid inside Flow3D dataset
aprokop efd8a11
Remove extra code in GNO block forward()
aprokop fca2659
Fix the order of the grid in Flow3D
aprokop 3b5519a
Update GNO architecture
aprokop 5b55ba9
Switch GNO head to follow GINO more closely
aprokop 26426a0
Fix output masking
aprokop 5a08bb3
Vectorize latent_grid rescaling
aprokop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| basic_config: &basic_config | ||
| # Run settings | ||
| log_to_screen: !!bool True # Log progress to screen. | ||
| save_checkpoint: !!bool True # Save checkpoints | ||
| checkpoint_save_interval: 10 # Save every # epochs - also saves "best" according to val loss | ||
| true_time: !!bool False # Debugging setting - sets num workers to zero and activates syncs | ||
| num_data_workers: 6 # Generally pulling 8 cpu per process, so using 6 for DL - not sure if best ratio | ||
| enable_amp: !!bool False # Use automatic mixed precision - blows up with low variance fields right now | ||
| compile: !!bool False # Compile model - Does not currently work | ||
| gradient_checkpointing: !!bool False # Whether to use gradient checkpointing - Slow, but lower memory | ||
| exp_dir: 'Demo_GNO' | ||
| log_interval: 1 # How often to log - Don't think this is actually implemented | ||
| pretrained: !!bool False # Whether to load a pretrained model | ||
| # Training settings | ||
| drop_path: 0.1 | ||
| batch_size: 32 #1 | ||
| max_epochs: 10 | ||
| scheduler_epochs: -1 | ||
| epoch_size: 50 #2000 # Artificial epoch size | ||
| rescale_gradients: !!bool False # Activate hook that scales block gradients to norm 1 | ||
| # optimizer: 'adan' # adam, adan, whatever else i end up adding - adan did better on HP sweep | ||
| optimizer: 'AdamW' # adam, adan, whatever else i end up adding - adan did better on HP sweep | ||
| scheduler: 'cosine' # Only cosine implemented | ||
| warmup_steps: 5 # Warmup when not using DAdapt | ||
| learning_rate: 1e-3 # -1 means use DAdapt | ||
| weight_decay: 1e-3 | ||
| # n_states: 12 # Number of state variables across the datasets - Can be larger than real number and things will just go unused | ||
| # n_states: 200 # Workaround PyTorch bug | ||
| n_states: 220 # Workaround PyTorch bug | ||
| n_states_cond: 0 | ||
| state_names: ['Vx', 'Vy', 'Vz', 'Pressure'] # Should be sorted | ||
| dt: 1 # Striding of data - Not currently implemented > 1 | ||
| leadtime_max: 1 #prediction lead time range [1, leadtime_max] | ||
| n_steps: 4 # Length of history to include in input | ||
| enforce_max_steps: !!bool False # If false and n_steps > dataset steps, use dataset steps. Otherwise, raise Exception. | ||
| accum_grad: 1 # Real batch size is accum * batch_size, real steps/"epoch" is epoch_size / accum | ||
| # Model settings | ||
| model_type: 'vit_all2all' | ||
| #space_type: '2D_attention' # Conditional on block type | ||
| tie_fields: !!bool False # Whether to use 1 embedding per field per data | ||
| embed_dim: 384 # Dimension of internal representation - 192/384/768/1024 for Ti/S/B/L | ||
| num_heads: 6 # Number of heads for attention - 3/6/12/16 for Ti/S/B/L | ||
| processor_blocks: 12 # Number of transformer blocks in the backbone - 12/12/12/24 for Ti/S/B/L | ||
| tokenizer_heads: | ||
| - head_name: "tk-3D" | ||
| patch_size: [[8, 8, 8]] # z, x, y | ||
| - head_name: "gno-flow3D" | ||
| patch_size: [[1, 1, 1]] | ||
| radius_in: 1.8 | ||
| radius_out: 1.9 | ||
| # resolution: [48, 48, 48] | ||
| resolution: [16, 16, 16] | ||
| n_channels: 4 | ||
| sts_model: !!bool False | ||
| sts_train: !!bool False #when True, we use loss function with two parts: l_coarse/base + l_total, so that the coarse ViT approximates true solutions directly | ||
| bias_type: 'none' # Options rel, continuous, none | ||
| # Data settings | ||
| train_val_test: [.8, .1, .1] | ||
| augmentation: !!bool False # Augmentation not implemented | ||
| use_all_fields: !!bool True # Prepopulate the field metadata dictionary from dictionary in datasets | ||
| tie_batches: !!bool False # Force everything in batch to come from one dset | ||
| extended_names: !!bool False # Whether to use extended names - not currently implemented | ||
| embedding_offset: 0 # Use when adding extra finetuning fields | ||
| # train_data_paths: [ ['/global/homes/a/aprokop/m4724/aprokop/Flowsaround3Dobjects/data/', 'flow3d', ''] ] | ||
| # valid_data_paths: [ ['/global/homes/a/aprokop/m4724/aprokop/Flowsaround3Dobjects/data/', 'flow3d', ''] ] | ||
| train_data_paths: [ ['/pscratch/sd/a/aprokop/Flowsaround3Dobjects_recompute/data/', 'flow3d', 'train', 'gno-flow3D'] ] | ||
| valid_data_paths: [ ['/pscratch/sd/a/aprokop/Flowsaround3Dobjects_recompute/data/', 'flow3d', 'val', 'gno-flow3D'] ] | ||
| append_datasets: [] # List of datasets to append to the input/output projections for finetuning | ||
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolutionandpatch_size