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] Implement missing exceptions defined by SYCL-Graphs specification #10775

Merged
merged 18 commits into from
Aug 30, 2023

Conversation

EwanC
Copy link
Contributor

@EwanC EwanC commented Aug 10, 2023

This PR contains a set of changes that implement throwing an exception on invalid usage, as defined by sycl_ext_oneapi_graph. Covering the cases missing from the current implementation.

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 5 commits August 10, 2023 11:40
- make_edge now checks for cycles
- no_cycle_check property can now be passed to skip them
- Various other error checks in make_edge
- Generic depth first search mechanism added to graph_impl
- New e2e tests for cycle checks
- Unit tests for other basic errors
- Prevent adding duplicate edges
- Adds testing for the graph structure after a cycle error is caught to ensure it is unchanged.
- Skip cycle checks when dst has no successors
…ording a queue (#283)

Factorizes the exception throwing method when the explicit API is used on a graph recording a queue
Improves the test while_recording to test throwing an invalid exception for the two explicit graph:add entry points.

Addresses issue #271

* Update sycl/source/detail/graph_impl.hpp

Co-authored-by: Ben Tracy <[email protected]>

* Update sycl/test-e2e/Graph/Explicit/while_recording.cpp

Co-authored-by: Ben Tracy <[email protected]>

* Update sycl/source/detail/graph_impl.hpp

Co-authored-by: Ewan Crawford <[email protected]>

---------

Co-authored-by: Ben Tracy <[email protected]>
Co-authored-by: Ewan Crawford <[email protected]>
…kend (#280)

* [SYCL][Graph] Throw exception when creating graph for unsupported backend

- Checks backend when creating graphs and throws an exception is the backend is not supported.
- Adds an e2e test to verify this exception throwing.
- Updates some comments
- Improves mock usage in Unitest to avoid having to force emulation mode

---------

Co-authored-by: Pablo Reble <[email protected]>
Co-authored-by: Julian Miller <[email protected]>
* [SYCL][Graph] Makes command graph functions thread-safe (bugfix)

Removes the test-e2e dependency to graph_impl.hpp by changing the e2e test
to an unitests.

* [SYCL][Graph] Error on invalid buffer behaviour

- Error for buffers with write back enabled.
- Error for host accessors to buffers in use by a graph.
- Unit tests added for these cases
- Fixed E2E tests which were not compliant with these restrictions.

* [SYCL][Graph] Implement assume_data_outlives_buffer property

- Add assume_data_outlives_buffer property
- Add check to disallow buffers with host data without this property
- Add a generic test for this.
- Update E2E tests which now require the property

* Update symbol dumps

* [SYCL][Graph] Implement assume_buffer_outlives_graph property and checks

* [SYCL][Graph] Add E2E test for assume_buffer_outlives_graph property

* [SYCL][Graph] Fix circular reference between queue and graph_impl

- Use weak_ptrs in both classes to prevent circular references and unnecessary lifetime extensions
- Update unit tests for new properties

* [SYCL][Graph] Remove unnecessary test line

* [SYCL][Graph] Make graph use count in memobjects atomic

* [SYCL][Graph] Make markNoLongerBeingUsedInGraph() thread safe

---------

Co-authored-by: Maxime France-Pillois <[email protected]>
Co-authored-by: Ewan Crawford <[email protected]>
@EwanC EwanC requested review from a team as code owners August 10, 2023 12:34
@EwanC EwanC requested a review from againull August 10, 2023 12:34
@reble reble changed the title [SYCL][Graphs] Implement missing exceptions defined by SYCL-Graphs specification [SYCL][Graph] Implement missing exceptions defined by SYCL-Graphs specification Aug 10, 2023
@EwanC EwanC marked this pull request as draft August 11, 2023 09:30
@EwanC EwanC marked this pull request as ready for review August 22, 2023 09:37
@EwanC EwanC requested a review from steffenlarsen August 22, 2023 10:12
EwanC added 5 commits August 25, 2023 12:14
Implements spec feedback to remove this property, goes with
spec PR #311
* [SYCL][Graph] Move `graph_support_level` namespace

Move the `graph_support_level` enum from
`sycl::ext::oneapi::experimental::info` to
`sycl::ext::oneapi::experimental`

Reflects changes from specification PR #311

* Give explicit values to enum class
Comment on lines -102 to -103
??$get_info@Ugraph_support@device@info@experimental@oneapi@ext@_V1@sycl@@@device@_V1@sycl@@QEBA?AW4graph_support_level@info@experimental@oneapi@ext@12@XZ
??$get_info@Ugraph_support@device@info@experimental@oneapi@ext@_V1@sycl@@@device_impl@detail@_V1@sycl@@QEBA?AW4graph_support_level@info@experimental@oneapi@ext@23@XZ
Copy link
Contributor Author

@EwanC EwanC Aug 28, 2023

Choose a reason for hiding this comment

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

This change from experimental::info::graph_support_level to experimental::graph_support_level, I think is an ABI breaking change here as the old symbol is removed.

We're not currently in an ABI break window, but the ABI Policy Guide says this about experimental features

Note: Features clearly marked as experimental are considered as an exception to this guideline.

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!

@steffenlarsen
Copy link
Contributor

Precommit failure is an infrastructure timeout. Merging.

@steffenlarsen steffenlarsen merged commit 77b794b into intel:sycl Aug 30, 2023
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.

6 participants