Skip to content
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

[NASA] Update DaCe to v0.15.1 RC #41

Merged
merged 3 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 9 additions & 16 deletions dsl/pace/dsl/dace/orchestration.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,8 @@ def _build_sdfg(
memory_pooled += arr.total_size * arr.dtype.bytes
arr.lifetime = dace.AllocationLifetime.Scope
memory_pooled = float(memory_pooled) / (1024 * 1024)
DaCeProgress.log(
DaCeProgress.default_prefix(config),
f"Pooled {memory_pooled} mb",
pace_log.debug(
f"{DaCeProgress.default_prefix(config)} Pooled {memory_pooled} mb",
)

# Set of debug tools inserted in the SDFG when dace.conf "syncdebug"
Expand All @@ -195,12 +194,10 @@ def _build_sdfg(

# Printing analysis of the compiled SDFG
with DaCeProgress(config, "Build finished. Running memory static analysis"):
DaCeProgress.log(
DaCeProgress.default_prefix(config),
report_memory_static_analysis(
sdfg, memory_static_analysis(sdfg), False
),
report = report_memory_static_analysis(
sdfg, memory_static_analysis(sdfg), False
)
pace_log.info(f"{DaCeProgress.default_prefix(config)} {report}")

# Compilation done.
# On Build: all ranks sync, then exit.
Expand All @@ -211,17 +208,13 @@ def _build_sdfg(
# a true multi-machine sync, outside of our own communicator class.
if config.get_orchestrate() == DaCeOrchestration.Build:
MPI.COMM_WORLD.Barrier() # Protect against early exist which kill SLURM jobs
DaCeProgress.log(
DaCeProgress.default_prefix(config),
"Build only, exiting.",
)
pace_log.info(f"{DaCeProgress.default_prefix(config)} Build only, exiting.")
exit(0)
elif config.get_orchestrate() == DaCeOrchestration.BuildAndRun:
if not is_compiling:
DaCeProgress.log(
DaCeProgress.default_prefix(config),
"Rank is not compiling. "
"Waiting for compilation to end on all other ranks...",
pace_log.info(
f"{DaCeProgress.default_prefix(config)} Rank is not compiling."
"Waiting for compilation to end on all other ranks..."
)
MPI.COMM_WORLD.Barrier()

Expand Down
8 changes: 2 additions & 6 deletions dsl/pace/dsl/dace/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,17 @@ def __init__(self, config: DaceConfig, label: str):
self.prefix = f"[{config.get_orchestrate()}]"
self.label = label

@classmethod
def log(cls, prefix: str, message: str):
pace_log.debug(f"{prefix} {message}")

@classmethod
def default_prefix(cls, config: DaceConfig) -> str:
return f"[{config.get_orchestrate()}]"

def __enter__(self):
DaCeProgress.log(self.prefix, f"{self.label}...")
pace_log.debug(self.prefix, f"{self.label}...")
self.start = time.time()

def __exit__(self, _type, _val, _traceback):
elapsed = time.time() - self.start
DaCeProgress.log(self.prefix, f"{self.label}...{elapsed}s.")
pace_log.debug(self.prefix, f"{self.label}...{elapsed}s.")


def _is_ref(sd: dace.sdfg.SDFG, aname: str):
Expand Down
2 changes: 1 addition & 1 deletion external/dace
Submodule dace updated 189 files
2 changes: 1 addition & 1 deletion external/gt4py
Submodule gt4py updated 161 files
3 changes: 2 additions & 1 deletion fv3core/tests/savepoint/translate/translate_a2b_ord4.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __call__(
vort,
delpc,
dt,
grid_type,
grid_type: int,
):
# this function is kept because it has a translate test, if its
# structure is changed significantly from __call__ of DivergenceDamping
Expand Down Expand Up @@ -80,5 +80,6 @@ def compute_from_storage(self, inputs):
nord_col,
nord_col,
)
inputs["grid_type"] = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need a TODO as part of the change for grid_type to an enum?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably should indeed. I'll kill that PR and open a PR from a branch I can tweak.

self.compute_obj(divdamp, **inputs)
return inputs