Skip to content

Conversation

@veselypeta
Copy link
Contributor

@veselypeta veselypeta commented Apr 24, 2023

This MR:

  • Introduces a basic concept of extensions for unified runtime.
  • The extensions specification is largely based on L0 see here
  • Introduces urPlatformGetExtensionProperties to query which extensions are supported.

@veselypeta veselypeta marked this pull request as draft April 24, 2023 14:46
- Extensions must have globally unique extension names reported from ${x}PlatformGetExtensionProperties
- All extensions must be defined in this specification
- Extensions must not break backwards compatibility of the core APIs
- Standard extension versions must be backwards compatible with prior versions
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copied this from L0 extension scheme, but perhaps we could use semantic versioning with extensions with major/minor versions?

@kbenzie kbenzie added the needs-discussion This needs further discussion label Apr 28, 2023
@veselypeta veselypeta force-pushed the petr/document-extensions branch 2 times, most recently from ef696fc to 5534b9d Compare May 2, 2023 10:25
@veselypeta veselypeta force-pushed the petr/document-extensions branch from 68764b5 to ccb757e Compare May 2, 2023 13:38
- Extensions must use globally unique names for macros, enums, structures and functions
- Extensions must have globally unique extension names reported from ${x}PlatformGetExtensionProperties
- All extensions must be defined in this specification
- Extensions must not break backwards compatibility of the core APIs

Choose a reason for hiding this comment

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

Does this also include semantic breaks as well as interface breaks in the core APIs, i.e. does this forbid an extension from altering the behavior of an existing API?

Copy link
Contributor Author

@veselypeta veselypeta May 3, 2023

Choose a reason for hiding this comment

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

I think an extension can alter the behavour of an existing API. For example you might want to chain an additional structure to the input or use extension specific enums, but default usage should remain the same.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I'm not sure I'm so confortable with extensions that change semantics because we have no way to opt-out with this architecture. If we were able to enable extensions, like Vulkan, maybe I'd be more conformtable with that.

- Extensions must have globally unique extension names reported from ${x}PlatformGetExtensionProperties
- All extensions must be defined in this specification
- Extensions must not break backwards compatibility of the core APIs
- Standard extension versions must be backwards compatible with prior versions

Choose a reason for hiding this comment

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

Does this mean that experimental extensions are permitted to break backwards compatibility?

Copy link
Contributor Author

@veselypeta veselypeta May 3, 2023

Choose a reason for hiding this comment

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

Yes I think that makes sense. Experimental extensions should have no ABI or backwards compatibility requirements.

There are two types of extensions defined by this specification:

1. **Standard** - extension will be included into the current and all future version of the specification.
2. **Experimental** - extensions require additional experimentation and development, before becoming a standard extension.

Choose a reason for hiding this comment

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

Will there be implementation or coverage requirements for when an extension should move from experimental to standard?

* Document the extension in `EXT_<ext-name>.rst` file based on the `EXT_Template.rst`, ensuring it is added to the list of
extensions below.

* The extension will only be accepted if all conditions are met and its addition is agreed upon by the Working Group.

Choose a reason for hiding this comment

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

Does this refer to an extension becoming a standard extension?

* The extension will only be accepted if all conditions are met and its addition is agreed upon by the Working Group.


List of Standard Extensions

Choose a reason for hiding this comment

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

Just a thought, maybe these lists should also track the implementation status of the extensions, so whether they are implemented, and then which version of UR supports which version of the extension, particularly for the experimental extensions which may change, so high-level languages know what they can use when updating the UR interface.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In this section describe in detail the purpose of the extension, along with its
valid usage.
Copy link
Contributor

Choose a reason for hiding this comment

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

Quite like it when extensions have a version history at the bottom, could we add that to the template?

Copy link
Contributor

@kbenzie kbenzie May 3, 2023

Choose a reason for hiding this comment

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

This is useful info, I do wonder if having the ability to view different extension versions side-by-side would also be useful though (other than looking at the git history)?

Copy link
Contributor Author

@veselypeta veselypeta May 3, 2023

Choose a reason for hiding this comment

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

That would be really good. @kbenzie I've seen versioned docs before on the Zephyr project link - there is a dropdown in the bottom left where you can select the version of the API you want to view. I'm not really sure how this is implemented, but perhaps we can have something like that as well as a changelog (like ewan suggested).

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the Zephyr page I think that's for the entire page rather than just the extension specs, my gut feeling is you'd need to have a separate Sphinx build for each extension to get something exapctly like that.

@veselypeta
Copy link
Contributor Author

In the WG there was a strong response against implementing extensions in this way - especially standard extensions. Instead we will create a Contribution Guide which will outline how anyone will be able to add "experimental features" to extend the API for their purposes. We have not yet decided on how we should then make an "experimental feature" a core feature, but we cannot make any references to the working group as this would inhibit 3rd party contributions.

@veselypeta
Copy link
Contributor Author

Closing this in favour of Experimental Features

@veselypeta veselypeta closed this May 18, 2023
EwanC pushed a commit to reble/llvm that referenced this pull request May 22, 2023
Rather than the user deciding whether to use the emulation mode
or backend command-buffer mode, it is less error prone to do it
programmatically as a user can't select an unsupported config.

This also fixes #90 where currently
the `SYCL_EXT_ONEAPI_GRAPH` macro isn't defined when in emulation mode.

Done by using a PI device info query in finalization. This
also corresponds to a new UR device info query until the extension mechanism is
decided oneapi-src/unified-runtime#458
but will be superceeded by whatever extension reporting mechanism is
decided on.

The only PI backend which reports support for command-buffer
implementation is Level Zero, the other backends/adapters report no
support.

The vendor test macro test-e2e test is re-enabled with this change.
EwanC pushed a commit to reble/llvm that referenced this pull request May 22, 2023
Rather than the user deciding whether to use the emulation mode
or backend command-buffer mode, it is less error prone to do it
programmatically as a user can't select an unsupported config.

This also fixes #90 where currently
the `SYCL_EXT_ONEAPI_GRAPH` macro isn't defined when in emulation mode.

Done by using a PI device info query in finalization. This
also corresponds to a new UR device info query until the extension mechanism is
decided oneapi-src/unified-runtime#458
but will be superceeded by whatever extension reporting mechanism is
decided on.

The only PI backend which reports support for command-buffer
implementation is Level Zero, the other backends/adapters report no
support.

The vendor test macro test-e2e test is re-enabled with this change.
@veselypeta veselypeta deleted the petr/document-extensions branch June 15, 2023 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-discussion This needs further discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants