diff --git a/sycl/doc/design/CommandGraph.md b/sycl/doc/design/CommandGraph.md index 9cc66626a2e78..56bee306aa9cc 100644 --- a/sycl/doc/design/CommandGraph.md +++ b/sycl/doc/design/CommandGraph.md @@ -236,7 +236,7 @@ Implementation of UR command-buffers for each of the supported SYCL 2020 backends. Backends which are implemented currently are: [Level Zero](#level-zero), -[CUDA](#cuda), and partial support for [OpenCL](#opencl). +[CUDA](#cuda), [HIP](#hip) and partial support for [OpenCL](#opencl). ### Level Zero @@ -351,6 +351,27 @@ An executable CUDA Graph, which contains all commands and synchronization information, is saved in the UR command-buffer to allow for efficient graph resubmission. +### HIP + +The HIP backend offers a Graph managemenet API very similar to CUDA Graph +feature for batching series of operations. +The SYCL Graph HIP backend implementation is therefore very similar to that of CUDA. + +UR commands (e.g. kernels) are mapped as graph nodes using the +[HIP Management API](https://docs.amd.com/projects/HIP/en/docs-5.5.0/doxygen/html/group___graph.html). +Synchronization between commands (UR sync-points) is implemented +using graph dependencies. +Executable HIP Graphs can be submitted to a HIP stream +in the same way as regular kernels. +The HIP backend enables enqueuing events to wait for into a stream. +It also allows signaling the completion of a submission with an event. +Therefore, submitting a UR command-buffer consists only of submitting to a stream +the executable HIP Graph that represent this series of operations. + +An executable HIP Graph, which contains all commands and synchronization +information, is saved in the UR command-buffer to allow for efficient +graph resubmission. + ### OpenCL SYCL-Graph is only enabled for an OpenCL backend when the diff --git a/sycl/doc/design/images/SYCL-Graph-Architecture.svg b/sycl/doc/design/images/SYCL-Graph-Architecture.svg index c554391f6544d..ffd3035495071 100644 --- a/sycl/doc/design/images/SYCL-Graph-Architecture.svg +++ b/sycl/doc/design/images/SYCL-Graph-Architecture.svg @@ -1,4 +1,4 @@ -
Application
Application
SYCL-Graph Extension API
SYCL-Graph Extension API
SYCL Runtime
SYCL Runtime
Unified Runtime + Command Buffer Extension
Unified Runtime + Command Buffer Extension
CUDA
CUDA
NVIDIA GPU
NVIDIA GPU
Level Zero
Level Zero
Intel CPU, GPU, FPGA, ...
Intel CPU, GPU,...
HIP
HIP
OpenCL cl_khr_command_buffer
OpenCL cl_khr_command_b...
AMD GPU
AMD GPU
CPU, GPU, FPGA, ...
CPU, GPU, FPG...
SYCL-Graph Architecture
SYCL-Graph Architecture


Application Layer
Application Layer
Implemented Backend
Implemented Backend
SYCL Runtime
SYCL Runtime
Future Backend Support
Future Backend Support
Legend
Legend
Partial Backend Support
Partial Backend Support
Text is not SVG - cannot display
\ No newline at end of file +
Application
Application
SYCL-Graph Extension API
SYCL-Graph Extension API
SYCL Runtime
SYCL Runtime
Unified Runtime + Command Buffer Extension
Unified Runtime + Command Buffer Extension
CUDA
CUDA
NVIDIA GPU
NVIDIA GPU
Level Zero
Level Zero
Intel CPU, GPU, FPGA, ...
Intel CPU, GPU,...
HIP
HIP
OpenCL cl_khr_command_buffer
OpenCL cl_khr_command_b...
AMD GPU
AMD GPU
CPU, GPU, FPGA, ...
CPU, GPU, FPG...
SYCL-Graph Architecture
SYCL-Graph Architecture


Application Layer
Application Layer
Implemented Backend
Implemented Backend
SYCL Runtime
SYCL Runtime
Legend
Legend
Partial Backend Support
Partial Backend Support
Text is not SVG - cannot display
\ No newline at end of file diff --git a/sycl/plugins/unified_runtime/CMakeLists.txt b/sycl/plugins/unified_runtime/CMakeLists.txt index 6e4bdac038fda..d3c2b333844fe 100644 --- a/sycl/plugins/unified_runtime/CMakeLists.txt +++ b/sycl/plugins/unified_runtime/CMakeLists.txt @@ -57,13 +57,14 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT) include(FetchContent) set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git") - # commit 9b936b5748a8da86123f3f148d1cfa84e52531c4 - # Merge: 91c6068b 767cfd1a - # Author: Piotr Balcer - # Date: Mon Feb 26 10:46:55 2024 +0100 - # Merge pull request #1354 from AllanZyne/sanitizer-device-global - # [DeviceSanitizer] Support detecting out-of-bounds error on DeviceGlobals - set(UNIFIED_RUNTIME_TAG 9b936b5748a8da86123f3f148d1cfa84e52531c4) + + # commit a2757b2931daa2f8d7c9dd51b0fc846be1fd49a7 + # Merge: 9b936b5 + f78d369 + # Author: Kenneth Benzie (Benie) + # Date: Tue Feb 27 11:34:58 2024 +0000 + # Merge pull request #1254 from Bensuo/cmdbuf-support-hip + # [EXP][CMDBUF] HIP adapter support for command buffers + set(UNIFIED_RUNTIME_TAG a2757b2931daa2f8d7c9dd51b0fc846be1fd49a7 ) if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO) set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}") diff --git a/sycl/test-e2e/Graph/Explicit/enqueue_ordering.cpp b/sycl/test-e2e/Graph/Explicit/enqueue_ordering.cpp index 04da3eaa5414b..da3ccd2329ec9 100644 --- a/sycl/test-e2e/Graph/Explicit/enqueue_ordering.cpp +++ b/sycl/test-e2e/Graph/Explicit/enqueue_ordering.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aspect-usm_shared_allocations // RUN: %{build} -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG diff --git a/sycl/test-e2e/Graph/Explicit/work_group_size_prop.cpp b/sycl/test-e2e/Graph/Explicit/work_group_size_prop.cpp index 9a4366d1f1d3d..d1eb9ef35c355 100644 --- a/sycl/test-e2e/Graph/Explicit/work_group_size_prop.cpp +++ b/sycl/test-e2e/Graph/Explicit/work_group_size_prop.cpp @@ -11,10 +11,9 @@ // should. So the Sycl graph support cannot correctly catch the error and throw // the approriate exception for negative test. An issue has been reported // https://github.com/bashbaug/SimpleOpenCLSamples/issues/95 -// XFAIL: cuda +// XFAIL: cuda, hip // UNSUPPORTED: opencl // Note: failing negative test with HIP in the original test -// TODO: disable hip when HIP backend will be supported by Graph #define GRAPH_E2E_EXPLICIT diff --git a/sycl/test-e2e/Graph/RecordReplay/work_group_size_prop.cpp b/sycl/test-e2e/Graph/RecordReplay/work_group_size_prop.cpp index d9007264aa3e8..d4bd94be66ce0 100644 --- a/sycl/test-e2e/Graph/RecordReplay/work_group_size_prop.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/work_group_size_prop.cpp @@ -11,10 +11,9 @@ // should. So the Sycl graph support cannot correctly catch the error and throw // the approriate exception for negative test. An issue has been reported // https://github.com/bashbaug/SimpleOpenCLSamples/issues/95 -// XFAIL: cuda +// XFAIL: cuda, hip // UNSUPPORTED: opencl // Note: failing negative test with HIP in the original test -// TODO: disable hip when HIP backend will be supported by Graph #define GRAPH_E2E_RECORD_REPLAY diff --git a/sycl/test-e2e/Graph/device_query.cpp b/sycl/test-e2e/Graph/device_query.cpp index f1f2e680c323a..3513aa74fa5b7 100644 --- a/sycl/test-e2e/Graph/device_query.cpp +++ b/sycl/test-e2e/Graph/device_query.cpp @@ -20,7 +20,8 @@ int main() { auto Backend = Device.get_backend(); if ((Backend == backend::ext_oneapi_level_zero) || - (Backend == backend::ext_oneapi_cuda)) { + (Backend == backend::ext_oneapi_cuda) || + (Backend == backend::ext_oneapi_hip)) { assert(SupportsGraphs == exp_ext::graph_support_level::native); } else if (Backend == backend::opencl) { // OpenCL backend support is conditional on the cl_khr_command_buffer