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

Add functional description for runtime eager progress #270

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sophimao
Copy link
Contributor

@sophimao sophimao commented Feb 3, 2023

Currently the runtime uses cooperative scheduling to make forward progress between different command queues and contexts, however, this mechanism sometimes leads to hung in the program if no explicit status update functions or clEnqueue* functions are called. The proposal is to make the runtime a multithreaded model with a background thread constantly updating the runtime event status.

@sophimao sophimao self-assigned this Feb 3, 2023
@sophimao sophimao requested review from pcolberg and zibaiwan February 3, 2023 20:25
@pcolberg pcolberg added the documentation Improvements or additions to documentation label Feb 3, 2023
@pcolberg pcolberg added this to the 2024.0 milestone Feb 3, 2023
@zibaiwan zibaiwan modified the milestones: 2024.0, 2024.1 Aug 17, 2023
zibaiwan
zibaiwan previously approved these changes Sep 20, 2023
Copy link
Contributor

@zibaiwan zibaiwan left a comment

Choose a reason for hiding this comment

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

Thanks Sophie. The proposal looks very good and informative. I might be able to provide more comments after I do more research about my multi-threading support project.

|:--:|
|Figure 3: Runtime hung when launching the same kernel for multiple times, without fask kernel relaunch|

This scenario is mitigated by the introduction of the fast kernel relaunch feature, which enables submission of the kernel device op generated by the launch of the same kernel by `fast_launch_depth` number of time, where `fast_launch_depth` is the depth of the kernel argument preload buffer. (For more details on the Fast Kernel Relaunch feature, please find it in the [Fast Kernel Relaunch FD](https://github.com/intel-innersource/applications.fpga.oneapi.products.acl-docs/blob/986fe42ff647c2a264ed9a440bec3d27dcec3a05/FDs/runtime/opencl_fast_kernel_relaunch_fd.docx).) With this feature, there can be `fast_launch_depth`+1 number of kernel device ops in either a `CL_SUBMITTED` or `CL_RUNNING` status, which would resolve the above example illustrated in Figure 3 as now the second kernel device op can be launched without the first kernel device op getting completed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, we can't put the Fast Kernel Relaunch FD link here since it's internal. However, I think we can probably copy it into the public repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now I changed it to a public doc page, we can modify the link again when we put the FD in the public repo :)

Currently the runtime uses cooperative scheduling to make forward progress
between different command queues and contexts, however, this mechanism
sometimes leads to hung in the program if no explicit status update
functions or clEnqueue* functions are called. The proposal is to make
the runtime a multithreaded model with a background thread constantly
updating the runtime event status.
@sophimao sophimao removed this from the 2024.1 milestone Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants