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

[SYCL][Graph] Throw an exception when unsupported features used in a graph #10789

Merged
merged 12 commits into from
Aug 22, 2023

Conversation

EwanC
Copy link
Contributor

@EwanC EwanC commented Aug 11, 2023

This PR contains a set of changes that implement throwing an exception when a feature unsupported by
sycl_ext_oneapi_graph is used.

An error is thrown when an application uses the following features with the graph extension:

Authors

Co-authored-by: Pablo Reble [email protected]
Co-authored-by: Julian Miller [email protected]
Co-authored-by: Ben Tracy [email protected]
Co-authored-by: Ewan Crawford [email protected]
Co-authored-by: Maxime France-Pillois [email protected]

Bensuo and others added 6 commits August 11, 2023 11:44
- Error when we detected immediate command lists
- Throws exception with sycl::invalid
- Test which uses property::queue::<no_>immediate_command_list to test errors.
* [SYCL][Graph] Implement exceptions for incompatible extensions

Throws an invalid exception when trying to use the following extensions
along with Graph.

- sycl_ext_oneapi_enqueue_barrier
- sycl_ext_oneapi_memcpy2d
- sycl_ext_codeplay_kernel_fusion
- sycl_ext_oneapi_kernel_properties
- sycl_ext_oneapi_device_global

Closes Issue: #154

* [SYCL][Graph] Implement exceptions for incompatible extensions

Adds info to exception message
Moves tests from e2e to unitests when possible

* [SYCL][Graph] Implement exceptions for incompatible extensions

Corrects some typos and adds comments.

* [SYCL][Graph] Implement exceptions for incompatible extensions

Used a template function to throw exception instead of a parametrized function.

* [SYCL][Graph] Implement exceptions for incompatible extensions

Moves Sycl-extension enum definition.
Limits graph recording to non-explicit path in the new tests.

* [SYCL][Graph] Implement exceptions for incompatible extensions

Updates Linux ABI dump file with the new handler function throwing exception.
…and reductions (#290)

- Add exceptions when using spec constants, reductions and kernel bundles
- Unit tests added for these.
- Refactored handler throwing code to remove templates specializations.
- Moved and renamed unsupported features enum to graph header.
- Updated reduction tests to be XFAIL
- Tweak exception message wording
- Update ABI symbol tests.

---------

Co-authored-by: Ewan Crawford <[email protected]>
… a graph (#294)

* [SYCL][Graph] Throw exception when using bindless images extension in a graph

Throws an invalid exception when using bindless images extension in a graph.
Adds Unitests to test the exception throwing.
Throws an invalid exception when calling `event::get_profiling_info()` on an event returned by a graph submission.
Adds unitests checking that exceptions are throws if `event::get_profiling_info()` is called on an event returned from a queue in recording mode or an event returned by a graph submission.
@reble
Copy link
Contributor

reble commented Aug 11, 2023

Failing build on Linux is unrelated to this patch and should be fixed by #10795

@EwanC EwanC marked this pull request as ready for review August 15, 2023 05:38
@EwanC EwanC requested review from a team, victor-eds, Naghasan and sommerlukas as code owners August 15, 2023 05:38
@EwanC EwanC requested a review from bso-intel August 15, 2023 05:38
Copy link
Contributor

@sommerlukas sommerlukas left a comment

Choose a reason for hiding this comment

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

Focused my review on the parts relating to kernel fusion, i.e. fusion_wrapper_impl.cpp. LGTM.

@EwanC EwanC requested a review from steffenlarsen August 16, 2023 08:46
Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

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

LGTM!

sycl/source/detail/event_impl.hpp Outdated Show resolved Hide resolved
EwanC added 2 commits August 21, 2023 08:51
Using a sycl::reduction in a graphs unittests
caused the build to fail with a sign compare
warning
```
/__w/llvm/llvm/build/include/sycl/reduction.hpp:1358:56: error: comparison of integer expressions of different signedness: 'int' and 'const size_t' {aka 'const long unsigned int'} [-Werror=sign-compare]
```
@steffenlarsen steffenlarsen merged commit 8d8d3f4 into intel:sycl Aug 22, 2023
EwanC added a commit to reble/llvm that referenced this pull request Aug 22, 2023
After the merge of intel#10789
post-commit CI is failing on clang builds:

* [MacOS build](https://github.com/intel/llvm/actions/runs/5935599091/job/16094354219)
* [Linux
build](https://github.com/intel/llvm/actions/runs/5935599091/job/16094354500)

```
/Users/runner/work/llvm/llvm/build/include/sycl/ext/oneapi/experimental/graph.hpp:67:3: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]
  default:
```

Fixed by removing the default label from the `switch`, and replacing
with an assert `false` afterwards, which seems consistent with other
places in the sycl runtime.

I haven't done a clang build yet to verify this fix.
steffenlarsen pushed a commit that referenced this pull request Aug 22, 2023
After the merge of #10789 post-commit
CI is failing on clang builds:

* [MacOS
build](https://github.com/intel/llvm/actions/runs/5935599091/job/16094354219)
* [Linux
build](https://github.com/intel/llvm/actions/runs/5935599091/job/16094354500)

```
/Users/runner/work/llvm/llvm/build/include/sycl/ext/oneapi/experimental/graph.hpp:67:3: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]
  default:
```

Fixed by removing the default label from the `switch`, and replacing
with an assert `false` afterwards, which seems consistent with other
places in the sycl runtime.
veselypeta pushed a commit to veselypeta/llvm that referenced this pull request Sep 21, 2023
…graph (intel#10789)

This PR contains a set of changes that implement throwing an exception
when a feature unsupported by

[sycl_ext_oneapi_graph](https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/proposed/sycl_ext_oneapi_graph.asciidoc)
is used.

An error is thrown when an application uses the following features with
the graph extension:
* An unsupported extension.
* Querying the event returned from graph submission for profiling
information.
* Level Zero immediate command-list (see
intel#10467)
* Specialization constants, kernel bundles, or reductions are used in a
graph node.

## Authors

Co-authored-by: Pablo Reble <[email protected]>
Co-authored-by: Julian Miller <[email protected]>
Co-authored-by: Ben Tracy <[email protected]>
Co-authored-by: Ewan Crawford <[email protected]>
Co-authored-by: Maxime France-Pillois
<[email protected]>
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.

8 participants