-
Notifications
You must be signed in to change notification settings - Fork 54
feat[next]: Compile time domains #2173
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
base: main
Are you sure you want to change the base?
feat[next]: Compile time domains #2173
Conversation
… ir.makers and update tests
…nsform_get_domain
…mains_of_temporaries # Conflicts: # tests/next_tests/integration_tests/feature_tests/ffront_tests/test_compiled_program.py
…mains_of_temporaries
…mains_of_temporaries
…of_temporaries' into infer_unstructured_domains_of_temporaries
…mains_of_temporaries # Conflicts: # src/gt4py/next/iterator/transforms/pass_manager.py # tests/next_tests/integration_tests/feature_tests/ffront_tests/test_compiled_program.py # tests/next_tests/unit_tests/program_processor_tests/runners_tests/dace_tests/test_dace_translation.py
…mains_of_temporaries # Conflicts: # src/gt4py/next/ffront/past_to_itir.py # tests/next_tests/unit_tests/program_processor_tests/runners_tests/dace_tests/test_dace_domain.py # tests/next_tests/unit_tests/program_processor_tests/runners_tests/dace_tests/test_gtir_to_sdfg.py
Note: required some merging
…mains_of_temporaries # Conflicts: # src/gt4py/next/ffront/decorator.py # src/gt4py/next/ffront/past_to_itir.py
Note: required some merging
Note: required some merging
...s/next_tests/unit_tests/program_processor_tests/runners_tests/dace_tests/test_dace_domain.py
Outdated
Show resolved
Hide resolved
tests/next_tests/integration_tests/feature_tests/ffront_tests/test_compiled_program.py
Show resolved
Hide resolved
| def _process_symbolic_domains_option( | ||
| ir: itir.Program, | ||
| offset_provider: common.OffsetProvider | common.OffsetProviderType, | ||
| symbolic_domain_sizes: Optional[dict[str, str | itir.Expr]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| symbolic_domain_sizes: Optional[dict[str, str | itir.Expr]], | |
| symbolic_domain_sizes: Optional[dict[str, itir.Expr]], |
Try if this is possible everywhere with low effort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still open?
|
@havogt The case we discussed where a program does not create any temporaries, for which using static values for the domain has no benefits, but leads to unnecessary recompilation when changing the number of nodes, can not be easily detected in a way that would allow us to keep dynamic domain sizes. Such programs can only be identified after field operator fusion, which is after the replacement of the |
This PR adds support for domain sizes and domain inference at compile time. As a result temporary fields are only allocated on the domains that they are read on instead of everywhere.
Internally compile time domains are realized by the addition of a new argument descriptor
FieldDomainDescriptorwhich holds the domain of the corresponding field argument in the form of agtx.Domain. The output domains ofSetAtstatements are replaced with these static domains using theTransformGetDomainRangepass introduced in #2151. The domain inference is extended to use the actual values stored in the connectivity to deduce the required domain on which temporaries need to be computed. This domain is potentially non-contiguous and, since we only support contiguous domains, extended to the minimal contiguous domain. In case this extension leads to many unnecessary computations (default is 25% of the total size) a warning is emitted. The current default can be configured by settingNON_CONTIGUOUS_DOMAIN_WARNING_THRESHOLDingt4py.next.iterator.ir_utils.domain_utils. The old behavior to compute everywhere is still used in case either a) thestatic_domainoption isFalseor b) the backend is configured to compute everywhere by settinguse_max_domain_range_on_unstructured_shifttoTrueinGTFNTranslationSteporDaCeTranslator.Note that compile time domains are only supported in
jitmode right now, as we need to change thecompileinterface, which will happen in a later PR.