Repository navigation
fix[next]: format domain warnings for array scalars - #2924
Closed
dganellari wants to merge 2 commits into
Closed
dganellari wants to merge 2 commits into
dganellari wants to merge 2 commits into
Conversation
2 tasks done
Prevent GPU domain inference from failing while reporting the warning.
dganellari
force-pushed
the
review-domain-warning
branch
from
October 21, 2026 16:06
0a660ed to
d1ad100
Compare
This was referenced Oct 21, 2026
This was referenced Oct 27, 2026
tehrengruber
approved these changes
Oct 28, 2026
| f"Translating '{expr}' using '{tag}' requires " | ||
| f"computations on many additional points " | ||
| f"({round((1 - fraction_accessed) * 100)}%) in order to get a contiguous " | ||
| f"({round(float((1 - fraction_accessed) * 100))}%) in order to get a contiguous " |
Contributor
There was a problem hiding this comment.
Let's convert fraction_accessed instead and add a comment why.
Author
There was a problem hiding this comment.
Done, converted fraction_accessed where it is calculated and added a comment explaining why.
| data=np.asarray([0] + [99] * 99, dtype=fbuiltins.IndexType).reshape((100, 1)), | ||
| ) | ||
| } | ||
| if array_scalar: |
Contributor
There was a problem hiding this comment.
To be honest I would just skip the test or otherwise use cupy when available.
Author
There was a problem hiding this comment.
Replaced the array with CuPy when a GPU is available.
…atting warnings. Replace the simulated array test with a CuPy case when a GPU is available.
havogt
added a commit
that referenced
this pull request
Oct 30, 2026
…ty tables (#2953) Compilation received the runtime offset provider, so it depended on where and how connectivity tables are stored: - With `GT4PY_BUILD_JOBS_MODE=process`, workers get a host copy of each table, while serial and thread compilation use the device original. On GPU backends the compiled input and its persistent translation-cache key therefore differed between modes. - Compile-time domain inference (`_max_domain_range_sizes`, `_unstructured_translate_range_statically`) reduced device arrays, which means implicit syncs and cupy 0-d results (see #2924). Compilation now runs against a compile-time view of the offset provider. `make_compilation_task` replaces each gather connectivity, once per runtime connectivity, by a compile-time connectivity: a read-only, C-contiguous host table, memory-mapped from a file in the session cache directory named by a digest of its content (dtype, shape and data, hashed in place). It is fingerprinted by the digest instead of the table and pickled as a reference to its file, which replaces the previous file references and the `with_refs` variant of `CompilationTask`. Workers unpickle the compilable inside the task, so an unreadable table file fails only that task instead of breaking the pool. All runners therefore compile the same input with the same key, and the host tables live in the page cache, shared with the workers. Compilation that bypasses `make_compilation_task` (e.g. a direct `Backend.compile`) still sees the runtime tables. Execution always receives the runtime offset provider. Translation-cache keys of programs with connectivities change on all backends, so they are re-translated once.
Contributor
|
#2953 is now merged, so I am closing this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Non-contiguous domain inference can produce a zero-dimensional array when connectivity data lives on a GPU. Formatting the warning calls
round()on that array and raises instead of reporting the intended warning. Convert the percentage to a Python float before rounding; the warning threshold and inferred domain stay unchanged.This independent fix targets
mainand contains no optimization passes. The regression test covers ordinary scalar and zero-dimensional array reduction results. Focused tests and staged checks passed; the fix was also included in the refreshed companion stack's successful MI300A/GH200 GPU runs, although those runs are not a dedicated GPU warning-path test.Related independent optimizations: #2922 and #2923. ICON4Py's integration is C2SM/icon4py#1484.