Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
264 commits
Select commit Hold shift + click to select a range
ca2586c
WIP
massimim Apr 10, 2025
42df87b
WIP
massimim Apr 10, 2025
1337a2b
WIP
massimim Apr 10, 2025
090837e
WIP: single level
massimim Apr 22, 2025
5fc8020
WIP
massimim Apr 22, 2025
e1257c9
WIP
massimim Apr 22, 2025
57e0b11
Single level working, multi-level runtime error: not enough resources
massimim Apr 23, 2025
c126568
WIP: recursive
massimim Apr 24, 2025
58b7f7b
Refactoring.
massimim Apr 26, 2025
07fc7ae
WIP
massimim Apr 30, 2025
e0f7146
Debugging
massimim May 5, 2025
556d32e
LDC
massimim May 5, 2025
7cbc16f
WIP
massimim May 5, 2025
05a86e3
Improving GPU utilization.
massimim May 14, 2025
b91acd4
Printing stats.
massimim May 15, 2025
cc85c97
Printing stats.
massimim May 15, 2025
1c6aca3
Printing stats.
massimim May 15, 2025
a2aad43
Printing stats.
massimim May 15, 2025
a165017
Printing stats.
massimim May 15, 2025
558b044
Cleaning.
massimim May 15, 2025
7dac522
Cleaning.
massimim May 15, 2025
c0fde85
Merge branch 'main' into mres
hsalehipour May 19, 2025
92c97b8
Fusion
massimim May 19, 2025
e6d6222
Fusion
massimim May 19, 2025
694ed06
clean up and removing deprecated odd/even approach
hsalehipour May 19, 2025
6baad57
Merge branch 'mres' into hesam-mres
hsalehipour May 20, 2025
8cfc636
added dGrid and mGrid handling in indices masker
hsalehipour May 20, 2025
95ae794
Update test
massimim May 21, 2025
e827f09
Merge branch 'mres' into hesam-mres
massimim May 22, 2025
acfc54d
Added a multires_boundary_masker and made sure results are correct.
hsalehipour May 22, 2025
e40ac5d
Merge branch 'main' into hesam-mres
hsalehipour May 23, 2025
4614620
Added KBC to the Neon backend
hsalehipour May 23, 2025
57369f5
renamed some files and classes
hsalehipour May 23, 2025
3af781a
added Neon backend to a couple BCs
hsalehipour May 23, 2025
2d3a502
converted missing mask from boolean to uint8 everywhere.
hsalehipour May 23, 2025
b0a517b
Heavily relying on existing warp functionals for the Neon backend of …
hsalehipour May 24, 2025
6664392
added back post-collision apply_bc and the results are correct.
hsalehipour May 25, 2025
7ed39c5
WIP: extrapolation outflow in Neon
hsalehipour May 26, 2025
1f11b7c
added neon_apply_aux_recovery_bc, used center_index and more refactoring
hsalehipour May 26, 2025
0fdf77a
Always using Warp backend when creating bc helper class to support Ne…
hsalehipour May 26, 2025
bf59ebc
fixed a bug
hsalehipour May 27, 2025
9e9580f
Compelted Encoding/Decoding of BC aux data for ZouHe/Regularized for …
hsalehipour May 27, 2025
cc3ffea
addressed PR review
hsalehipour May 27, 2025
7c3fd37
Merge pull request #126 from hsalehipour/hesam-mres
hsalehipour May 27, 2025
30d4fc1
Added capability to handle BC profiles in MRES
hsalehipour May 27, 2025
b287082
Reduced register pressure by avoiding reading f1_thread for all cells
hsalehipour May 27, 2025
ae5f5ba
Merge pull request #130 from hsalehipour/hesam-mres
hsalehipour May 28, 2025
dd729ce
fixed BC profile handling for Neon dense
hsalehipour May 29, 2025
26aff01
The container should loop over all levels not the call to the container
hsalehipour May 29, 2025
84a8fa4
no need to have separate functions for initializing and launching con…
hsalehipour May 29, 2025
9099f29
Simplified the multires simulation manager a lot by inheriting from M…
hsalehipour May 30, 2025
119197e
Merge pull request #131 from hsalehipour/hesam-mres
hsalehipour May 30, 2025
56e51d8
Fixed a nasty bug!
hsalehipour Jun 2, 2025
948c531
no need to pass xlb_grid
hsalehipour Jun 3, 2025
93e25b7
Added padding to allow non cubic domains.
hsalehipour Jun 3, 2025
8654fb3
added a mesher utility function for multires
hsalehipour Jun 3, 2025
48139ce
enabling mesh masker for multires cases
hsalehipour Jun 3, 2025
343e7df
fixed the output order of cuboid mesher
hsalehipour Jun 3, 2025
57c99cd
Added a new example to showcase STL handling in MRES
hsalehipour Jun 3, 2025
a58206c
stl handling in MRES working reasonably with 2 levels
hsalehipour Jun 4, 2025
e3acd8c
Merge pull request #133 from hsalehipour/hesam-mres
hsalehipour Jun 6, 2025
991fab1
parameterized problem 2
hsalehipour Jun 9, 2025
62801fd
No need for padding after Neon fix. Updated multi-res exampels.
hsalehipour Jun 10, 2025
153e16a
Added new hybrid methods to handle stationary and moving boundaries.
hsalehipour May 27, 2025
409c801
Merge remote-tracking branch 'hesam/hybridBC_merge_main' into hesam-mres
hsalehipour Jun 11, 2025
91b8d0a
Added hybridBC to the Neon backend and MultiRes settings
hsalehipour Jun 12, 2025
c423c1d
Merge pull request #138 from hsalehipour/hesam-mres
hsalehipour Jun 12, 2025
0677315
addressed PR review comments.
hsalehipour Jun 16, 2025
6a99803
Merge branch 'hybridBC_merge_main' into hesam-mres
hsalehipour Jun 16, 2025
8eede50
Merge remote-tracking branch 'hesam/hesam-mres' into hesam-mres
hsalehipour Jun 17, 2025
0086ecc
added a generic read and write method to further unify Warp and Neon …
hsalehipour Jun 17, 2025
f8d239c
added store_dtype to neon backend
hsalehipour Jun 17, 2025
1e17d71
Added neon backend to AABB mesh masker using generic function calls.
hsalehipour Jun 18, 2025
3377806
added multires mesh masker (AABB).
hsalehipour Jun 18, 2025
e8709f2
Added moving boundary capability of halfway BC also to the JAX backend.
hsalehipour Jun 18, 2025
1049f2c
Merge branch 'hybridBC_merge_main' into hesam-mres
hsalehipour Jun 18, 2025
13fd0d9
fixed couple emerging bugs in the JAX backend
hsalehipour Jun 19, 2025
fbcc546
Moved padding to BC class and improved the logic of indices masker in…
hsalehipour Jun 19, 2025
3d6e205
Changed indices masker WARP to rely on local write instead of remote …
hsalehipour Jun 19, 2025
b10d481
switched to generic read and write methods in indices masker to suppo…
hsalehipour Jun 19, 2025
07a0be6
Added and used a helper function for boundary maskers
hsalehipour Jun 19, 2025
219cfd1
added read_field_neighbor and further unified neon and warp helpers i…
hsalehipour Jun 20, 2025
21a1014
made individual functionals for each kernel in indices masker
hsalehipour Jun 20, 2025
eca7208
Converted indices masker to be launched over the entire grid and not …
hsalehipour Jun 20, 2025
878a1f3
added a helper to check if a grid index matches a bc index
hsalehipour Jun 20, 2025
9a9a929
Added neon containers to indices masker. Working now but still lots o…
hsalehipour Jun 20, 2025
4283637
WIP: added multi-res indice masker
hsalehipour Jun 23, 2025
ed98ee4
WIP: Fixed a bug in multires indice masker and applied ruff formatting
hsalehipour Jun 23, 2025
d87fe63
Fixed a bug related to get global indices
hsalehipour Jun 23, 2025
7d671d3
Getting dtype from field using neon_get_dtype
hsalehipour Jun 23, 2025
0a39df0
deleted the old multires boundary masker
hsalehipour Jun 24, 2025
ce28be1
Ensuring other voxelization methods work for dense and raising error …
hsalehipour Jun 24, 2025
b5cb130
moved the computations of the momentum exchange to a functional and u…
hsalehipour Jun 25, 2025
d637ec1
moved the definition of streaming functional to construct warp
hsalehipour Jun 25, 2025
3f8acb0
Added neon implementations of MomentumTransfer for dense and multires
hsalehipour Jun 25, 2025
9bedb75
Moved no-slip bc functional also outside to the warp and neon construct
hsalehipour Jun 25, 2025
7d1a7c1
fixed some operators default values
hsalehipour Jun 25, 2025
930253f
moved force to be a member of the class with a single pointer. Otherw…
hsalehipour Jun 26, 2025
e91247c
minor todo items done
hsalehipour Jun 26, 2025
21c669d
fixed force calculation for multires. Neon results seem to be non-det…
hsalehipour Jun 27, 2025
ad9bdcc
Merge remote-tracking branch 'hesam/hesam-mres' into mres-forceCalcul…
hsalehipour Jun 30, 2025
17ccb53
Added the sphere example using the cuboid mesher
hsalehipour Jul 4, 2025
a4f7b72
neon_get_type does not work. reverting back to hard-coded solution fo…
hsalehipour Jul 4, 2025
ff12d92
Added ExportMultiresHDF5 as a new class in mesher with Neon container…
hsalehipour Jul 4, 2025
18d44b8
Fixed issues with ExportMultiresHDF5. Outputs are now correct!
hsalehipour Jul 7, 2025
9b84558
commented out bc_mask vtk export
hsalehipour Jul 8, 2025
55c0cab
fixed the fp64 issues
hsalehipour Jul 11, 2025
74b3247
minor: updated rotating sphere example to use latest voxelization method
hsalehipour Jul 11, 2025
d344a0c
minor fix in other examples for fp64
hsalehipour Jul 11, 2025
8c2a251
Added an OutletInitializer as a helper initializer class
hsalehipour Jul 11, 2025
d9506af
replaced open3d with trimesh in all files and examples which gets rid…
hsalehipour Jul 11, 2025
4cfad42
fixing CPU memory issue: merging duplicates in chucks
hsalehipour Jul 12, 2025
54750d7
Generalized outlet initializer definition using bc_mask and made gene…
hsalehipour Jul 14, 2025
554835d
Added multires outlet initializer
hsalehipour Jul 14, 2025
0825568
Addressed PR review
hsalehipour Jul 15, 2025
1606408
Merge pull request #1 from hsalehipour/outlet_initializer
hsalehipour Jul 15, 2025
266d0b7
Generalized the MRES IO class and added a new method to export a 2D i…
hsalehipour Jul 16, 2025
70c5ba5
removed the redundant stl sphere example and corrected the sphere ind…
hsalehipour Jul 16, 2025
853aeff
Enabled auto chunking in the exporter
hsalehipour Jul 16, 2025
215d993
Fix: reducing memory usage on CPU for mres.
massimim Jul 16, 2025
95ff10c
Merge branch 'dev' into mres-forceCalculation
massimim Jul 16, 2025
5f09506
Perf: fusion at the finest level for mres.
massimim Jul 17, 2025
b27094e
Generalized the MultiresIO class to be used for any given field (not …
hsalehipour Jul 18, 2025
391194b
Merge branch 'io_image_slice' into multilevel_boundary_indices
hsalehipour Jul 18, 2025
59ef4aa
Added a new method to multires grid class to enable extracting bounda…
hsalehipour Jul 18, 2025
706f604
cast to store dtype for any input type of mres IO
hsalehipour Jul 21, 2025
ea4a28c
added remove_edges as an input arg to boundary_indices_across_levels
hsalehipour Jul 21, 2025
b067e6b
Fixed an error in cuboid mesher introduced in previous commits
hsalehipour Jul 21, 2025
e8f41aa
fixed couple issues in MresIO class
hsalehipour Jul 21, 2025
e78db3b
addressed PR review comments
hsalehipour Jul 22, 2025
838629d
Merge pull request #3 from hsalehipour/io_image_slice
hsalehipour Jul 22, 2025
cc219b7
Merge remote-tracking branch 'hesam/dev' into multilevel_boundary_ind…
hsalehipour Jul 22, 2025
a824df1
Merge pull request #5 from hsalehipour/multilevel_boundary_indices
hsalehipour Jul 22, 2025
8ac2517
Merge remote-tracking branch 'hsalehipour/dev' into fix-memory-cpu
massimim Jul 22, 2025
5bd71c7
Refactoring: renaming DataUse to MemoryType
massimim Jul 22, 2025
c70de27
Fix: reducing memory requirements for mres on CPU side
massimim Jul 22, 2025
1f63bbd
Merge branch 'fix-memory-cpu' into fusion-finest-level
massimim Jul 22, 2025
e37cff2
Merge remote-tracking branch 'hsalehipour/dev' into fusion-finest-level
massimim Jul 22, 2025
f061573
Debug: adding function to print neon grid information.
massimim Jul 22, 2025
075343f
Fixed the IO culprit!
hsalehipour Jul 22, 2025
6390957
ruff changes
hsalehipour Jul 22, 2025
a670db3
Merge pull request #6 from hsalehipour/io_culprit
hsalehipour Jul 23, 2025
3c7ed77
Enhancement: integrate neon skeleton with dGrid stepper
massimim Jul 23, 2025
9f92c63
Merge remote-tracking branch 'hsalehipour/dev' into dense-multi-gpu
massimim Jul 24, 2025
aad4afb
Merge remote-tracking branch 'hsalehipour/dev' into fusion-finest-level
massimim Jul 24, 2025
725f133
Added a minimal LBM stepper to the MomentumTransfer operator
hsalehipour Aug 1, 2025
d8442b1
Added force calculation to this example as well.
hsalehipour Aug 1, 2025
bc2826e
Applied the changes to multi-res. This enables generic handling of BC…
hsalehipour Aug 1, 2025
142c06c
Rename OptimizationType -> MresPerfOptimizationType
massimim Aug 2, 2025
698e15c
Add comment to multi-res grid.
massimim Aug 2, 2025
a3f3372
Renaming related to mres perf. optimization type class.
massimim Aug 2, 2025
a0111a0
Adding nvtx into requirements.
massimim Aug 2, 2025
123ec48
Merge pull request #7 from massimim/fusion-finest-level
massimim Aug 2, 2025
38d65d4
Uses only device memory for LBM population fields in Neon.
massimim Aug 4, 2025
bcc0788
Merge pull request #10 from hsalehipour/fusion-finest-level
massimim Aug 6, 2025
9ee4988
Updating to the latest Neon API.
massimim Aug 6, 2025
1c040c1
Merge branch 'upgrade-to-refactor-neon-api' into dense-multi-gpu
massimim Aug 6, 2025
2f2c1b9
Merge remote-tracking branch 'origin/main' into dev
hsalehipour Aug 7, 2025
ee7835f
Merge branch 'dev' into mres_force_calculation_with_distance
hsalehipour Aug 7, 2025
a6cb111
fixed ruff formatting
hsalehipour Aug 8, 2025
ec94ff5
minor refactoring
hsalehipour Aug 9, 2025
2c39a67
WIP: multi-GPU with Neon
massimim Aug 9, 2025
45f0e96
Added force calculation to multires even when mesh distance is used. …
hsalehipour Aug 9, 2025
bfed064
Merge pull request #13 from hsalehipour/mres_force_calculation_with_d…
hsalehipour Aug 11, 2025
a0fa2cb
Fixed large memory usage in boundary_indices_across_levels
hsalehipour Aug 15, 2025
af49421
Refactoring mlups example
massimim Aug 16, 2025
e6490b1
Refactoring mlups example
massimim Aug 16, 2025
29a7d8e
Refactoring mlups example
massimim Aug 16, 2025
9b12cd6
Refactoring mlups example
massimim Aug 16, 2025
05f395e
Add new command-line options for MLUPS simulation and enhance reporti…
massimim Aug 16, 2025
390e060
Update MLUPS argument parsing and enhance OCC handling in NSE stepper
massimim Aug 16, 2025
dd8f25e
Merge pull request #15 from hsalehipour/memory_fix_bc_indices_across_…
hsalehipour Aug 16, 2025
3b3aa0c
fix xdmf path when saving in subfolder
Apolo-ADSK Aug 6, 2025
7282f2b
MultiResIO updates
Apolo-ADSK Aug 19, 2025
c038459
Merge pull request #16 from Apolo-ADSK/dev
hsalehipour Aug 19, 2025
889cd23
fixed ruff
hsalehipour Aug 19, 2025
daec1e3
improved the implementation of boundary data aux encoding during init…
hsalehipour Aug 22, 2025
28cd20a
new aux encoder works with multires
hsalehipour Aug 22, 2025
a540615
added neon_index_to_warp to the bc helper
hsalehipour Aug 22, 2025
fc094dc
fixed a bug
hsalehipour Aug 22, 2025
8556361
Moved ZouHe/Regularized decoding function to the new EncodeAuxiliaryD…
hsalehipour Aug 22, 2025
15583ad
Major improvements to the handling of user-specified profiles in hybr…
hsalehipour Aug 22, 2025
a2980be
fixed bugs in ZouHe and Regularized after changes
hsalehipour Aug 23, 2025
1dc0df3
HybridBC now working as expected with profiles
hsalehipour Aug 23, 2025
7c41c5f
improved the logic a bit. needs more testing
hsalehipour Aug 23, 2025
11e8129
minor change: not attributing the EncodeAuxiliaryData object to the B…
hsalehipour Sep 1, 2025
5959006
Merge remote-tracking branch 'hsalehipour/dev' into dense-multi-gpu
massimim Sep 2, 2025
14509b7
update(api): propagating API changes to mres code.
massimim Sep 2, 2025
2b35abf
fix(extra): removing debug export operation for bc_mask.
massimim Sep 2, 2025
7b857ea
style(ruff): running ruff
massimim Sep 2, 2025
e09c54d
corrected interpolated bounceback method to achieve better results wh…
hsalehipour Sep 2, 2025
ecd4103
refactoring(PR): applying changes base on the review from PR #18
massimim Sep 3, 2025
c4224ac
Merge pull request #18 from massimim/dense-multi-gpu
massimim Sep 3, 2025
9f6d9e8
Merge branch 'dev' into fix_bc_profile_prescribed
hsalehipour Sep 3, 2025
4926d75
minor refactoring
hsalehipour Sep 4, 2025
ffa0c49
enabled handling or user-defined profiles that span across multiple l…
hsalehipour Sep 4, 2025
9d83c1b
This commit addresses the issue discussed in https://github.com/hsale…
hsalehipour Sep 5, 2025
31009b3
addressed PR review comments
hsalehipour Sep 5, 2025
4fa0f0c
Merge pull request #19 from hsalehipour/fix_bc_profile_prescribed
hsalehipour Sep 5, 2025
0e61c58
Fixed the missing mask in MRES that was incorrect on +x, +y and +z bo…
hsalehipour Sep 6, 2025
d107a4b
Merge pull request #21 from hsalehipour/corner_issue
hsalehipour Sep 9, 2025
11647c2
Multi-res AABB close (#17)
nmorrisad Sep 12, 2025
d81fd21
Mesh voxelization method (#22)
hsalehipour Sep 15, 2025
e56e62a
Modified the OutletInitializer to be more customizable. Also added it…
hsalehipour Sep 15, 2025
e715fc9
refactor(mesher) : remove JAX dependency for warp and neon backends.
massimim Sep 16, 2025
7c15a90
Merge pull request #23 from hsalehipour/custom_initialization
hsalehipour Sep 16, 2025
0c51fa4
Merge pull request #24 from massimim/remove-dep-jax-for-warp
massimim Sep 16, 2025
d4447b3
Added multi-res RAY mesh masker (and Neon dense)
hsalehipour Sep 15, 2025
8d06f5f
Merge pull request #25 from hsalehipour/ray_multires
hsalehipour Sep 17, 2025
dfee92b
moved prepare skeleton to neon_launch and fixed occ none type in neon…
hsalehipour Sep 22, 2025
1dd19eb
added a util function to convert data in various backends to JAX for …
hsalehipour Sep 22, 2025
12aaa09
added extrapolation outflow BC to Neon
hsalehipour Sep 22, 2025
48df9db
updated wind tunnel example with Neon on multi-GPU
hsalehipour Sep 22, 2025
e37c8d6
fixed the call to assemble_auxiliary_data for mres.
hsalehipour Sep 22, 2025
bbf3a38
Merge pull request #26 from hsalehipour/neon_dense
hsalehipour Sep 25, 2025
831c51e
refactoring(perf-test): adding more options to the performance tests
massimim Oct 6, 2025
dfacaa2
refactoring(CLI): improving CLI for the performance tests
massimim Oct 7, 2025
368e2f3
Omega must vary across resolutions to maintain viscosity as a constant
hsalehipour Oct 9, 2025
0e1f48f
Merge pull request #28 from hsalehipour/variable_omega
hsalehipour Oct 10, 2025
a1ac799
Added a utility class for unit conversion.
hsalehipour Oct 2, 2025
2138151
Merge branch 'dev' into unit_conversion
hsalehipour Oct 12, 2025
3f1116f
Added Ahmed benchmark example
hsalehipour Oct 12, 2025
03eda45
Merge pull request #29 from hsalehipour/unit_conversion
hsalehipour Oct 16, 2025
7ef1336
Merge remote-tracking branch 'origin/dev' into dev
massimim Nov 13, 2025
1dd43bd
Merge branch 'dev' into profiling
massimim Nov 13, 2025
3fcf151
refactoring(mres-stepper): new 'add_to_app' functionality
massimim Nov 14, 2025
69a1621
(feature) Two new optimization strategies for the mres stepper.
massimim Nov 27, 2025
77c4f3e
(refactoring) Removing debug IO
massimim Dec 16, 2025
2738780
(refactoring) Applying ruff.
massimim Dec 19, 2025
23390e2
Function renaming.
massimim Mar 9, 2026
34979c2
Merge pull request #30 from massimim/profiling
massimim Mar 9, 2026
68e68f8
Merge remote-tracking branch 'origin/main' into clean-up
hsalehipour Mar 9, 2026
fea13f0
Merge pull request #31 from hsalehipour/clean-up
hsalehipour Mar 9, 2026
fe4c1d2
Fixed a bug left from previous merge PR
hsalehipour Mar 9, 2026
2f66dc6
The second moment computation includes "rho" embedded in its output. …
hsalehipour Mar 9, 2026
3e55bbd
Removed unused parameters (rho, u) from various collision methods, si…
hsalehipour Mar 9, 2026
e668765
Updared wall BC in this example to ensure numerical stability
hsalehipour Mar 9, 2026
afecb8c
Merge pull request #32 from hsalehipour/clean-up
hsalehipour Mar 9, 2026
df3d5d6
Clean up (#34)
hsalehipour Mar 10, 2026
fee369a
Refactoring to remove duplications.
hsalehipour Mar 10, 2026
22ecca8
Removed redundant functions from `nse_multires_stepper.py` to streaml…
hsalehipour Mar 10, 2026
d9cb382
Renamed functions in `nse_multires_stepper.py` for improved clarity.
hsalehipour Mar 10, 2026
fe19b65
Cleaning up multi-res stepper.
massimim Mar 11, 2026
231ed73
Merge pull request #35 from massimim/cleanup_refactoring
massimim Mar 11, 2026
71e3cf8
Documentation
hsalehipour Mar 11, 2026
cc2606f
Merge pull request #36 from hsalehipour/cleanup_refactoring
hsalehipour Mar 13, 2026
ba92286
Fixed mixed precision handling of the Neon backend for single-res and…
hsalehipour Mar 13, 2026
e3bf1cc
Merge pull request #38 from hsalehipour/mixed_precision
hsalehipour Mar 13, 2026
0f01e8c
(refactoring) Allowing Warp backend to run without neon to be install…
massimim Mar 13, 2026
3413ac3
Ensuring all pytests are passing.
hsalehipour Mar 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,19 @@ checkpoints/*
dist/
build/
*.egg-info/
*.dot

# Ignore h5 and xmf formats
*.h5
*.xmf

# Ignore CSV files
*.csv

# USD files
*.usd
*.usda
*.usdc
*.usd.gz
*.usd.zip
*.usd.bz2
*.usd.bz2
67 changes: 56 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# XLB: A Differentiable Massively Parallel Lattice Boltzmann Library in Python for Physics-Based Machine Learning

XLB is a fully differentiable 2D/3D Lattice Boltzmann Method (LBM) library that leverages hardware acceleration. It supports [JAX](https://github.com/google/jax) and [NVIDIA Warp](https://github.com/NVIDIA/warp) backends, and is specifically designed to solve fluid dynamics problems in a computationally efficient and differentiable manner. Its unique combination of features positions it as an exceptionally suitable tool for applications in physics-based machine learning. With the new Warp backend, XLB now offers state-of-the-art performance for even faster simulations.
XLB is a fully differentiable 2D/3D Lattice Boltzmann Method (LBM) library that leverages hardware acceleration. It supports [JAX](https://github.com/google/jax), [NVIDIA Warp](https://github.com/NVIDIA/warp), and [Neon](https://github.com/Autodesk/Neon) backends, and is specifically designed to solve fluid dynamics problems in a computationally efficient and differentiable manner. Its unique combination of features positions it as an exceptionally suitable tool for applications in physics-based machine learning. With the Warp backend, XLB offers state-of-the-art single-GPU performance, and with the new Neon backend it extends to multi-GPU (single-resolution). More importantly, the Neon backend provides grid refinement capabilities for multi-resolution simulations.

## Getting Started
To get started with XLB, you can install it using pip. There are different installation options depending on your hardware and needs:
Expand All @@ -28,6 +28,16 @@ This installation is for the JAX backend with TPU support:
pip install "xlb[tpu]"
```

### Installation with Neon support
Neon backend enables multi-GPU dense and single-GPU multi-resolution representations. Neon depends on a custom fork of warp-lang, so any existing warp installation must be removed before installing Neon. The Python interface for Neon can be installed from a pre-built wheel hosted on GitHub. Note that the wheel currently requires GLIBC >= 2.38 (e.g., Ubuntu 24.04 or later).

```bash
pip uninstall warp-lang
pip install https://github.com/Autodesk/Neon/releases/download/v0.5.2a1/neon_gpu-0.5.2a1-cp312-cp312-linux_x86_64.whl
```



### Notes:
- For Mac users: Use the basic CPU installation command as JAX's GPU support is not available on MacOS
- The NVIDIA Warp backend is included in all installation options and supports CUDA automatically when available
Expand Down Expand Up @@ -63,11 +73,36 @@ If you use XLB in your research, please cite the following paper:
}
```

If you use the grid refinement capabilities in your work, please also cite:

```
@inproceedings{mahmoud2024optimized,
title={Optimized {GPU} implementation of grid refinement in lattice {Boltzmann} method},
author={Mahmoud, Ahmed H and Salehipour, Hesam and Meneghin, Massimiliano},
booktitle={2024 IEEE International Parallel and Distributed Processing Symposium (IPDPS)},
pages={398--407},
year={2024},
organization={IEEE}
}

@inproceedings{meneghin2022neon,
title={Neon: A Multi-{GPU} Programming Model for Grid-based Computations},
author={Meneghin, Massimiliano and Mahmoud, Ahmed H. and Jayaraman, Pradeep Kumar and Morris, Nigel J. W.},
booktitle={Proceedings of the 36th IEEE International Parallel and Distributed Processing Symposium},
pages={817--827},
year={2022},
month={june},
doi={10.1109/IPDPS53621.2022.00084},
url={https://escholarship.org/uc/item/9fz7k633}
}
```

## Key Features
- **Multiple Backend Support:** XLB now includes support for multiple backends including JAX and NVIDIA Warp, providing *state-of-the-art* performance for lattice Boltzmann simulations. Currently, only single GPU is supported for the Warp backend.
- **Multiple Backend Support:** XLB includes support for JAX, NVIDIA Warp, and Neon backends, providing *state-of-the-art* performance for lattice Boltzmann simulations. The Warp backend targets single-GPU runs, while the Neon backend enables multi-GPU single-resolution and single-GPU multi-resolution simulations.
- **Multi-Resolution Grid Refinement:** Mesh refinement with nested cuboid grids and multiple kernel-fusion strategies for optimal performance on the Neon backend.
- **Integration with JAX Ecosystem:** The library can be easily integrated with JAX's robust ecosystem of machine learning libraries such as [Flax](https://github.com/google/flax), [Haiku](https://github.com/deepmind/dm-haiku), [Optax](https://github.com/deepmind/optax), and many more.
- **Differentiable LBM Kernels:** XLB provides differentiable LBM kernels that can be used in differentiable physics and deep learning applications.
- **Scalability:** XLB is capable of scaling on distributed multi-GPU systems using the JAX backend, enabling the execution of large-scale simulations on hundreds of GPUs with billions of cells.
- **Scalability:** XLB is capable of scaling on distributed multi-GPU systems using the JAX backend or the Neon backend, enabling the execution of large-scale simulations on hundreds of GPUs with billions of cells.
- **Support for Various LBM Boundary Conditions and Kernels:** XLB supports several LBM boundary conditions and collision kernels.
- **User-Friendly Interface:** Written entirely in Python, XLB emphasizes a highly accessible interface that allows users to extend the library with ease and quickly set up and run new simulations.
- **Leverages JAX Array and Shardmap:** The library incorporates the new JAX array unified array type and JAX shardmap, providing users with a numpy-like interface. This allows users to focus solely on the semantics, leaving performance optimizations to the compiler.
Expand Down Expand Up @@ -103,7 +138,7 @@ If you use XLB in your research, please cite the following paper:
<img src="https://raw.githubusercontent.com/autodesk/xlb/main/assets/building.png" alt="" width="700">
</p>
<p align="center">
Airflow in to, out of, and within a building (~400 million cells)
Airflow into, out of, and within a building (~400 million cells)
</p>

<p align="center">
Expand All @@ -128,6 +163,7 @@ The stages of a fluid density field from an initial state to the emergence of th

- BGK collision model (Standard LBM collision model)
- KBC collision model (unconditionally stable for flows with high Reynolds number)
- Smagorinsky LES sub-grid model for turbulence modelling

### Machine Learning

Expand All @@ -143,21 +179,25 @@ The stages of a fluid density field from an initial state to the emergence of th

### Compute Capabilities
- Single GPU support for the Warp backend with state-of-the-art performance
- Multi-GPU support using the Neon backend with single-resolution grids
- Grid refinement support on single-GPU using the Neon backend
- Distributed Multi-GPU support using the JAX backend
- Mixed-Precision support (store vs compute)
- Multiple kernel-fusion performance strategies for multi-resolution simulations
- Out-of-core support (coming soon)

### Output

- Binary and ASCII VTK output (based on PyVista library)
- HDF5/XDMF output for multi-resolution data (with gzip compression)
- In-situ rendering using [PhantomGaze](https://github.com/loliverhennigh/PhantomGaze) library
- [Orbax](https://github.com/google/orbax)-based distributed asynchronous checkpointing
- Image Output
- Image Output (including multi-resolution slice images)
- 3D mesh voxelizer using trimesh

### Boundary conditions

- **Equilibrium BC:** In this boundary condition, the fluid populations are assumed to be in at equilibrium. Can be used to set prescribed velocity or pressure.
- **Equilibrium BC:** In this boundary condition, the fluid populations are assumed to be at equilibrium. Can be used to set prescribed velocity or pressure.

- **Full-Way Bounceback BC:** In this boundary condition, the velocity of the fluid populations is reflected back to the fluid side of the boundary, resulting in zero fluid velocity at the boundary.

Expand All @@ -171,17 +211,22 @@ The stages of a fluid density field from an initial state to the emergence of th

- **Interpolated Bounceback BC:** Interpolated bounce-back boundary condition for representing curved boundaries.

- **Hybrid BC:** Combines regularized and bounce-back methods with optional wall-distance interpolation for improved accuracy on curved geometries.

- **Grad's Approximation BC:** Boundary condition based on Grad's approximation of the non-equilibrium distribution.

## Roadmap

### Work in Progress (WIP)
*Note: Some of the work-in-progress features can be found in the branches of the XLB repository. For contributions to these features, please reach out.*
### Recently Completed

- 🌐 **Grid Refinement:** Implementing adaptive mesh refinement techniques for enhanced simulation accuracy.
- **Grid Refinement:** Multi-resolution LBM with nested cuboid grids and multiple kernel-fusion strategies via the Neon backend.

- 💾 **Out-of-Core Computations:** Enabling simulations that exceed available GPU memory, suitable for CPU+GPU coherent memory models such as NVIDIA's Grace Superchips (coming soon).
- **Multi-GPU Acceleration using [Neon](https://github.com/Autodesk/Neon) + Warp:** Multi-GPU support through Neon's data structures with Warp-based kernels for single-resolution settings.

### Work in Progress (WIP)
*Note: Some of the work-in-progress features can be found in the branches of the XLB repository. For contributions to these features, please reach out.*

- ⚡ **Multi-GPU Acceleration using [Neon](https://github.com/Autodesk/Neon) + Warp:** Using Neon's data structure for improved scaling.
- 💾 **Out-of-Core Computations:** Enabling simulations that exceed available GPU memory, suitable for CPU+GPU coherent memory models such as NVIDIA's Grace Superchips (coming soon).

- 🗜️ **GPU Accelerated Lossless Compression and Decompression**: Implementing high-performance lossless compression and decompression techniques for larger-scale simulations and improved performance.

Expand Down
22 changes: 22 additions & 0 deletions examples/cfd/data/ahmed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"_comment": "Ahmed Car Model, slant - angle = 25 degree. Profiles on symmetry plane (y=0) covering entire field. Origin of coordinate system: x=0: end of the car, y=0: symmetry plane, z=0: ground plane S.Becker/H. Lienhart/C Stoots, Institute of Fluid Mechanics, University Erlangen-Nuremberg, Erlangen, Germany, Coordinates in meters need to convert to voxels, Velocity data in m/s",
"data": {
"-1.162" : { "x-velocity" : [26.995,29.825,29.182,28.488,27.703,26.988,26.456,26.163,26.190,26.523,27.083,28.033,29.131,30.429,31.747,33.036,34.268,35.354,36.312,37.083,37.770,38.484,39.033,39.447,39.839,40.086,40.268,40.380,40.451], "height" : [0.028,0.048,0.068,0.088,0.108,0.128,0.148,0.168,0.188,0.208,0.228,0.248,0.268,0.288,0.308,0.328,0.348,0.368,0.388,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.7388]},
"-1.062" : { "x-velocity" : [30.307,28.962,25.812,21.232,15.848,10.812,7.459,6.080,5.845,6.196,7.428,10.456,15.718,22.129,28.090,32.707,35.888,37.891,39.071,39.840,40.261,40.604,40.767,40.820,40.870,40.890,40.907,40.871,40.853], "height" : [0.028,0.048,0.068,0.088,0.108,0.128,0.148,0.168,0.188,0.208,0.228,0.248,0.268,0.288,0.308,0.328,0.348,0.368,0.388,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]},
"-0.962" : { "x-velocity" : [52.216,51.303,50.196,48.833,47.728,46.790,45.514,44.222,43.379,42.829,42.322,42.056,41.876,41.706,41.584], "height" : [0.363,0.368,0.378,0.388,0.398,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]},
"-0.862" : { "x-velocity" : [46.589,46.538,46.228,46.033,45.810,45.554,45.056,44.369,43.789,43.275,42.789,42.344,42.148,41.913,41.720], "height" : [0.363,0.368,0.378,0.388,0.398,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]},
"-0.562" : { "x-velocity" : [43.237,43.262,43.248,43.225,43.183,43.145,43.083,43.030,42.904,42.776,42.685,42.434,42.358,42.197,42.042], "height" : [0.363,0.368,0.378,0.388,0.398,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]},
"-0.362" : { "x-velocity" : [44.493,44.491,44.443,44.379,44.297,44.215,44.067,43.867,43.577,43.306,43.061,42.689,42.527,42.293,42.105], "height" : [0.363,0.368,0.378,0.388,0.398,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]},
"-0.212" : { "x-velocity" : [49.202,48.429,47.805,46.697,45.883,44.913,44.195,43.650,43.130,42.677,42.432,42.154,41.961], "height" : [0.368,0.378,0.388,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]},
"-0.162" : { "x-velocity" : [50.511,49.784,48.894,48.103,47.468,46.322,45.563,44.581,43.933,43.383,42.905,42.505,42.293,42.042,41.863], "height" : [0.348,0.358,0.368,0.378,0.388,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]},
"-0.112" : { "x-velocity" : [27.615,35.449,41.526,46.068,46.277,46.038,45.774,45.505,45.237,44.701,44.326,43.765,43.284,42.890,42.529,42.247,42.082,41.880,41.732], "height" : [0.318,0.323,0.328,0.338,0.348,0.358,0.368,0.378,0.388,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]},
"-0.062" : { "x-velocity" : [22.891,27.789,32.292,36.568,39.533,41.426,42.371,42.971,43.030,43.081,43.074,43.065,43.039,42.996,42.908,42.665,42.456,42.294,42.105,41.929,41.827,41.660,41.546], "height" : [0.298,0.303,0.308,0.313,0.318,0.323,0.328,0.338,0.348,0.358,0.368,0.378,0.388,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]},
"-0.012" : { "x-velocity" : [23.304,26.317,29.429,32.341,34.923,37.106,38.673,39.841,40.447,40.780,40.973,41.085,41.193,41.282,41.359,41.442,41.522,41.699,41.737,41.749,41.724,41.714,41.642,41.574,41.518,41.431,41.366], "height" : [0.278,0.283,0.288,0.293,0.298,0.303,0.308,0.313,0.318,0.323,0.328,0.338,0.348,0.358,0.368,0.378,0.388,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]},
"0.038" : { "x-velocity" : [42.752,37.392,15.320,-4.501,-8.079,-8.892,-8.420,-7.027,-5.143,-2.903,-0.936,0.927,2.200,3.099,3.622,4.026,4.280,4.520,5.620,8.938,13.913,17.872,21.148,24.814,29.075,33.188,36.424,38.490,39.388,39.675,39.794,39.911,40.007,40.219,40.425,40.643,40.757,40.896,40.994,41.058,41.124,41.127,41.143,41.106,41.080], "height" : [0.028,0.038,0.048,0.058,0.068,0.078,0.088,0.098,0.108,0.118,0.128,0.138,0.148,0.158,0.168,0.178,0.188,0.198,0.208,0.218,0.228,0.238,0.248,0.258,0.268,0.278,0.288,0.298,0.308,0.318,0.328,0.338,0.348,0.368,0.388,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]},
"0.088" : { "x-velocity" : [41.859,35.830,22.660,7.745,-5.808,-12.650,-14.748,-13.756,-10.659,-6.484,-2.121,1.303,3.672,5.441,7.066,9.157,11.613,14.620,17.662,20.639,23.565,26.437,29.484,32.441,35.024,36.938,37.938,38.377,38.595,38.728,38.856,38.976,39.133,39.438,39.749,39.975,40.129,40.344,40.499,40.649,40.783,40.853,40.927,40.945,40.960], "height" : [0.028,0.038,0.048,0.058,0.068,0.078,0.088,0.098,0.108,0.118,0.128,0.138,0.148,0.158,0.168,0.178,0.188,0.198,0.208,0.218,0.228,0.238,0.248,0.258,0.268,0.278,0.288,0.298,0.308,0.318,0.328,0.338,0.348,0.368,0.388,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]},
"0.138" : { "x-velocity" : [36.223,32.501,24.752,14.281,2.799,-6.218,-10.908,-11.892,-9.708,-5.258,-0.140,4.331,7.882,10.995,13.961,16.699,19.477,22.063,24.651,27.081,29.524,31.950,34.043,35.594,36.506,37.053,37.386,37.614,37.832,38.032,38.214,38.397,38.575,38.940,39.298,39.533,39.749,40.028,40.206,40.404,40.580,40.691,40.803,40.858,40.921], "height" : [0.028,0.038,0.048,0.058,0.068,0.078,0.088,0.098,0.108,0.118,0.128,0.138,0.148,0.158,0.168,0.178,0.188,0.198,0.208,0.218,0.228,0.238,0.248,0.258,0.268,0.278,0.288,0.298,0.308,0.318,0.328,0.338,0.348,0.368,0.388,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]},
"0.188" : { "x-velocity" : [29.417,27.755,23.967,18.261,11.662,5.405,0.676,-0.652,0.937,4.261,7.958,11.427,14.366,17.138,19.735,22.151,24.577,26.883,29.165,31.111,32.781,34.072,34.893,35.524,35.974,36.329,36.604,36.872,37.138,37.402,37.673,37.900,38.112,38.518,38.829,39.088,39.326,39.639,39.871,40.096,40.275,40.423,40.523,40.603,40.687], "height" : [0.028,0.038,0.048,0.058,0.068,0.078,0.088,0.098,0.108,0.118,0.128,0.138,0.148,0.158,0.168,0.178,0.188,0.198,0.208,0.218,0.228,0.238,0.248,0.258,0.268,0.278,0.288,0.298,0.308,0.318,0.328,0.338,0.348,0.368,0.388,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]},
"0.238" : { "x-velocity" : [24.405,24.168,22.782,20.196,16.970,13.937,12.137,11.757,12.851,14.649,16.780,18.995,21.070,23.335,25.280,27.468,29.262,30.832,32.133,33.102,33.856,34.473,34.922,35.340,35.698,36.039,36.336,36.629,36.906,37.193,37.454,37.691,37.929,38.329,38.611,38.875,39.126,39.414,39.677,39.917,40.097,40.259,40.380,40.478,40.568], "height" : [0.028,0.038,0.048,0.058,0.068,0.078,0.088,0.098,0.108,0.118,0.128,0.138,0.148,0.158,0.168,0.178,0.188,0.198,0.208,0.218,0.228,0.238,0.248,0.258,0.268,0.278,0.288,0.298,0.308,0.318,0.328,0.338,0.348,0.368,0.388,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]},
"0.288" : { "x-velocity" : [21.489,22.225,22.127,21.456,20.404,19.743,19.541,19.909,21.002,22.381,24.018,25.670,27.421,28.998,30.371,31.523,32.406,33.111,33.670,34.155,34.532,34.893,35.240,35.567,35.875,36.158,36.437,36.708,36.974,37.230,37.473,37.709,37.932,38.266,38.515,38.773,39.008,39.270,39.562,39.782,39.962,40.148,40.266,40.369,40.475], "height" : [0.028,0.038,0.048,0.058,0.068,0.078,0.088,0.098,0.108,0.118,0.128,0.138,0.148,0.158,0.168,0.178,0.188,0.198,0.208,0.218,0.228,0.238,0.248,0.258,0.268,0.278,0.288,0.298,0.308,0.318,0.328,0.338,0.348,0.368,0.388,0.408,0.428,0.458,0.488,0.518,0.558,0.598,0.638,0.688,0.738]}
}
}
Loading
Loading