Skip to content

Documentation for Allocator and BackendLike#1083

Open
havogt wants to merge 7 commits intomainfrom
document_allocator_and_backendlike
Open

Documentation for Allocator and BackendLike#1083
havogt wants to merge 7 commits intomainfrom
document_allocator_and_backendlike

Conversation

@havogt
Copy link
Contributor

@havogt havogt commented Mar 2, 2026

No description provided.

@havogt havogt requested a review from msimberg March 2, 2026 08:15
Copy link
Contributor

@msimberg msimberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @havogt!

The model_backends.py module docstring almost perfectly answers my questions.

I don't know if this needs explicit mentioning somewhere, but handling of None is not described. I see now that BackendLike is ... | None. In

Backends can either be concrete GT4Py backends or 'BackendLike's, which are either concrete backends
or descriptions of how to construct a concrete backend

I assume None belongs to description of how to construct a concrete backend, in the form of "use the default"?

Additionally, we use Backend | None in some places. This is a subset of BackendLike, so should we just be using BackendLike in place of Backend | None? Can one pass None as allocator or does one have to get a concrete allocator with get_allocator(None) first?

@havogt
Copy link
Contributor Author

havogt commented Mar 2, 2026

I assume None belongs to description of how to construct a concrete backend, in the form of "use the default"?

Unfortunately, no. None is kind of a concrete backend: it's indicating to use embedded. The reason behind is: backends can be seen as a series of transformations on the original python function. If you say None it means don't do any transformation and just execute as is. In hindsight, this was a mistake as it creates confusion in user-code... We'll probably change that in the future. I'll add a comment.

@havogt
Copy link
Contributor Author

havogt commented Mar 2, 2026

cscs-ci run default

@havogt
Copy link
Contributor Author

havogt commented Mar 2, 2026

cscs-ci run distributed

@github-actions
Copy link

Mandatory Tests

Please make sure you run these tests via comment before you merge!

  • cscs-ci run default
  • cscs-ci run distributed

Optional Tests

To run benchmarks you can use:

  • cscs-ci run benchmark-bencher

To run tests and benchmarks with the DaCe backend you can use:

  • cscs-ci run dace

To run test levels ignored by the default test suite (mostly simple datatest for static fields computations) you can use:

  • cscs-ci run extra

For more detailed information please look at CI in the EXCLAIM universe.

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.

2 participants