From 72f06b3b26ea83daaf6a3e6488a5b7f27f51afe2 Mon Sep 17 00:00:00 2001 From: Kaustubh Tangsali <71059996+ktangsali@users.noreply.github.com> Date: Wed, 6 Nov 2024 10:03:18 -0800 Subject: [PATCH 1/4] Add `import_or_fail` decorator to lagranginan tests (#707) * Update test_lagrangian.py --- test/datapipes/test_lagrangian.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/datapipes/test_lagrangian.py b/test/datapipes/test_lagrangian.py index 5f4f1cdc6..9446fa08e 100644 --- a/test/datapipes/test_lagrangian.py +++ b/test/datapipes/test_lagrangian.py @@ -60,8 +60,9 @@ def test_lagrangian_dataset_constructor(data_dir, device, pytestconfig): assert graph.ndata["y"].shape[-1] > 0 # node targets +@import_or_fail(["tensorflow", "dgl"]) @pytest.mark.parametrize("device", ["cuda:0", "cpu"]) -def test_graph_construction(device): +def test_graph_construction(device, pytestconfig): from modulus.datapipes.gnn.lagrangian_dataset import compute_edge_index mesh_pos = torch.tensor([[0.0, 0.0], [0.01, 0.0], [1.0, 1.0]], device=device) From 8125c9e3042fe62c6a6414f815fd684fb2e0650e Mon Sep 17 00:00:00 2001 From: David Pruitt Date: Tue, 19 Nov 2024 13:20:58 -0600 Subject: [PATCH 2/4] [fix] Fix for failing healpix dataloader test (#696) * Move cuda padding routines to healpix.py, check for cuda before attempting cuda install * Update the conf paths in docs (#712) * Fix for dlwp_healpix dataloader not including coupled variables (#702) Co-authored-by: David Pruitt * Adding DoMINO example to Modulus (#709) --------- Co-authored-by: Kaustubh Tangsali <71059996+ktangsali@users.noreply.github.com> Co-authored-by: Kaustubh --------- Co-authored-by: Kaustubh Tangsali <71059996+ktangsali@users.noreply.github.com> Co-authored-by: ivanauyeung <106317256+ivanauyeung@users.noreply.github.com> Co-authored-by: RishikeshRanade <65631160+RishikeshRanade@users.noreply.github.com> Co-authored-by: Kaustubh --- modulus/datapipes/healpix/data_modules.py | 2 +- .../datapipes/healpix/timeseries_dataset.py | 4 +-- .../dlwp_healpix/test_healpix_layers.py | 34 ++++++++----------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/modulus/datapipes/healpix/data_modules.py b/modulus/datapipes/healpix/data_modules.py index 4c4b48968..fdabb9f8d 100644 --- a/modulus/datapipes/healpix/data_modules.py +++ b/modulus/datapipes/healpix/data_modules.py @@ -285,7 +285,7 @@ def create_time_series_dataset_classic( for variable in all_variables: file_name = _get_file_name(src_directory, prefix, variable, suffix) logger.debug("open nc dataset %s", file_name) - if "sample" in list(xr.open_dataset(file_name).dims.keys()): + if "sample" in list(xr.open_dataset(file_name).sizes.keys()): ds = xr.open_dataset(file_name, chunks={"sample": batch_size}).rename( {"sample": "time"} ) diff --git a/modulus/datapipes/healpix/timeseries_dataset.py b/modulus/datapipes/healpix/timeseries_dataset.py index fed380256..a36eb33ff 100644 --- a/modulus/datapipes/healpix/timeseries_dataset.py +++ b/modulus/datapipes/healpix/timeseries_dataset.py @@ -303,8 +303,8 @@ def _get_time_index(self, item): if self.forecast_mode else (item + 1) * self.batch_size + self._window_length ) - if not self.drop_last and max_index > self.ds.dims["time"]: - batch_size = self.batch_size - (max_index - self.ds.dims["time"]) + if not self.drop_last and max_index > self.ds.sizes["time"]: + batch_size = self.batch_size - (max_index - self.ds.sizes["time"]) else: batch_size = self.batch_size return (start_index, max_index), batch_size diff --git a/test/models/dlwp_healpix/test_healpix_layers.py b/test/models/dlwp_healpix/test_healpix_layers.py index d7f822470..fba2b3468 100644 --- a/test/models/dlwp_healpix/test_healpix_layers.py +++ b/test/models/dlwp_healpix/test_healpix_layers.py @@ -154,38 +154,34 @@ def test_HEALPixLayer_initialization(device, multiplier): def test_HEALPixLayer_forward(device, multiplier): layer = HEALPixLayer(layer=MulX, multiplier=multiplier) + kernel_size = 3 + dilation = 2 + in_channels = 4 + out_channels = 8 + tensor_size = torch.randint(low=2, high=4, size=(1,)).tolist() - tensor_size = [24, 4, *tensor_size, *tensor_size] + tensor_size = [24, in_channels, *tensor_size, *tensor_size] invar = torch.rand(tensor_size, device=device) outvar = layer(invar) assert common.compare_output(outvar, invar * multiplier) - # test nhwc mode and dilation layer = HEALPixLayer( layer=torch.nn.Conv2d, - in_channels=4, - out_channels=8, - kernel_size=3, + in_channels=in_channels, + out_channels=out_channels, + kernel_size=kernel_size, device=device, - # dilation=4, - ) - - outvar = layer(invar) - - layer = HEALPixLayer( - layer=torch.nn.Conv2d, - in_channels=4, - out_channels=8, - kernel_size=3, - device=device, - dilation=1, + dilation=dilation, enable_healpixpad=True, enable_nhwc=True, ) - assert outvar.shape == layer(invar).shape - assert outvar.stride() != layer(invar).stride() + # size of the padding added byu HEALPixLayer + expected_shape = [24, out_channels, tensor_size[-1], tensor_size[-1]] + expected_shape = torch.Size(expected_shape) + + assert expected_shape == layer(invar).shape del layer, outvar, invar torch.cuda.empty_cache() From f7587524969bb7f2f7fd29529ea1196571236ac1 Mon Sep 17 00:00:00 2001 From: Kaustubh Tangsali <71059996+ktangsali@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:57:01 -0800 Subject: [PATCH 3/4] Update versions (#719) --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- CHANGELOG.md | 28 ++++++++++++++++----------- modulus/__init__.py | 2 +- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 61da3b0ff..7721031dc 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -31,7 +31,7 @@ body: attributes: label: Version description: What version of Modulus are you running? - placeholder: "example: 0.8.0" + placeholder: "example: 0.9.0" validations: required: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 96d2be024..295eebc3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.9.0a0] - 2024-11-XX +## [0.10.0a0] - 2025-01-XX + +### Added + +### Changed + +### Deprecated + +### Removed + +### Fixed + +### Security + +### Dependencies + +## [0.9.0] - 2024-12-04 ### Added @@ -32,16 +48,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Extended the checkpointing utility to store metadata. - Corrected missing export of loggin function used by transolver model -### Deprecated - -### Removed - -### Fixed - -### Security - -### Dependencies - ## [0.8.0] - 2024-09-24 ### Added diff --git a/modulus/__init__.py b/modulus/__init__.py index 00176d2ea..913ca9238 100644 --- a/modulus/__init__.py +++ b/modulus/__init__.py @@ -19,4 +19,4 @@ from .models.meta import ModelMetaData from .models.module import Module -__version__ = "0.9.0a0" +__version__ = "0.9.0" From 8922d8cdb8be11e2dc94283f2e513b5ab59e7641 Mon Sep 17 00:00:00 2001 From: Kaustubh Date: Wed, 27 Nov 2024 19:40:46 +0000 Subject: [PATCH 4/4] update version --- modulus/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modulus/__init__.py b/modulus/__init__.py index 913ca9238..7b46dc60b 100644 --- a/modulus/__init__.py +++ b/modulus/__init__.py @@ -19,4 +19,4 @@ from .models.meta import ModelMetaData from .models.module import Module -__version__ = "0.9.0" +__version__ = "0.10.0a0"