Skip to content

Commit 3b513ef

Browse files
daviddpruittktangsaliivanauyeungRishikeshRanade
authored
[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 <[email protected]> * Adding DoMINO example to Modulus (#709) --------- Co-authored-by: Kaustubh Tangsali <[email protected]> Co-authored-by: Kaustubh <[email protected]> --------- Co-authored-by: Kaustubh Tangsali <[email protected]> Co-authored-by: ivanauyeung <[email protected]> Co-authored-by: RishikeshRanade <[email protected]> Co-authored-by: Kaustubh <[email protected]>
1 parent b21d67d commit 3b513ef

File tree

6 files changed

+35
-24
lines changed

6 files changed

+35
-24
lines changed

docs/img/domino_result_rtwt.jpg

4.01 MB
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# DoMINO: Decomposable Multi-scale Iterative Neural Operator for External Aerodynamics
2+
3+
DoMINO is a local, multi-scale, point-cloud based model architecture to model large-scale
4+
physics problems such as external aerodynamics. The DoMINO model architecture takes STL
5+
geometries as input and evaluates flow quantities such as pressure and
6+
wall shear stress on the surface of the car as well as velocity fields and pressure
7+
in the volume around it. The DoMINO architecture is designed to be a fast, accurate
8+
and scalable surrogate model for large-scale simulations.
9+
10+
The DoMINO model architecture is used to support the Real Time Wind Tunnel OV Blueprint
11+
demo presented at Supercomputing' 24.
12+
13+
![Results from DoMINO for RTWT SC demo](../../../../docs/img/domino_result_rtwt.jpg)
14+
15+
More details on the model architecture and reference pipeline will be released soon.

examples/generative/diffusion/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Datasets used for model training and sampling can be downloaded via the followin
3030
## Running the Experiments
3131
Download the high res and low res data and save the data files to the subdirectory ``modulus/examples/generative/diffusion/Kolmogorov_2D_data/``.
3232

33-
- Note: The directory from which the downloaded dataset files are loaded is specified in the configuration yaml files at ``modulus/examples/generative/diffusion/Kolmogorov_2D_data/conf/``. In the case when the default relative file location in a yaml file cannot be correctly recognized, please replace the relative location with the absolute location. For example, in the configuration file "modulus/examples/generative/diffusion/Kolmogorov_2D_data/conf/config_dfsr_train.yaml", Line 24, the value of the key 'data' can be changed to an absolute file directory of the dataset file, e.g., ``/<directory of modulus>/examples/generative/diffusion/Kolmogorov_2D_data/kf_2d_re1000_256_40seed.npy``
33+
- Note: The directory from which the downloaded dataset files are loaded is specified in the configuration yaml files at ``modulus/examples/generative/diffusion/conf/``. In the case when the default relative file location in a yaml file cannot be correctly recognized, please replace the relative location with the absolute location. For example, in the configuration file `modulus/examples/generative/diffusion/conf/config_dfsr_train.yaml`, Line 24, the value of the key 'data' can be changed to an absolute file directory of the dataset file, e.g., ``/<directory of modulus>/examples/generative/diffusion/Kolmogorov_2D_data/kf_2d_re1000_256_40seed.npy``
3434

3535
<b>Step 1 - Model Training</b>
3636

modulus/datapipes/healpix/data_modules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def create_time_series_dataset_classic(
285285
for variable in all_variables:
286286
file_name = _get_file_name(src_directory, prefix, variable, suffix)
287287
logger.debug("open nc dataset %s", file_name)
288-
if "sample" in list(xr.open_dataset(file_name).dims.keys()):
288+
if "sample" in list(xr.open_dataset(file_name).sizes.keys()):
289289
ds = xr.open_dataset(file_name, chunks={"sample": batch_size}).rename(
290290
{"sample": "time"}
291291
)
@@ -989,7 +989,7 @@ def setup(self) -> None:
989989
)
990990

991991
dataset = dataset.sel(
992-
channel_in=self.input_variables,
992+
channel_in=self.input_variables + coupled_variables,
993993
channel_out=self.output_variables,
994994
)
995995
else:

modulus/datapipes/healpix/timeseries_dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ def _get_time_index(self, item):
303303
if self.forecast_mode
304304
else (item + 1) * self.batch_size + self._window_length
305305
)
306-
if not self.drop_last and max_index > self.ds.dims["time"]:
307-
batch_size = self.batch_size - (max_index - self.ds.dims["time"])
306+
if not self.drop_last and max_index > self.ds.sizes["time"]:
307+
batch_size = self.batch_size - (max_index - self.ds.sizes["time"])
308308
else:
309309
batch_size = self.batch_size
310310
return (start_index, max_index), batch_size

test/models/dlwp_healpix/test_healpix_layers.py

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -154,38 +154,34 @@ def test_HEALPixLayer_initialization(device, multiplier):
154154
def test_HEALPixLayer_forward(device, multiplier):
155155
layer = HEALPixLayer(layer=MulX, multiplier=multiplier)
156156

157+
kernel_size = 3
158+
dilation = 2
159+
in_channels = 4
160+
out_channels = 8
161+
157162
tensor_size = torch.randint(low=2, high=4, size=(1,)).tolist()
158-
tensor_size = [24, 4, *tensor_size, *tensor_size]
163+
tensor_size = [24, in_channels, *tensor_size, *tensor_size]
159164
invar = torch.rand(tensor_size, device=device)
160165
outvar = layer(invar)
161166

162167
assert common.compare_output(outvar, invar * multiplier)
163168

164-
# test nhwc mode and dilation
165169
layer = HEALPixLayer(
166170
layer=torch.nn.Conv2d,
167-
in_channels=4,
168-
out_channels=8,
169-
kernel_size=3,
171+
in_channels=in_channels,
172+
out_channels=out_channels,
173+
kernel_size=kernel_size,
170174
device=device,
171-
# dilation=4,
172-
)
173-
174-
outvar = layer(invar)
175-
176-
layer = HEALPixLayer(
177-
layer=torch.nn.Conv2d,
178-
in_channels=4,
179-
out_channels=8,
180-
kernel_size=3,
181-
device=device,
182-
dilation=1,
175+
dilation=dilation,
183176
enable_healpixpad=True,
184177
enable_nhwc=True,
185178
)
186179

187-
assert outvar.shape == layer(invar).shape
188-
assert outvar.stride() != layer(invar).stride()
180+
# size of the padding added byu HEALPixLayer
181+
expected_shape = [24, out_channels, tensor_size[-1], tensor_size[-1]]
182+
expected_shape = torch.Size(expected_shape)
183+
184+
assert expected_shape == layer(invar).shape
189185

190186
del layer, outvar, invar
191187
torch.cuda.empty_cache()

0 commit comments

Comments
 (0)