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] Add support for CUDA backend #11133

Merged
merged 36 commits into from
Nov 3, 2023

Conversation

mfrancepillois
Copy link
Contributor

@mfrancepillois mfrancepillois commented Sep 11, 2023

Adds support for enabling CUDA backend with Sycl-Graph:

  • Enables Graph e2e tests with CUDA backend.

Companion PR with CUDA UR adapter changes is here: oneapi-src/unified-runtime#932

Authors

Co-authored-by: Maxime France-Pillois maxime.francepillois@codeplay.com
Co-authored-by: Ben Tracy ben.tracy@codeplay.com
Co-authored-by: Ewan Crawford ewan@codeplay.com

mfrancepillois and others added 12 commits September 11, 2023 10:46
Implements urCommandBufferAppendKernelLaunchExp function to append kernel to a command buffer.
Implements urCommandBufferAppendKernelLaunchExp function to enqueue a command buffer to a cuda stream.
Enable all tests supported by the current state of the Cuda backend.

Sets a ScopedContext before enqueuing command buffer.

* [SYCL][Graph] Adds missing exception catch
Implements CUDA backend support for:
- memcpyUSM
- memcpy Device to Device (1D and 2D)
- memcpy Host to Device (Write 1D and 2D)
- memcpy Device to Host (Read 1D and 2D)
Enables all remaining e2e tests

* [SYCL][Graph] Adds helper to register sync point
…kend (#309)

* [SYCL][Graph] Updates design Doc to report CUDA as supported backend

* [SYCL][Graph] Improves description and adds links to CUDA doc

* Update sycl/doc/design/CommandGraph.md

Co-authored-by: Ewan Crawford <ewan@codeplay.com>

* Update sycl/doc/design/CommandGraph.md

Co-authored-by: Julian Miller <julian.miller@intel.com>

* Update sycl/doc/design/CommandGraph.md

Co-authored-by: Julian Miller <julian.miller@intel.com>

* Update sycl/doc/design/CommandGraph.md

Co-authored-by: Julian Miller <julian.miller@intel.com>

* Update sycl/doc/design/CommandGraph.md

Co-authored-by: Julian Miller <julian.miller@intel.com>

* Update sycl/doc/design/CommandGraph.md

Co-authored-by: Julian Miller <julian.miller@intel.com>

---------

Co-authored-by: Ewan Crawford <ewan@codeplay.com>
Co-authored-by: Julian Miller <julian.miller@intel.com>
…end (#279)

* [SYCL][Graph] Implement graph creation and finalization for CUDA backend

Implements CommandBuffer creation, retain, release and finalize functions
for the cuda backend.
These functions rely on the cuda graph feature which is part of cuda runtime.
Consequently, this PR adds the required linking dependencies.
Fixes a commandbuffer bug in the cuda pluging initialization.
Reports cuda backend as supported for the graph extension.
Adds a tests that creates and finalizes an empty graph.
The offsets are taken into account after CUdeviceptr type casting.
This patch does not fix e2e test failure on AWS.

This reverts commit cdc19b1.
@mfrancepillois mfrancepillois temporarily deployed to WindowsCILock September 22, 2023 13:16 — with GitHub Actions Inactive
@mfrancepillois mfrancepillois temporarily deployed to WindowsCILock September 22, 2023 13:42 — with GitHub Actions Inactive
@Bensuo Bensuo temporarily deployed to WindowsCILock September 26, 2023 17:00 — with GitHub Actions Inactive
@Bensuo Bensuo temporarily deployed to WindowsCILock September 26, 2023 17:21 — with GitHub Actions Inactive
@Bensuo Bensuo temporarily deployed to WindowsCILock September 27, 2023 14:12 — with GitHub Actions Inactive
@Bensuo Bensuo temporarily deployed to WindowsCILock September 27, 2023 14:33 — with GitHub Actions Inactive
@Bensuo Bensuo temporarily deployed to WindowsCILock September 28, 2023 15:08 — with GitHub Actions Inactive
@Bensuo Bensuo temporarily deployed to WindowsCILock September 29, 2023 12:15 — with GitHub Actions Inactive
@Bensuo Bensuo temporarily deployed to WindowsCILock September 29, 2023 12:37 — with GitHub Actions Inactive
- Commands which enqueue to a command graph now correctly respect their dependencies by waiting on them.
- Prevents issues where allocation commands with dependent copies could be delayed due to device being busy and execute in an incorrect order with regards to future command graph executions.
@Bensuo Bensuo force-pushed the command-buffer-cuda-backend branch from be7a830 to 9b984e3 Compare October 5, 2023 14:00
@EwanC EwanC temporarily deployed to WindowsCILock November 1, 2023 09:51 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to WindowsCILock November 1, 2023 10:14 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to WindowsCILock November 1, 2023 11:38 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to WindowsCILock November 1, 2023 12:00 — with GitHub Actions Inactive
This is a temporary workaround to unblock the UR
merge queue. We will investigate and fix as follow-up work.
@EwanC EwanC temporarily deployed to WindowsCILock November 1, 2023 14:39 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to WindowsCILock November 1, 2023 14:59 — with GitHub Actions Inactive
@EwanC EwanC marked this pull request as ready for review November 1, 2023 16:55
@EwanC EwanC requested review from a team as code owners November 1, 2023 16:55
Copy link
Contributor

@kbenzie kbenzie left a comment

Choose a reason for hiding this comment

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

UR LGTM

@EwanC EwanC temporarily deployed to WindowsCILock November 2, 2023 05:16 — with GitHub Actions Inactive
@EwanC EwanC temporarily deployed to WindowsCILock November 2, 2023 05:55 — with GitHub Actions Inactive
@kbenzie
Copy link
Contributor

kbenzie commented Nov 2, 2023

@intel/llvm-reviewers-runtime please review ASAP, this is blocking other UR changes.

@EwanC
Copy link
Contributor

EwanC commented Nov 3, 2023

@intel/llvm-reviewers-runtime Could you give this PR a look please

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.

Sorry, this one flew under my radar! LGTM!

@steffenlarsen steffenlarsen merged commit 367b662 into intel:sycl Nov 3, 2023
12 checks passed
sommerlukas pushed a commit that referenced this pull request Apr 8, 2024
Enables buffer tests which were disabled on
#11133 due to a failure which is no
longer reproducible.
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