Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
e8f0f7f
Introducing Backend and updating downstream NDSL code
FlorianDeconinck Jan 26, 2026
706a120
Lint new files
FlorianDeconinck Jan 26, 2026
24d61aa
Some docs
FlorianDeconinck Jan 26, 2026
359882a
Re-order init to go around the circluar dependency (and skip isort on…
FlorianDeconinck Jan 26, 2026
52d5f59
Add backend exists check
FlorianDeconinck Jan 26, 2026
b849948
Add Backend equal and hash operators
FlorianDeconinck Jan 27, 2026
ba7909b
Fix forwarding of NDSL backend into GT4Py
FlorianDeconinck Jan 27, 2026
3ece5dd
Fix forwarding of NDSL backend into GT4Py
FlorianDeconinck Jan 27, 2026
c61cd1e
Fix forwarding of NDSL backend into GT4Py
FlorianDeconinck Jan 27, 2026
18cf989
Update all tests
FlorianDeconinck Jan 27, 2026
d4be82b
Save Backend as string in Quantity.attrs
FlorianDeconinck Jan 27, 2026
2fb0de5
Fix bad backend given to stree merge test
FlorianDeconinck Jan 27, 2026
ee7e872
Introduce short name shortcuts
FlorianDeconinck Jan 27, 2026
942dd7f
Merge branch 'develop' into feature/NDSL_Backend
FlorianDeconinck Jan 27, 2026
305e785
Lint
FlorianDeconinck Jan 27, 2026
e7e4481
Fix translate: Backned is already properly built
FlorianDeconinck Jan 27, 2026
e1cdc6e
Add concatenation operations
FlorianDeconinck Jan 27, 2026
e68bcfc
Deprecate inlined `is_gpu_backend` check
FlorianDeconinck Jan 27, 2026
03b4c50
Documentation
FlorianDeconinck Jan 27, 2026
bc5590e
Rework shortcuts for Final[Backend] variable
FlorianDeconinck Jan 28, 2026
d0381a8
Move `is_fortran_asligned` to Backend
FlorianDeconinck Jan 28, 2026
998b3f2
Remove wrong default to `| None`
FlorianDeconinck Jan 28, 2026
5d83835
Simplify the G2G comms test
FlorianDeconinck Jan 28, 2026
31a8586
Better checking of expected Error
FlorianDeconinck Jan 28, 2026
8e5dcfe
Lint
FlorianDeconinck Jan 28, 2026
09ae4fe
Properly use global backend shortcuts within API shortcuts
FlorianDeconinck Jan 28, 2026
b66c2bd
Lint
FlorianDeconinck Jan 28, 2026
32b4372
Fix unit tests
FlorianDeconinck Jan 28, 2026
5e6dbdb
Lint
FlorianDeconinck Jan 28, 2026
b18bc5e
Added guardrail for Boilerplate code
FlorianDeconinck Feb 2, 2026
dac69a6
Merge branch 'develop' into feature/NDSL_Backend
FlorianDeconinck Feb 18, 2026
dd8dfc8
Expose loop_order, rework python backends
FlorianDeconinck Feb 18, 2026
d02683e
Fix tests
FlorianDeconinck Feb 18, 2026
b0b695d
Fix test caches
FlorianDeconinck Feb 18, 2026
d3c0b17
More fix to tests
FlorianDeconinck Feb 18, 2026
1837d96
PR updartes: move test in config/, made loop_order an enum
FlorianDeconinck Feb 19, 2026
ffa6e39
Add a `force_build` option on the `set_distributed_cache` for fortran…
FlorianDeconinck Feb 19, 2026
b664b32
Merge branch 'develop' into feature/NDSL_Backend
FlorianDeconinck Feb 19, 2026
eec242d
Lint
FlorianDeconinck Feb 19, 2026
d270177
[TMP CI] Shift `pyFV3` translate to update branch
FlorianDeconinck Feb 19, 2026
08891fc
Space change to trigger CI
FlorianDeconinck Feb 20, 2026
4cc245c
Pull on test branch for pySHiELD CI
FlorianDeconinck Feb 24, 2026
5cdb599
Update `CompilationConfig` to turn backend as a string into `Backend`
FlorianDeconinck Feb 24, 2026
2d940a7
Typo
FlorianDeconinck Feb 24, 2026
8bf39c8
Fix tests for CompilationConfig
FlorianDeconinck Feb 24, 2026
5c13eae
Fix backend save in dace_config
FlorianDeconinck Feb 24, 2026
40f0a2d
Fix dace config load
FlorianDeconinck Feb 24, 2026
ebcb258
[TMP CI] Update Pace branch
FlorianDeconinck Feb 24, 2026
c321fd6
tests: simple cleanup as code review
romanc Mar 4, 2026
a25176b
Merge remote-tracking branch 'origin/develop' into feature/NDSL_Backend
romanc Mar 4, 2026
01e8717
tmp ci: point to noop translate test in hooks
romanc Mar 4, 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
5 changes: 4 additions & 1 deletion .github/workflows/fv3_translate_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ on:

jobs:
fv3_translate_tests:
uses: NOAA-GFDL/pyFV3/.github/workflows/translate.yaml@develop
# TODO
# restore once NDSL 2026.02.00 is released and pyFV3 is updated.
# uses: NOAA-GFDL/pyFV3/.github/workflows/translate.yaml@develop
uses: romanc/pyFV3/.github/workflows/translate.yaml@noop
with:
component_trigger: true
component_name: NDSL
5 changes: 4 additions & 1 deletion .github/workflows/pace_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ on:

jobs:
pace_main_tests:
uses: NOAA-GFDL/pace/.github/workflows/main_unit_tests.yaml@develop
# TODO
# restore once NDSL 2026.02.00 is released and pace is updated.
# uses: NOAA-GFDL/pace/.github/workflows/main_unit_tests.yaml@develop
uses: romanc/pace/.github/workflows/main_unit_tests.yaml@noop
with:
component_trigger: true
component_name: NDSL
5 changes: 4 additions & 1 deletion .github/workflows/shield_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ on:

jobs:
shield_translate_tests:
uses: NOAA-GFDL/pySHiELD/.github/workflows/translate.yaml@develop
# TODO
# restore once NDSL 2026.02.00 is released and pySHiELD is updated.
# uses: NOAA-GFDL/pySHiELD/.github/workflows/translate.yaml@develop
uses: romanc/pySHiELD/.github/workflows/translate.yaml@noop
with:
component_trigger: true
component_name: NDSL
5 changes: 3 additions & 2 deletions examples/mpi/zarr_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
TilePartitioner,
ZarrMonitor,
)
from ndsl.config import backend_python
from ndsl.constants import I_DIM, J_DIM, K_DIM


Expand All @@ -20,9 +21,9 @@

def get_example_state(time):
sizer = SubtileGridSizer(
nx=48, ny=48, nz=70, n_halo=3, data_dimensions={}, backend="debug"
nx=48, ny=48, nz=70, n_halo=3, data_dimensions={}, backend=backend_python
)
allocator = QuantityFactory(sizer, np)
allocator = QuantityFactory(sizer, backend=backend_python)
air_temperature = allocator.zeros([I_DIM, J_DIM, K_DIM], units="degK")
air_temperature.view[:] = np.random.randn(*air_temperature.extent)
return {"time": time, "air_temperature": air_temperature}
Expand Down
25 changes: 15 additions & 10 deletions ndsl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
# isort:skip_file
from . import dsl # isort:skip
from .logging import ndsl_log # isort:skip
from .comm.communicator import CubedSphereCommunicator, TileCommunicator
from .comm.local_comm import LocalComm
from .comm.mpi import MPIComm
from .comm.partitioner import CubedSpherePartitioner, TilePartitioner
from .config.backend import Backend
from .constants import ConstantVersions
from .dsl.caches.codepath import FV3CodePath
from .dsl.dace.dace_config import DaceConfig, DaCeOrchestration
from .dsl.dace.orchestration import orchestrate, orchestrate_function
from .dsl.dace.utils import (
ArrayReport,
DaCeProgress,
MaxBandwidthBenchmarkProgram,
StorageReport,
)
from .dsl.dace.wrapped_halo_exchange import WrappedHaloUpdater
from .quantity import Quantity
from .dsl.ndsl_runtime import NDSLRuntime
from .dsl.stencil import FrozenStencil, GridIndexing, StencilFactory, TimingCollector
from .dsl.stencil_config import CompilationConfig, RunMode, StencilConfig
Expand All @@ -25,14 +19,25 @@
from .performance.collector import NullPerformanceCollector, PerformanceCollector
from .performance.profiler import NullProfiler, Profiler
from .performance.report import Experiment, Report, TimeReport
from .quantity import Local, LocalState, Quantity, State
from .quantity import Local, LocalState, State
from .quantity.field_bundle import FieldBundle, FieldBundleType # Break circular import
from .types import Allocator
from .utils import MetaEnumStr

from .dsl.dace.wrapped_halo_exchange import WrappedHaloUpdater
from .dsl.dace.utils import (
ArrayReport,
DaCeProgress,
MaxBandwidthBenchmarkProgram,
StorageReport,
)
from .dsl.dace.dace_config import DaceConfig, DaCeOrchestration
from .dsl.dace.orchestration import orchestrate, orchestrate_function


__all__ = [
"dsl",
"Backend",
"CubedSphereCommunicator",
"TileCommunicator",
"LocalComm",
Expand Down
16 changes: 10 additions & 6 deletions ndsl/boilerplate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import warnings

from ndsl import (
Backend,
CompilationConfig,
DaceConfig,
DaCeOrchestration,
Expand All @@ -14,14 +15,15 @@
TileCommunicator,
TilePartitioner,
)
from ndsl.config.backend import backend_cpu, backend_python


def _get_factories(
nx: int,
ny: int,
nz: int,
nhalo: int,
backend: str,
backend: Backend,
orchestration: DaCeOrchestration,
topology: str,
) -> tuple[StencilFactory, QuantityFactory]:
Expand Down Expand Up @@ -91,14 +93,14 @@ def get_factories_single_tile_orchestrated(
ny: int,
nz: int,
nhalo: int,
backend: str = "dace:cpu",
backend: Backend = backend_cpu,
*,
orchestration_mode: DaCeOrchestration | None = None,
) -> tuple[StencilFactory, QuantityFactory]:
"""Build the pair of (StencilFactory, QuantityFactory) for orchestrated code on a single tile topology."""

if backend is not None and not backend.startswith("dace"):
raise ValueError("Only `dace:*` backends can be orchestrated.")
if backend is not None and not backend.is_orchestrated():
raise ValueError(f"Only `orch:*` backends can be orchestrated, got {backend}.")

return _get_factories(
nx=nx,
Expand All @@ -112,15 +114,17 @@ def get_factories_single_tile_orchestrated(


def get_factories_single_tile(
nx: int, ny: int, nz: int, nhalo: int, backend: str = "numpy"
nx: int, ny: int, nz: int, nhalo: int, backend: Backend = backend_python
) -> tuple[StencilFactory, QuantityFactory]:
"""Build the pair of (StencilFactory, QuantityFactory) for stencils on a single tile topology."""
if not isinstance(backend, Backend):
raise RuntimeError(f"Backend {backend} is not of class Backend")
return _get_factories(
nx=nx,
ny=ny,
nz=nz,
nhalo=nhalo,
backend=backend,
orchestration=DaCeOrchestration.Python,
orchestration=DaCeOrchestration.BuildAndRun,
topology="tile",
)
22 changes: 22 additions & 0 deletions ndsl/config/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from .backend import (
Backend,
BackendFramework,
BackendLoopOrder,
BackendStrategy,
BackendTargetDevice,
backend_cpu,
backend_gpu,
backend_python,
)


__all__ = [
"Backend",
"BackendFramework",
"BackendStrategy",
"BackendTargetDevice",
"BackendLoopOrder",
"backend_python",
"backend_cpu",
"backend_gpu",
]
Loading