Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 22, 2022. It is now read-only.
Draft

Dace #669

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
244 commits
Select commit Hold shift + click to select a range
17c4ab2
overriding ManTracer numpy threshold because since the addition of th…
rheacangeo May 12, 2021
29994ea
Merge remote-tracking branch 'origin/c48-map-single-validation-thresh…
May 12, 2021
7e6569b
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 13, 2021
b8569b4
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 13, 2021
42e4b10
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 13, 2021
26e3982
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 13, 2021
d2dc60c
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 14, 2021
7d156e8
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 17, 2021
765c3ac
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 17, 2021
aa3966e
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 17, 2021
21f2c81
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 17, 2021
903f565
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 18, 2021
52181d2
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 19, 2021
bad197c
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 20, 2021
eed82f5
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 24, 2021
ce50b92
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 24, 2021
eb06160
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 24, 2021
5484ef1
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 25, 2021
f848713
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 26, 2021
29c74ba
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
May 26, 2021
1760c2f
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jun 1, 2021
eaa233c
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jun 2, 2021
b11c876
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jun 2, 2021
45700b5
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jun 3, 2021
18ea0f4
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jun 3, 2021
aee1dab
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jun 7, 2021
1b839ca
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jun 7, 2021
ae8cb1b
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jun 10, 2021
fa68df4
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jun 13, 2021
43e7855
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jun 18, 2021
e4a5b2f
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jun 25, 2021
1a9b8c2
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jul 12, 2021
8b46e2a
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jul 12, 2021
fcb3b0b
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jul 14, 2021
9d41d25
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jul 16, 2021
acb5c3f
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jul 19, 2021
baa2c37
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jul 26, 2021
7262053
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Jul 27, 2021
053e2e5
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Aug 2, 2021
445c798
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Aug 3, 2021
d38cb77
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Aug 17, 2021
287716d
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Aug 18, 2021
9c41148
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Aug 19, 2021
a08b7a2
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Aug 23, 2021
effc7ca
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Sep 1, 2021
73a99b6
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Sep 1, 2021
7cb3864
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Sep 2, 2021
477332f
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Sep 2, 2021
459a581
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Sep 3, 2021
7e1da6b
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Sep 3, 2021
6e52746
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Sep 9, 2021
3a60eb4
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Sep 10, 2021
6250780
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Sep 14, 2021
6b87c54
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Sep 15, 2021
e858d88
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Sep 21, 2021
d204267
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Sep 22, 2021
90611b5
Merge branch 'master' of github.com:VulcanClimateModeling/fv3core
Sep 23, 2021
54e0c6e
Merge branch 'master' of github.com:ai2cm/fv3core
Sep 30, 2021
a9a2cca
Merge branch 'master' of github.com:ai2cm/fv3core
Oct 5, 2021
422cb29
Merge branch 'master' of github.com:ai2cm/fv3core
Oct 6, 2021
83896e6
Merge branch 'master' of github.com:ai2cm/fv3core
Oct 6, 2021
814257f
Merge branch 'master' of github.com:ai2cm/fv3core
Oct 12, 2021
497a0ae
Merge branch 'master' of github.com:ai2cm/fv3core
Oct 13, 2021
f988575
Merge branch 'master' of github.com:ai2cm/fv3core
Oct 14, 2021
109a221
Merge branch 'master' of github.com:ai2cm/fv3core
Oct 19, 2021
9bced6b
Merge branch 'master' of github.com:ai2cm/fv3core
Oct 19, 2021
92100cd
Merge branch 'master' of github.com:ai2cm/fv3core
Oct 21, 2021
3834a58
Merge branch 'master' of github.com:ai2cm/fv3core
Oct 25, 2021
8454d82
Merge branch 'master' of github.com:ai2cm/fv3core
Oct 26, 2021
fb62e31
Manual dace merge
Oct 26, 2021
b30814c
Add @computepath_method decorators
Oct 27, 2021
9636459
Disable selective validation option for dace testing
Oct 27, 2021
86b35ee
Revert test_translate change
Oct 27, 2021
c56f75c
Rename 'skip_passes' -> 'pass_order'
Oct 27, 2021
5557699
Merge branch 'master' of github.com:ai2cm/fv3core
Oct 27, 2021
e5a1e2d
Merge branch 'master' into dace-fv3core
Oct 27, 2021
7c0f106
Initialize 'worst_full_idx' to prevent unbounded error
Oct 27, 2021
16326ee
Initialize validation variables
Oct 27, 2021
22ef960
Merge branch 'master' into dace-fv3core
Dec 15, 2021
c25a79c
Satisfy pre-commit requirements
Dec 15, 2021
fd4efae
Fix computepath_method import in fv_subgridz
Dec 15, 2021
c205c52
Set MPI=None to disable distributed compilation
Dec 16, 2021
ef362b5
Fix selective validation
Dec 16, 2021
3db63f3
Add computepath decorators to fv_dynamics
Dec 16, 2021
e4cac4c
Fix tracer_advection selective validation
Dec 16, 2021
8f7a39a
Set GT4PY_VERSION=dev-v37
Dec 16, 2021
09144e8
Skip 'graph_merge_horizontal_executions' by default for dace backends…
Dec 17, 2021
378bbf2
Fix 'update_ua' domain and intervals to prevent 'memlet out of bounds'
Dec 17, 2021
cd36cbd
Revert "Skip 'graph_merge_horizontal_executions' by default for dace …
Dec 17, 2021
5b9e552
Skip 'graph_merge_horizontal_executions' for
Dec 17, 2021
d5515aa
Disable 'graph_merge_horizontal_executions' for 'updatedzc'
Dec 17, 2021
8dacbde
Add 'gtc:dace:gpu' entries to overrides/standard.yaml
Dec 17, 2021
fdeb598
Fix yaml whitespace
Dec 17, 2021
e3d27bd
Update threshold for DaCe in RiemSolver
FlorianDeconinck Dec 20, 2021
aadbbfb
Update acoustics experiment runfile
FlorianDeconinck Dec 20, 2021
ad5f970
Fix bad merge in SDFG wrap propagation
FlorianDeconinck Dec 21, 2021
d892752
Halo ex adapted (only in Acoustics) for DaCe
FlorianDeconinck Dec 21, 2021
f56c3d2
Verbose dace-only code changes with #[DaCe]
FlorianDeconinck Dec 22, 2021
1498378
Make overriden annotation to `None`
FlorianDeconinck Dec 22, 2021
e5c1d6b
Add _do_divergence_corner as a flag to rewrite "stencil is not None" …
FlorianDeconinck Dec 22, 2021
f5b97b8
Re-enabling the entire dyn_core
FlorianDeconinck Dec 22, 2021
f48a39c
Remove `delpc` and `ptc` from state
FlorianDeconinck Dec 23, 2021
eba4bb1
Unrolling CopiedCorners to go around DaCe limitation w/ dynamic assig…
FlorianDeconinck Dec 23, 2021
f97dc5f
Remove usage of CopiedCorners
FlorianDeconinck Dec 23, 2021
c61f801
DaCe can't parse `var = None` easily
FlorianDeconinck Jan 4, 2022
b3dbb99
Temporary fixes on delnflux
FlorianDeconinck Jan 4, 2022
ecdf359
divergence_damping: abs fail and others
FlorianDeconinck Jan 5, 2022
94ea652
dyn_core; dupliocation of halo ex to go around parameter generation i…
FlorianDeconinck Jan 5, 2022
b1a0d02
Restore abs(X) in orchestrated code
FlorianDeconinck Jan 6, 2022
53553fd
Unrolling for loop in orchestrated code for now
FlorianDeconinck Jan 6, 2022
fb91088
Add load_sdfgto use pre-compiled cache in orchestrated mode
FlorianDeconinck Jan 6, 2022
8efaee0
Wait on correct u_v exchange depending on loop iteration
FlorianDeconinck Jan 7, 2022
19a0ed5
Allow numpy & orchestrated run side by side
FlorianDeconinck Jan 7, 2022
395dd27
Adapt acoustics for non-orchestrated code
FlorianDeconinck Jan 7, 2022
0c2cf41
Align orchestration speed boost on for DaCe
FlorianDeconinck Jan 10, 2022
19deba9
Revert Delnflux for unroll
FlorianDeconinck Jan 10, 2022
0e1c92d
Re-instate the whitelist for dacemode codegen deactivation pattern
FlorianDeconinck Jan 11, 2022
7601504
Added fix to enable disable_code_generation in dacemode
FlorianDeconinck Jan 12, 2022
e4d47b7
Adapt translate_dyncore to the modified API for orchestration
FlorianDeconinck Jan 12, 2022
b4eb62e
Fix acoustics cached sdfg and vsnumpy
FlorianDeconinck Jan 12, 2022
adfdbdd
Re-introduce `do_halo_exchange` option on AcousticsDynamics
FlorianDeconinck Jan 13, 2022
a5cc740
Use c_sw's internal delpc/ptc to go around a copy back error in DaCe
FlorianDeconinck Jan 13, 2022
fdc9e9d
Fix passing a SDFG file instead of a directory
FlorianDeconinck Jan 14, 2022
89b5f91
Reintroduce cache warming run
FlorianDeconinck Jan 19, 2022
276159d
Merge branch 'dace-fv3core' of https://github.com/ai2cm/fv3core into …
FlorianDeconinck Jan 19, 2022
e51a4ce
Fix merge
FlorianDeconinck Jan 19, 2022
2c26aec
Update to dace v0.12.0
FlorianDeconinck Jan 24, 2022
95e165a
Revert [DaCe] workaround
FlorianDeconinck Jan 24, 2022
a8b3804
Clean up dead code
FlorianDeconinck Jan 25, 2022
d32d07f
[WIP] Orchestraton of FV_Dynamics / Tracers
FlorianDeconinck Feb 3, 2022
0e404aa
[WIP] Remap orchestration
FlorianDeconinck Feb 3, 2022
fca9bdc
Fix translate test
FlorianDeconinck Feb 3, 2022
a3b8343
Missing commit: dace_inhibitor
FlorianDeconinck Feb 3, 2022
e13975b
Tracers dace orchestration validate
FlorianDeconinck Feb 7, 2022
71459b9
Remove unused `q` variable in remap profile
FlorianDeconinck Feb 7, 2022
6cbe1a6
Update translate test of dycore to new API
FlorianDeconinck Feb 7, 2022
d375a46
Deactivate selective validation for tracers
FlorianDeconinck Feb 8, 2022
1f06ea5
Fix translate of acoustics with proper read n_map value (from savepoint)
FlorianDeconinck Feb 8, 2022
4f80365
Unroll selective validation in translate fv_dynamics
FlorianDeconinck Feb 8, 2022
467cfe9
Fix translate init & dynamics
FlorianDeconinck Feb 9, 2022
0d21bf6
DaCe/computepath unit tests (#664)
tbennun Feb 10, 2022
9e7afe4
Fix load_sdfg in dynamics runfile
FlorianDeconinck Feb 13, 2022
3f9146a
Update dace orchestrated stencil compile whitelist
FlorianDeconinck Feb 13, 2022
361e7fb
dace.nounroll to contain compile time
FlorianDeconinck Feb 14, 2022
89d391f
update threshold
Feb 15, 2022
3abefcc
DaCe-related code moved to utils.dace
FlorianDeconinck Feb 15, 2022
c5e8287
Merge remote-tracking branch 'origin/dace-fv3core' into dace-fv3core
FlorianDeconinck Feb 15, 2022
a7d2412
Switch timer from with statement to functional callbacks
FlorianDeconinck Feb 15, 2022
03ab1cf
Small tweak to timers on dynamics.py
FlorianDeconinck Feb 15, 2022
bab1c9d
Un-workaround: FloatField hack, reactivate print
FlorianDeconinck Feb 15, 2022
d175dfc
Un-workaround: reinstate the enumerate list in tracer advection
FlorianDeconinck Feb 15, 2022
1d00577
Merge commit '03ab1cf62c7ab8784ee441b496075b377c9ecd72' into dace-CI
Feb 15, 2022
4bc61e1
first commit, only riem_solverC
Feb 15, 2022
e134d00
add temporary flag everywhere it could work
Feb 16, 2022
e48873a
fix
Feb 16, 2022
eaa794b
Clean up unused workaround
FlorianDeconinck Feb 16, 2022
164e44f
Merge remote-tracking branch 'origin/dace-transients' into dace-fv3core
FlorianDeconinck Feb 16, 2022
9fdd1dc
Move dace code to it's own file under utils.dace
FlorianDeconinck Feb 17, 2022
2f8cf2e
All arguments as kwargs to gt4py (match gt4py dev-v37 update)
FlorianDeconinck Mar 11, 2022
0599436
DaCe orchestrated halo updater
FlorianDeconinck Mar 11, 2022
9fb80d9
WIP validating orchestrated with new backend
Feb 18, 2022
766a485
DeadCode elimination in computepath
FlorianDeconinck Mar 13, 2022
89a967c
Deactivate bad OIR passes
FlorianDeconinck Mar 16, 2022
e832496
Merge branch 'tracers_debug' into dace-fv3core
FlorianDeconinck Mar 16, 2022
94858fd
backported baroclinic init and MetricTerms(there is a version here th…
rheacangeo Mar 16, 2022
afdd74e
more back porting, most grid variables
rheacangeo Mar 16, 2022
12efa38
remove helper
rheacangeo Mar 16, 2022
a789037
Merge branch 'dace-fv3core' into for-dace-backport-init
rheacangeo Mar 16, 2022
7412a73
Flag transient field in FVTP2D
FlorianDeconinck Mar 16, 2022
c687850
C_SW transient
FlorianDeconinck Mar 16, 2022
d3f4dcf
D_SW transientness
FlorianDeconinck Mar 16, 2022
1b0391b
Transient a2b_ord4, d2a2_vect, delnflux, pk3_halo
FlorianDeconinck Mar 16, 2022
4cecb2b
Transient on tracers
FlorianDeconinck Mar 16, 2022
d23c576
Remap + RiemSolver3 transient-ified
FlorianDeconinck Mar 16, 2022
ba6e6f7
Fine tune for splittable regions
FlorianDeconinck Mar 18, 2022
0b1cef3
Minor
FlorianDeconinck Mar 18, 2022
56ccf43
Merge remote-tracking branch 'origin/dace-fv3core' into dace-fv3core
FlorianDeconinck Mar 18, 2022
7fbebc5
make edge grid variables equivalent to serialized data
Mar 21, 2022
42ca5a6
Minor streamlining sdfg_load
FlorianDeconinck Mar 21, 2022
89dff48
computepath_XXX knows how to load SDFG dir (file todo)
FlorianDeconinck Mar 22, 2022
2270493
change state so format is exactly same as when serialized
Mar 22, 2022
f0837aa
Minor
FlorianDeconinck Mar 22, 2022
6c0a021
fixing baroclinic init ua and va
Mar 22, 2022
fdbdda0
resolve merge conflicts
Mar 22, 2022
caae220
Revert "Minor"
Mar 22, 2022
4e24f1d
Revert "Revert "Minor""
Mar 22, 2022
288f890
Revert "Revert "Revert "Minor"""
Mar 22, 2022
c8044fd
revert
Mar 22, 2022
ba6a42d
Revert "Minor streamlining sdfg_load"
Mar 22, 2022
d699158
Incorporate `distr_compile_v2` branch changes for distributed compile
FlorianDeconinck Mar 22, 2022
d48c9ba
Revert "computepath_XXX knows how to load SDFG dir (file todo)"
Mar 22, 2022
c3e4f79
Revert "Minor"
Mar 23, 2022
d2b1a44
Revert "computepath_XXX knows how to load SDFG dir (file todo)"
Mar 23, 2022
e86778e
Revert "Minor streamlining sdfg_load"
Mar 23, 2022
527930f
hack to do all initialization on the cpu, then remake objects on the gpu
Mar 24, 2022
b00c930
Merge remote-tracking branch 'origin/for-dace-backport-init' into for…
Mar 24, 2022
719bf5f
Build metric/state on host then upload to device
FlorianDeconinck Mar 24, 2022
0e44209
Merge remote-tracking branch 'origin/for-dace-backport-init' into for…
FlorianDeconinck Mar 24, 2022
12073fc
Merge branch 'for-dace-backport-init' into dace-fv3core
FlorianDeconinck Mar 24, 2022
4e708dd
Device sync on timers for more accurrate timers
FlorianDeconinck Mar 24, 2022
49c70ee
Minor
FlorianDeconinck Mar 24, 2022
19ff687
Minor
FlorianDeconinck Mar 24, 2022
49f6d8c
Fix multiple call after SDFG load
FlorianDeconinck Mar 25, 2022
e9530a7
Fix config print
FlorianDeconinck Mar 25, 2022
901f77d
Add new compute_coriolis_parameter_defn to the whitelist
FlorianDeconinck Mar 25, 2022
76648cf
Fix BuildAndRun pipeline to avoid double build
FlorianDeconinck Mar 25, 2022
c72cf1e
Fix determine_compiling_ranks for non distributed
FlorianDeconinck Mar 25, 2022
b916226
Actually use dt_atmos for bdt
FlorianDeconinck Mar 25, 2022
012b7aa
MPI barrier on Build
FlorianDeconinck Mar 25, 2022
a0ace63
Merge remote-tracking branch 'origin/dace-fv3core' into dace-fv3core
FlorianDeconinck Mar 25, 2022
15a5cba
blargh
Mar 25, 2022
a60232f
biuuuutiful
Mar 25, 2022
c184823
Fix set partitioner
FlorianDeconinck Mar 26, 2022
1cb9497
Fix BuildAndRun with layou read
FlorianDeconinck Mar 26, 2022
2b1a5bb
Force set partitioner
FlorianDeconinck Mar 26, 2022
8fcbd19
Clean up
FlorianDeconinck Mar 26, 2022
b030244
Bad init
FlorianDeconinck Mar 26, 2022
15ec43d
Deactivate decomposition dump
FlorianDeconinck Mar 26, 2022
71ac399
Replace all instances of MPI with NullComm via envvar
tbennun Mar 27, 2022
83525ae
Merge remote-tracking branch 'tal/nullcomm' into dace-fv3core
FlorianDeconinck Mar 27, 2022
76c6324
grid: indices transformation fix
FlorianDeconinck Mar 27, 2022
d598132
Typos
FlorianDeconinck Mar 27, 2022
d834018
Clean up of debug prints
FlorianDeconinck Mar 27, 2022
cfaf3e3
Fix tracer2d1l translate test
FlorianDeconinck Mar 27, 2022
4e0a39b
Moving set_partitioner alongside set_backend
FlorianDeconinck Mar 27, 2022
1fa77b8
Fix Fillz translate test for gtc:dace:X orchestration
FlorianDeconinck Mar 27, 2022
de41694
Fix thresholds for gtc:dace:gpu remap submodule
FlorianDeconinck Mar 28, 2022
1a10c58
More verbose experiment config
FlorianDeconinck Mar 28, 2022
9296512
Merge remote-tracking branch 'origin/dace-fv3core' into dace-fv3core
FlorianDeconinck Mar 28, 2022
e07e77e
Fix decomposition indexation
FlorianDeconinck Mar 28, 2022
8f840a1
Fix grid spacing calculation
FlorianDeconinck Mar 28, 2022
629829d
Protect against single node run
FlorianDeconinck Mar 28, 2022
3afd978
Fix translate fvtp2d
FlorianDeconinck Mar 29, 2022
d4b4f25
Barrier before performance run
FlorianDeconinck Mar 30, 2022
ffd15c5
Merge branch 'dace-fv3core' of https://github.com/ai2cm/fv3core into …
FlorianDeconinck Mar 30, 2022
6fadc85
Re-establishing refining
FlorianDeconinck Mar 31, 2022
f9d6059
Use inner memory to evade copies
FlorianDeconinck Mar 31, 2022
7275d81
Deactivating refining
FlorianDeconinck Mar 31, 2022
dfa0f21
Aggrisevly remove al/ar access nodes in compute_x_flux orchestrated
FlorianDeconinck Mar 31, 2022
3d7abc0
Replace stripped symbols with placeholders float
FlorianDeconinck Mar 31, 2022
0c94aeb
Remove read reference from tasklet
FlorianDeconinck Mar 31, 2022
70e090d
Insert placeholder variable
FlorianDeconinck Mar 31, 2022
b19cf05
Fix type of placeholder variable
FlorianDeconinck Mar 31, 2022
c881b01
Sync ranks / device at every dynamics step
FlorianDeconinck Apr 1, 2022
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
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,15 @@ dmypy.json
.vscode/

# GT4Py
**/.gt_cache/
**/.gt_cache*/
gt4py/


# Run outputs
examples/wrapped/output/
examples/wrapped/plots/
data/
opt_sdfg/
wip/
**/.dacecache/
_dacegraphs/
2 changes: 1 addition & 1 deletion GT4PY_VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v36
dev-v37
267 changes: 192 additions & 75 deletions examples/standalone/runfile/acoustics.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
#!/usr/bin/env python3
import os
from logging import warn
from types import SimpleNamespace
from typing import Any, Dict, List, Optional, Tuple

import click
import dace
import numpy as np
import serialbox
import yaml
from timing import collect_data_and_write_to_file

import fv3core
import fv3core._config as spec
import fv3core.testing
import fv3gfs.util as util
from fv3core.stencils.dyn_core import AcousticDynamics
from fv3core.utils.global_config import get_dacemode, set_dacemode
from fv3core.utils.grid import Grid
from fv3core.utils.null_comm import NullComm
import fv3gfs.util as fv3util

# [DaCe] Import
from fv3core.utils.dace.computepath import computepath_function

try:
from mpi4py import MPI
except ImportError:
MPI = None
from fv3core.utils.mpi import MPI


def set_up_namelist(data_directory: str) -> None:
Expand Down Expand Up @@ -51,12 +55,17 @@ def read_grid(serializer: serialbox.Serializer, rank: int = 0) -> Grid:
return fv3core.testing.TranslateGrid(grid_data, rank).python_grid()


def initialize_fv3core(backend: str, disable_halo_exchange: bool) -> None:
def initialize_fv3core(
backend: str,
disable_halo_exchange: bool,
partitioner: fv3util.partitioner.Partitioner,
) -> None:
"""
Initializes globalfv3core config to the arguments for single runs
with the given backend and choice of halo updates
"""
fv3core.set_backend(backend)
fv3core.set_partitioner(partitioner)
fv3core.set_rebuild(False)
fv3core.set_validate_args(False)

Expand All @@ -68,9 +77,7 @@ def read_input_data(grid: Grid, serializer: serialbox.Serializer) -> Dict[str, A
return driver_object.collect_input_data(serializer, savepoint_in)


def get_state_from_input(
grid: Grid, input_data: Dict[str, Any]
) -> Dict[str, SimpleNamespace]:
def get_state_from_input(grid: Grid, input_data: Dict[str, Any]):
"""
Transforms the input data from the dictionary of strings
to arrays into a state we can pass in
Expand All @@ -91,7 +98,7 @@ def get_state_from_input(
)

statevars = SimpleNamespace(**input_data)
return {"state": statevars}
return statevars


def set_up_communicator(
Expand Down Expand Up @@ -136,82 +143,192 @@ def read_and_reset_timer(timestep_timer, times_per_step, hits_per_step):
return times_per_step, hits_per_step


def run(data_directory, halo_update, backend, time_steps, sdfg_path=None):
# Read grid & build state from input_data read from savepoint
set_up_namelist(data_directory)
serializer = initialize_serializer(data_directory)
partitioner = fv3util.TilePartitioner(spec.namelist.layout)
initialize_fv3core(backend, halo_update, partitioner)
grid = read_grid(serializer)
spec.set_grid(grid)
input_data = read_input_data(grid, serializer)
state = get_state_from_input(grid, input_data)

# Network communicator
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
cube_comm = fv3util.CubedSphereCommunicator(
comm,
fv3util.CubedSpherePartitioner(partitioner),
)

print(
f"Config\n"
f"\tBackend {backend}\n"
f"\tOrchestration: {'dace' if get_dacemode() else 'python'}\n"
f"\tN split: {spec.namelist.dynamical_core.n_split}\n"
f"\tK split: {spec.namelist.dynamical_core.k_split}\n"
)

# Init acoustics
acoustics_dynamics = AcousticDynamics(
comm=cube_comm,
stencil_factory=spec.grid.stencil_factory,
grid_data=grid,
damping_coefficients=spec.grid.damping_coefficients,
grid_type=spec.namelist.dynamical_core.grid_type,
nested=False,
stretched_grid=False,
config=spec.namelist.dynamical_core.acoustic_dynamics,
ak=input_data["ak"],
bk=input_data["bk"],
pfull=input_data["pfull"],
phis=input_data["phis"],
state=state,
)
state.__dict__.update(acoustics_dynamics._temporaries)

# Build SDFG_PATH if option given and specialize for the right backend
if not os.path.isfile(sdfg_path):
if sdfg_path != "":
loop_name = "acoustics_loop_on_cpu" # gtc:dace
if backend == "gtc:dace:gpu":
loop_name = "acoustics_loop_on_gpu"
rank_str = ""
if MPI.COMM_WORLD.Get_size() > 1:
rank_str = f"_00000{str(rank)}"
sdfg_path = f"{sdfg_path}{rank_str}/dacecache/{loop_name}"
else:
sdfg_path = None

# Non orchestrated loop for all backends
def acoustics_loop_non_orchestrated(state, time_steps):
for _ in range(time_steps):
acoustics_dynamics(
state, update_temporaries=False, do_halo_exchange=halo_update
)

# CPU backend with orchestration (same code as GPU, but named different for
# caching purposed)
@computepath_function(load_sdfg=sdfg_path)
def acoustics_loop_on_cpu(
state: dace.constant,
time_steps,
):
for _ in range(time_steps):
acoustics_dynamics(
state, update_temporaries=False, do_halo_exchange=halo_update
)

# GPU backend with orchestration (same code as GPU, but named different for
# caching purposed)
@computepath_function(load_sdfg=sdfg_path)
def acoustics_loop_on_gpu(
state: dace.constant,
time_steps,
):
for _ in range(time_steps):
acoustics_dynamics(
state, update_temporaries=False, do_halo_exchange=halo_update
)

# Cache warm up and loop function selection
print("Cache warming run")
if backend == "gtc:dace":
acoustics_loop_on_cpu(state, 1)
elif backend == "gtc:dace:gpu":
acoustics_loop_on_gpu(state, 1)
else:
dacemode = get_dacemode()
set_dacemode(False)
acoustics_loop_non_orchestrated(state, 1)
set_dacemode(dacemode)

if time_steps == 0:
print("Cached built only - no benchmarked run")
return
elif "dace" in backend:
warn(
f"Running loop {time_steps} times but not SDFG was"
f"given, performance will be poor."
)

# Get Rank
rank = comm.Get_rank()

# Simulate
import time

start = time.time()
if backend == "gtc:dace":
acoustics_loop_on_cpu(state, time_steps)
elif backend == "gtc:dace:gpu":
acoustics_loop_on_gpu(state, time_steps)
else:
dacemode = get_dacemode()
set_dacemode(False)
acoustics_loop_non_orchestrated(state, time_steps)
set_dacemode(dacemode)

elapsed = time.time() - start
per_timestep = elapsed / (time_steps if time_steps != 0 else 1)
print(
f"Total {backend} time on rank {rank} for {time_steps} steps: "
f"{elapsed}s ({per_timestep}s /timestep)"
)

return state


@click.command()
@click.argument("data_directory", required=True, nargs=1)
@click.argument("time_steps", required=False, default="1")
@click.argument("time_steps", required=False, default="1", type=int)
@click.argument("backend", required=False, default="gtc:gt:cpu_ifirst")
@click.option("--disable_halo_exchange/--no-disable_halo_exchange", default=False)
@click.option("--print_timings/--no-print_timings", default=True)
@click.argument("hash", required=False, default="")
@click.argument("sdfg_path", required=False, default="")
@click.option("--halo_update/--no-halo_update", default=False)
@click.option("--check_against_numpy/--no-check_against_numpy", default=False)
def driver(
data_directory: str,
time_steps: str,
backend: str,
disable_halo_exchange: bool,
print_timings: bool,
hash: str,
sdfg_path: str,
halo_update: bool,
check_against_numpy: bool,
):
total_timer, timestep_timer, times_per_step, hits_per_step = initialize_timers()
with total_timer.clock("initialization"):
set_up_namelist(data_directory)
serializer = initialize_serializer(data_directory)
initialize_fv3core(backend, disable_halo_exchange)
mpi_comm, communicator = set_up_communicator(disable_halo_exchange)
grid = read_grid(serializer)
spec.set_grid(grid)

input_data = read_input_data(grid, serializer)
experiment_name = get_experiment_name(data_directory)
acoustics_object = AcousticDynamics(
communicator,
grid.stencil_factory,
grid.grid_data,
grid.damping_coefficients,
grid.grid_type,
grid.nested,
grid.stretched_grid,
spec.namelist.dynamical_core.acoustic_dynamics,
input_data["ak"],
input_data["bk"],
input_data["pfull"],
input_data["phis"],
)

state = get_state_from_input(grid, input_data)

# warm-up timestep.
# We're intentionally not passing the timer here to exclude
# warmup/compilation from the internal timers
acoustics_object(**state)

# we set up a specific timer for each timestep
# that is cleared after so we get individual statistics
for _ in range(int(time_steps) - 1):
# this loop is not required
# but make performance numbers comparable with FVDynamics
for _ in range(spec.namelist.k_split):
with timestep_timer.clock("DynCore"):
acoustics_object(**state)
times_per_step, hits_per_step = read_and_reset_timer(
timestep_timer, times_per_step, hits_per_step
)
total_timer.stop("total")
times_per_step, hits_per_step = read_and_reset_timer(
total_timer, times_per_step, hits_per_step
state = run(
data_directory,
halo_update,
time_steps=time_steps,
backend=backend,
sdfg_path=sdfg_path,
)

experiment_info = {
"name": "acoustics",
"dataset": experiment_name,
"timesteps": time_steps,
"backend": backend,
"halo_update": not disable_halo_exchange,
"hash": "",
}
if print_timings:
# Collect times and output statistics in json
collect_data_and_write_to_file(
mpi_comm, hits_per_step, times_per_step, experiment_info
if check_against_numpy:
ref_state = run(
data_directory,
halo_update,
time_steps=time_steps,
backend="numpy",
)

if check_against_numpy:
for name, ref_value in ref_state.__dict__.items():

if name in {"mfxd", "mfyd"}:
continue
value = state.__dict__[name]
if isinstance(ref_value, util.quantity.Quantity):
ref_value = ref_value.storage
if isinstance(value, util.quantity.Quantity):
value = value.storage
if hasattr(value, "device_to_host"):
value.device_to_host()
if hasattr(value, "shape") and len(value.shape) == 3:
value = np.asarray(value)[1:-1, 1:-1, :]
ref_value = np.asarray(ref_value)[1:-1, 1:-1, :]
np.testing.assert_allclose(ref_value, value, err_msg=name)


if __name__ == "__main__":
driver()
Loading