Conversation
dd41784 to
adcf8fb
Compare
577d435 to
f0d747e
Compare
f0d747e to
5daea04
Compare
|
cscs-ci run default |
egparedes
left a comment
There was a problem hiding this comment.
It looks good in general although I have a few comments.
| # Check if the --enable-mixed-precision option is set and set the environment variable accordingly | ||
| if config.getoption("--enable-mixed-precision"): | ||
| os.environ["FLOAT_PRECISION"] = "mixed" | ||
| config.addinivalue_line( |
There was a problem hiding this comment.
Question: is this marker needed only in a transition phase? Otherwise, why is actually needed?
There was a problem hiding this comment.
Yes, that would be the idea.
I thought that it might be good to be able to have all tests skipped that have not been prepared for single precision yet. So I suggest using this marker until all tests have suitable tolerances defined for single precision operation.
Co-authored-by: Enrique González Paredes <enriqueg@cscs.ch>
…con4py into add_single_precision_dycore_part1
|
cscs-ci run default |
…con4py into add_single_precision_dycore_part1
This reverts commit 611f658. Without the int(..) there appears a 0-dim cupy array as argument in `range` and an error is raised telling that this can not be interpreted as `int`.
…con4py into add_single_precision_dycore_part1
Inspired by [a comment](C2SM#970 (comment)) by @msimberg
Updated test run command to include single-precision mode in Agent.md "docs". Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
msimberg
left a comment
There was a problem hiding this comment.
Tentative approval with knowledge that there are a few things to clean up still. The overall changes look good to me now!
| offset_provider={}, | ||
| ) | ||
|
|
||
| #TODO(pstark): Probably dz (or it + others wrapped in a MuphysMetricState) should be an arg in State.__init__ |
There was a problem hiding this comment.
Is this something you wanted to handle still in this PR (it sounds like a follow-up)?
There was a problem hiding this comment.
It's indeed a follow up. Just wanted to mark this. It's the only place where a factory appears inside a state.
…ion/diffusion.py Co-authored-by: Mikael Simberg <mikael.simberg@iki.fi>
…con4py into add_single_precision_dycore_part1
|
When developing, you can test your changes on CSCS CI before merge with the You can pass options to override pipeline variables, for example:
Avoid running the pipeline for all tests when you are developing. Available options are:
For each option, Multiple values can be given to each option with See The Merging Once your PR is approved and ready for merging, add it to the merge queue. The Optional Tests To run benchmarks you can use:
For more detailed information please look at CI in the EXCLAIM universe. |
Adds the option to set wp/vpfloat to single via the env var
ICON4PY_FLOAT_PRECISION(previous options were 'double' and 'mixed') to run in single precision.This PR was created to later reduce merge complexity of #886.
Changes
wpfloatorvpfloatfloatswere present (which are by default passed as gtx.float64 togtx.field_operators andgtx.programs) and add casts around float literalswpfloat<->vpfloatwhere an inconsistency with an operator was caught (to hopefully make fixing mixed precision easier in the future)DBL_EPSbyWP_EPSandVP_EPSsingle_precision_ready(running a test withICON4PY_FLOAT_PRECISION=singledeselects all tests without) and mark integration tests for the standalone driver and most components (required much larger tolerances for some cases)--enable-mixed-precision(wpfloatorvpfloatare already set according toICON4PY_FLOAT_PRECISIONat import time of a pytest file)PRECISION_VARIANTSas dimension to the ci pipeline matrixgtx.float64internally in geometry, metrics or interpolation factories independently of the selected precision. Mainly to keep the precision of the RBF and other geometry factors acceptable when running inICON4PY_FLOAT_PRECISIONfactory.store_allfloats_as_doubleforces float allocations in aFieldSourceto double-precisionFieldSource.export_fieldcasts to the dtype declared in the field metadata where the fields leave the factories