Skip to content

[SYCL][Graph] Adding experimental implementation of SYCL Command Graph extension #9375

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

Closed
wants to merge 67 commits into from

Conversation

reble
Copy link
Contributor

@reble reble commented May 9, 2023

This patch is replacing #7627 and ready for review. To simplify the review process this feature is split into multiple patches,
and this PR is only kept as a draft for reference.

In summary, it includes the following changes to enable
SYCL Graph extensions as proposed in #5626 :

  • Support for kernel execution and memcpy commands.
  • Both Explicit and Record & Replay graph construction.
  • UR command-buffer experimental-feature, implemented for
    Level Zero to enable deferred execution
    of a L0 command-lists.
  • test-e2e tests for extension.
  • Design Document.

See https://github.com/reble/llvm#implementation-status for the complete status.

For ease for review this complete PR is split into 4 separate PRs to be approved:

  1. API without PI/UR support [SYCL][Graph] Add initial support for SYCL Graph (1/4) #9728
  2. L0 Backend support [SYCL][Graph] L0 Backend support for SYCL Graphs (2/4) #9992
  3. Backend integration and feature additions [SYCL][Graph] Backend integration and feature additions for SYCL Graphs (3/4) #10033
  4. Graphs E2E Tests [SYCL][Graph] E2E tests for SYCL Graphs (4/4) #10216

@reble reble temporarily deployed to aws May 9, 2023 18:40 — with GitHub Actions Inactive
@reble reble temporarily deployed to aws May 10, 2023 03:07 — with GitHub Actions Inactive
@reble reble temporarily deployed to aws May 10, 2023 15:26 — with GitHub Actions Inactive
@reble reble temporarily deployed to aws May 11, 2023 17:02 — with GitHub Actions Inactive
@reble reble temporarily deployed to aws May 11, 2023 18:23 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to aws May 12, 2023 10:01 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to aws May 12, 2023 10:49 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to aws May 15, 2023 07:50 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to aws May 16, 2023 09:56 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to aws May 16, 2023 10:21 — with GitHub Actions Inactive
@reble reble temporarily deployed to aws May 16, 2023 18:40 — with GitHub Actions Inactive
@reble reble temporarily deployed to aws May 23, 2023 02:54 — with GitHub Actions Inactive
@reble reble temporarily deployed to aws May 23, 2023 03:36 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to aws May 23, 2023 11:21 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to aws May 25, 2023 10:15 — with GitHub Actions Inactive
@Bensuo Bensuo force-pushed the sycl-graph-release branch from bccea3c to 3a13d76 Compare May 30, 2023 14:53
@Bensuo Bensuo temporarily deployed to aws May 30, 2023 16:33 — with GitHub Actions Inactive
@reble reble marked this pull request as ready for review May 31, 2023 14:42
@reble reble requested review from a team as code owners May 31, 2023 14:42
@reble reble requested review from jchlanda and steffenlarsen May 31, 2023 14:42
@reble reble added the abi-break change that's breaking abi and waiting for the next window to be able to merge label Jun 1, 2023
EwanC and others added 8 commits July 19, 2023 08:05
Both the E2E tests `Graph/RecordReplay/dotp_multiple_queues.cpp` and
`Graph/RecordReplay/valid_no_end.cpp` use multiple queues. However, they
currently fail on Windows because a different context is used for each
queue.

Fix this by forcing the same context to be used for all queues used in
a test.

Closes #269
- Unify tests which use common header kernel functions that are mostly identical between APIs
- Test code moved to Inputs folder and actual lit tests define an API and include the input file
- Added missing tests for some APIs which have a counterpart in the other and are not API specific
- New common functions which are API agnostic for adding diamond dependency nodes
- New API agnostic function for adding single nodes
- API selected by defining GRAPH_E2E_<EXPLICIT/RECORD_REPLAY> before including test input
@reble reble temporarily deployed to aws July 19, 2023 19:27 — with GitHub Actions Inactive
@reble reble temporarily deployed to aws July 19, 2023 19:57 — with GitHub Actions Inactive
@reble reble temporarily deployed to aws July 19, 2023 20:37 — with GitHub Actions Inactive
Bensuo and others added 9 commits July 24, 2023 16:53
- Unify tests which use common header kernel functions that are mostly identical between APIs
- Test code moved to Inputs folder and actual lit tests define an API and include the input file
- Added missing tests for some APIs which have a counterpart in the other and are not API specific
- New common functions which are API agnostic for adding diamond dependency nodes
- New API agnostic function for adding single nodes
- API selected by defining GRAPH_E2E_<EXPLICIT/RECORD_REPLAY> before including test input
- Many dotp/usm tests removed and replaced with basic_* versions since they were almost identical
- Other tests unified
- Unify more tests
- Remove some unncessary tests
- Replace DEPENDS_ON macro with templated function
@reble reble temporarily deployed to aws July 25, 2023 02:30 — with GitHub Actions Inactive
@reble reble temporarily deployed to aws July 25, 2023 03:08 — with GitHub Actions Inactive
steffenlarsen pushed a commit that referenced this pull request Jul 28, 2023
# E2E Tests for SYCL Graphs
This is the fourth patch of a series that adds support for an
[experimental command graph
extension](#5626)

A snapshot of the complete work can be seen in draft PR #9375 which has
support all the specification defined ways of
adding nodes and edges to the graph, including both Explicit and Record
& Replay graph construction. The two types of nodes currently
implemented are kernel execution and memcpy commands.

See https://github.com/reble/llvm#implementation-status for the status
of our total work.

## Scope
This fourth patch focuses on adding E2E tests for SYCL Graphs, covering
the following:

* Record and Replay API based tests.
* Explicit API based tests.
* Thread safety tests.
* A small amount of miscellaneous tests.

## Following Split PRs
Future follow-up PRs with the remainder of our work on the extension
will include:
* NFC changes - Design doc.

## Authors
Co-authored-by: Pablo Reble <pablo.reble@intel.com>
Co-authored-by: Julian Miller <julian.miller@intel.com>
Co-authored-by: Ben Tracy <ben.tracy@codeplay.com>
Co-authored-by: Ewan Crawford <ewan@codeplay.com>
Co-authored-by: Maxime France-Pillois
<maxime.francepillois@codeplay.com>
@reble
Copy link
Contributor Author

reble commented Jul 28, 2023

With #10216 being merged this PR becomes obsolete.

@reble reble closed this Jul 28, 2023
veselypeta pushed a commit to veselypeta/llvm that referenced this pull request Sep 21, 2023
# Level Zero Backend Support for SYCL Graphs
This is the second patch of a series that adds support for an
[experimental command graph
extension](intel#5626)

A snapshot of the complete work can be seen in draft PR intel#9375 which has
support all the specification defined ways of
adding nodes and edges to the graph, including both Explicit and Record
& Replay graph construction. The two types of nodes currently
implemented are kernel execution and memcpy commands.

See https://github.com/reble/llvm#implementation-status for the status
of our total work.

## Scope
This second patch focuses on the required PI/UR support for the
experimental command-buffer feature in the Level Zero adapter:
* PI stubs for all adapters to enable compilation, no functionality.
* Command-buffer implementation for the Level Zero UR adapter.
* Stubs for the CUDA UR adapter to enable compilation, no functionality.

## Following Split PRs
Future follow-up PRs with the remainder of our work on the extension
will include:
* Hooking up backend to graphs runtime, bugfixes and other feature
additions, will add symbols but not break the ABI. (3/4)
* Add end-to-end tests for SYCL Graph extension. (4/4)
* NFC changes - Design doc and codeowner update.

## Authors
Co-authored-by: Pablo Reble <pablo.reble@intel.com>
Co-authored-by: Julian Miller <julian.miller@intel.com>
Co-authored-by: Ben Tracy <ben.tracy@codeplay.com>
Co-authored-by: Ewan Crawford <ewan@codeplay.com>
Co-authored-by: Maxime France-Pillois
<maxime.francepillois@codeplay.com>

---------

Co-authored-by: Ewan Crawford <ewan@codeplay.com>
Co-authored-by: Maxime France-Pillois <maxime.francepillois@codeplay.com>
veselypeta pushed a commit to veselypeta/llvm that referenced this pull request Sep 21, 2023
…hs (3/4) (intel#10033)

# Backend integration and feature additions for SYCL Graphs
This is the third patch of a series that adds support for an
[experimental command graph
extension](intel#5626)

A snapshot of the complete work can be seen in draft PR intel#9375 which has
support all the specification defined ways of
adding nodes and edges to the graph, including both Explicit and Record
& Replay graph construction. The two types of nodes currently
implemented are kernel execution and memcpy commands.

See https://github.com/reble/llvm#implementation-status for the status
of our total work.

## Scope
This third patch focuses on integrating the graphs runtime with the
backend support added in intel#9992 as well as any remaining runtime features
and bug fixes, and should include no ABI-breaking changes:
* Graphs runtime changes to use PI/UR command-buffers.
* Various improvements to the Graphs runtime classes.
* New memory manager methods for appending copies to a command-buffer.
* Changes to the Scheduler and related CG classes to enable Graphs.
* Device info query for command-graph support.
* Minor changes to some runtime classes to enable Graphs.

## Following Split PRs
Future follow-up PRs with the remainder of our work on the extension
will include:
* Add end-to-end tests for SYCL Graph extension. (4/4)
* NFC changes - Design doc and codeowner update.

## Authors
Co-authored-by: Pablo Reble <pablo.reble@intel.com>
Co-authored-by: Julian Miller <julian.miller@intel.com>
Co-authored-by: Ben Tracy <ben.tracy@codeplay.com>
Co-authored-by: Ewan Crawford <ewan@codeplay.com>
Co-authored-by: Maxime France-Pillois
<maxime.francepillois@codeplay.com>
fabiomestre pushed a commit to fabiomestre/llvm that referenced this pull request Sep 26, 2023
# Level Zero Backend Support for SYCL Graphs
This is the second patch of a series that adds support for an
[experimental command graph
extension](intel#5626)

A snapshot of the complete work can be seen in draft PR intel#9375 which has
support all the specification defined ways of
adding nodes and edges to the graph, including both Explicit and Record
& Replay graph construction. The two types of nodes currently
implemented are kernel execution and memcpy commands.

See https://github.com/reble/llvm#implementation-status for the status
of our total work.

## Scope
This second patch focuses on the required PI/UR support for the
experimental command-buffer feature in the Level Zero adapter:
* PI stubs for all adapters to enable compilation, no functionality.
* Command-buffer implementation for the Level Zero UR adapter.
* Stubs for the CUDA UR adapter to enable compilation, no functionality.

## Following Split PRs
Future follow-up PRs with the remainder of our work on the extension
will include:
* Hooking up backend to graphs runtime, bugfixes and other feature
additions, will add symbols but not break the ABI. (3/4)
* Add end-to-end tests for SYCL Graph extension. (4/4)
* NFC changes - Design doc and codeowner update.

## Authors
Co-authored-by: Pablo Reble <pablo.reble@intel.com>
Co-authored-by: Julian Miller <julian.miller@intel.com>
Co-authored-by: Ben Tracy <ben.tracy@codeplay.com>
Co-authored-by: Ewan Crawford <ewan@codeplay.com>
Co-authored-by: Maxime France-Pillois
<maxime.francepillois@codeplay.com>

---------

Co-authored-by: Ewan Crawford <ewan@codeplay.com>
Co-authored-by: Maxime France-Pillois <maxime.francepillois@codeplay.com>
mdtoguchi pushed a commit to mdtoguchi/llvm that referenced this pull request Oct 18, 2023
# E2E Tests for SYCL Graphs
This is the fourth patch of a series that adds support for an
[experimental command graph
extension](intel#5626)

A snapshot of the complete work can be seen in draft PR intel#9375 which has
support all the specification defined ways of
adding nodes and edges to the graph, including both Explicit and Record
& Replay graph construction. The two types of nodes currently
implemented are kernel execution and memcpy commands.

See https://github.com/reble/llvm#implementation-status for the status
of our total work.

## Scope
This fourth patch focuses on adding E2E tests for SYCL Graphs, covering
the following:

* Record and Replay API based tests.
* Explicit API based tests.
* Thread safety tests.
* A small amount of miscellaneous tests.

## Following Split PRs
Future follow-up PRs with the remainder of our work on the extension
will include:
* NFC changes - Design doc.

## Authors
Co-authored-by: Pablo Reble <pablo.reble@intel.com>
Co-authored-by: Julian Miller <julian.miller@intel.com>
Co-authored-by: Ben Tracy <ben.tracy@codeplay.com>
Co-authored-by: Ewan Crawford <ewan@codeplay.com>
Co-authored-by: Maxime France-Pillois
<maxime.francepillois@codeplay.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abi-break change that's breaking abi and waiting for the next window to be able to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants