-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][Fusion] Improve circular dependency detection #8148
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][Fusion] Improve circular dependency detection #8148
Conversation
For more background, we can have a look at this test case. Without fusion, the dependency graph looks like this: graph TD
A[KernelTwo] --> B[KernelThree]
B --> C[KernelOne]
After fusion, this would result in the following dependency graph: graph TD
A[Fused from KernelOne and KernelTwo] -->B[KernelThree]
B --> A
As cycles in the dependency graph are not allowed, fusion needs to be cancelled in this case. So far, this scenario would be detected when However, in reality the dependency graph can be more complicated: graph TD
A[KernelTwo] --> B[...]
B --> C[Map memory]
C --> D[KernelThree]
D --> E[...]
E --> F[Map memory]
F --> G[KernelOne]
In this case, it is not sufficient to check the direct edge of As this traversal is too expensive to perform it on every |
The necessary updates to the tests are in intel/llvm-test-suite#1557. |
/verify with intel/llvm-test-suite#1557 |
Signed-off-by: Lukas Sommer <lukas.sommer@codeplay.com>
d04fa48
to
e6f9925
Compare
@sergey-semenov: The failure in the checks seems to be due to CI using the wrong version of The version of I put the |
@sommerlukas The failing jobs are always run against the current version of llvm-test-suite, so that's expected. Your verify command should have launched a "Jenkins/llvm-test-suite" alongside "Jenkins/Precommit", but it looks like that didn't work for some reason. I've reported this issue, your verify results from the llvm-test-suite PR should be enough here. |
@sergey-semenov: Thanks for the information! FWIW, "Jenkins/llvm-test-suite" was successfully executed as part of the test-suite PR: intel/llvm-test-suite#1557 The other CI pipelines in the test-suite PR were executed against the latest nightly, so it is expected that they fail, as they do not include the new logic from this PR. |
The job has launched and passed successfully. See results for this commit: d04fa48. Unfortunately, it's hard to find because @sommerlukas did rebase. @sommerlukas, please, use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some minor stylistic suggestions.
Signed-off-by: Lukas Sommer <lukas.sommer@codeplay.com>
@sergey-semenov Thanks for your feedback, addressed it in the latest commit. @bader: Sorry for the CI confusion, I amended and force-pushed the branch when addressing @Naghasan's feedback. For the new feedback, I've created a separate commit to avoid the issue. |
The checks for OpenCL and LevelZero failed expectedly, as they execute against Checks for AMD and CUDA failed due to some unrelated test failure for ESIMD:
@bader @sergey-semenov: Can someone please merge, I'm not authorized. |
The failing test has already been disabled on CUDA and HIP in intel/llvm-test-suite#1564 |
Kernel fusion can potentially create cycles in the SYCL dependency graph. These potential cycles must be detected and fusion must be cancelled, if it would give rise to such a cycle.
This PR improves the detection process for cycles to traverse the dependency graph. As this is more effort than the old solution, cycle detection has been moved from
queue::submit
, where it would be happening for each kernel submission to a queue in fusion mode, tofusion_wrapper::complete_fusion
, where it happens at most once per fusion.Signed-off-by: Lukas Sommer lukas.sommer@codeplay.com