Skip to content

[SYCL][Graph] Backend integration and feature additions for SYCL Graphs (3/4) #10033

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

Merged
merged 37 commits into from
Jul 17, 2023

Conversation

Bensuo
Copy link
Contributor

@Bensuo Bensuo commented Jun 22, 2023

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

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 third patch focuses on integrating the graphs runtime with the backend support added in #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 [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 added 4 commits June 22, 2023 13:22
- Hook up graphs impl to PI/UR
- Changes to scheduler and related classes to support graphs
- New memory manager methods for command buffer copies
- Device info query for command buffer support
julianmi and others added 12 commits June 29, 2023 14:08
Fix adding empty nodes to the graph results in two root nodes
…uffers (#238)

Adds support required to handle:
    - host to buffer memcpy for 1d and 2d buffers
    - buffer to host memcpy for 1d and 2d buffers
This commit also fixes a bug in buffer to buffer memcpy enabling to copy
from/to buffers accessed with user-defined offsets.

Adds basic tests to check all use-cases of mixed host/buffer memcpy, and
buffer to buffer memcpy with user-defined offsets.

Addresses Issue: #196
Fix some build errors I've seen with clang-17 after #238
was merged.

1) Arithmitic on void pointer, fixed by passing a `char*` rather than
`void*` when an offset is needed

```
/home/ewan/Development/dpcpp/sycl/source/detail/memory_manager.cpp:1316:44: error: arithmetic on a pointer to void
 1316 |           SrcAccessRangeWidthBytes, DstMem + DstXOffBytes, Deps.size(),
      |                                     ~~~~~~ ^
/home/ewan/Development/dpcpp/sycl/source/detail/memory_manager.cpp:1372:44: error: arithmetic on a pointer to void
 1372 |           DstAccessRangeWidthBytes, SrcMem + SrcXOffBytes, Deps.size(),
      |
	  ~~~~~~ ^

2) Fixup use of `numEventsInWaitList` when should be `numSyncPointsInWaitList`
/home/ewan/Development/dpcpp/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_command_buffer.cpp:611:13: error: use of undeclared identifier 'numEventsInWaitList'
  611 |       size, numEventsInWaitList, pSyncPointWaitList, pSyncPoint);
```
Gets rid of the warning "warning: moving a temporary object prevents copy elision"
@EwanC EwanC temporarily deployed to aws July 4, 2023 15:56 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to aws July 4, 2023 16:36 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to aws July 5, 2023 08:49 — with GitHub Actions Inactive
EwanC and others added 8 commits July 5, 2023 10:19
Adding a empty node to a recorded in-order queue resulted
in inconsistent dependencies between nodes.
This patch fixes this issues and simplifies the adding of empty nodes.
Unitests have been added to check node dependencies when
recording an in_order queue with and without empty nodes.
@EwanC EwanC temporarily deployed to aws July 7, 2023 10:49 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to aws July 7, 2023 11:31 — with GitHub Actions Inactive
@EwanC EwanC requested a review from jandres742 July 10, 2023 08:52
@EwanC EwanC temporarily deployed to aws July 11, 2023 10:06 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to aws July 11, 2023 10:50 — with GitHub Actions Inactive
Copy link
Contributor

@jandres742 jandres742 left a comment

Choose a reason for hiding this comment

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

+1 on level-zero

Matching implementation change to specification PR
#255
@EwanC EwanC temporarily deployed to aws July 12, 2023 08:52 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to aws July 12, 2023 09:41 — with GitHub Actions Inactive
- Remove UR from createURCommandBuffers() name
- Improve assert in findRealDeps()
@Bensuo Bensuo temporarily deployed to aws July 12, 2023 15:01 — with GitHub Actions Inactive
@Bensuo Bensuo temporarily deployed to aws July 12, 2023 15:54 — with GitHub Actions Inactive
reble added a commit to reble/llvm that referenced this pull request Jul 12, 2023
@EwanC EwanC requested a review from steffenlarsen July 13, 2023 11:40
reble added a commit to reble/llvm that referenced this pull request Jul 13, 2023
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.

Just a small nit, but otherwise LGTM!

@EwanC EwanC temporarily deployed to aws July 17, 2023 07:18 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to aws July 17, 2023 08:10 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to aws July 17, 2023 08:48 — with GitHub Actions Inactive
@steffenlarsen
Copy link
Contributor

Precommit failure in RHEL is unrelated and known. Merging this.

@steffenlarsen steffenlarsen merged commit 72341ee into intel:sycl Jul 17, 2023
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 <[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.

7 participants