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

Global literal & temporary precision (for int & float) extended to gt4py and centralized #94

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

FlorianDeconinck
Copy link
Collaborator

@FlorianDeconinck FlorianDeconinck commented Dec 24, 2024

Debugging the 32-bit GEOS model we figured out that the precision was not necessarily pass down to gt4py properly. We've added a `GT4PY_LITERAL

  • Move precision definition to ndsl.dsl.__init__
  • Detect bad order of imports, e.g., gt4py import before NDSL Adapt code to use the newly defined NDSL_GLOBAL_PRECISION - Set internal GT4Py literal precision definition

⚠️ This enforces order of import. Any file that starts with import gt4py.cartesian.gtscript... which is often the case WILL FAIL. ⚠️

The above points to a wider refactor: forward imports of gtscript to ndsl so user don't have to import gt4py ever

How Has This Been Tested?
Should be transparent to 64-bit cases and in GEOS test. That said, I expect many failures in pyFV3/Pace because of the order of import.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included

Detect bad order of imports, e.g., gt4py import before NDSL
Adapt code to use the newly defined NDSL_GLOBAL_PRECISION
Set internal GT4Py literal precision definition
@FlorianDeconinck
Copy link
Collaborator Author

Expecting failure here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant