Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
neon60 committed Nov 29, 2024
1 parent df145f0 commit 1484d67
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions docs/how-to/hip_runtime_api/asynchronous.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,17 @@ Concurrent kernel execution
-------------------------------------------------------------------------------

Concurrent execution of multiple kernels on the GPU allows different kernels to
run simultaneously, leveraging the parallel processing capabilities of the GPU.
Utilizing multiple streams enables developers to launch kernels concurrently,
maximizing GPU resource usage. Managing dependencies between kernels is crucial
for ensuring correct execution order. This can be achieved using
:cpp:func:`hipStreamWaitEvent`, which allows a kernel to wait for a specific
event before starting execution. Proper management of concurrent kernel
execution can lead to significant performance gains, particularly in
applications with independent tasks that can be parallelized. By maximizing the
utilization of GPU cores, developers can achieve higher throughput and
efficiency.
run simultaneously to maximize GPU resource usage. Managing dependencies between
kernels is crucial for ensuring correct execution order. This can be achieved
using :cpp:func:`hipStreamWaitEvent`, which allows a kernel to wait for a
specific event before starting execution.

Independent kernels can only run concurrently, if there are enough registers and
share memories for the kernels. To reach concurrent kernel executions, the
developer may have to reduce the block size of the kernels. The kernel runtimes
can be misleading at concurrent kernel runs, that's why during optimization it's
better to check the trace files, to see if a kernel is blocking another kernel
while they are running parallel.

Overlap of data transfer and kernel execution
===============================================================================
Expand Down Expand Up @@ -175,10 +176,7 @@ to start before the primary kernel finishes, HIP achieves similar functionality
using streams and events. By employing :cpp:func:`hipStreamWaitEvent`, it is
possible to manage the execution order without explicit hardware support. This
mechanism allows a secondary kernel to launch as soon as the necessary
conditions are met, even if the primary kernel is still running. Such an
approach optimizes resource utilization and improves performance by efficiently
overlapping operations, especially in complex applications with interdependent
tasks.
conditions are met, even if the primary kernel is still running.

Example
-------------------------------------------------------------------------------
Expand Down

0 comments on commit 1484d67

Please sign in to comment.