-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL][Graph] Fix bug when host-task is submitted to in-order queue #12433
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] Fix bug when host-task is submitted to in-order queue #12433
Conversation
…322) * [SYCL][Graph] Fix bug when host-task is submitted to in-order queue When a host-task is submitted to in-order queue, dependency between this host-task and the successor is explicitly handled. However, when we record an in-order queue, the recorded CG are not part of the regular in-order queue execution sequence. But inter-CG dependancies are managed by the graph implementation. This PR implements this point and ensures that recording an in-order does not impact the normal execution sequence. Tests (e2e and unitest) have been added to check it. Adds and Renames tests (e2e and unitests)
sycl/test-e2e/Graph/RecordReplay/in_order_queue_with_host_managed_dependencies.cpp
Outdated
Show resolved
Hide resolved
std::vector<T> Reference(Size); | ||
std::memset(Reference.data(), 1, Size * sizeof(T)); | ||
for (size_t i = 0; i < Size; i++) { | ||
Reference[i] += i; |
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.
I think you can check the output immediately after this statement in the same loop. Actually, you might not even need to create Reference
at all. I think you can directly check assert(TestDataOut[i] = 1+i);
.
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.
You are right. Thanks for the suggestion. Reference
has been removed.
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.
I was too hasty in deleting Reference
.
In fact, References were not equal to 1 but to 0x1010101 because the memset works with bytes.
I prefer to keep memset than a hard value, in case we change the size of variables in the future.
I thus updated the code to use a single Reference
instead of an array.
sycl/test-e2e/Graph/RecordReplay/in_order_queue_with_host_managed_dependencies_memset.cpp
Outdated
Show resolved
Hide resolved
…ged_dependencies.cpp Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
sycl/test-e2e/Graph/RecordReplay/in_order_queue_with_host_managed_dependencies_memcpy.cpp
Outdated
Show resolved
Hide resolved
sycl/test-e2e/Graph/RecordReplay/in_order_queue_with_host_managed_dependencies_memset.cpp
Outdated
Show resolved
Hide resolved
…ged_dependencies_memcpy.cpp Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
…ged_dependencies_memset.cpp Co-authored-by: Marcos Maronas <maarquitos14@users.noreply.github.com>
✅ With the latest revision this PR passed the C/C++ code formatter. |
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.
tagging @intel/llvm-gatekeepers for merging |
Fix memory leaks in newly added graph tests in #12433. Signed-off-by: Marcos Maronas <marcos.maronas@intel.com>
When a host-task is submitted to in-order queue, dependency between this host-task and the successor is explicitly handled.
However, when we record an in-order queue, the recorded CG are not part of the regular in-order queue execution sequence.
But inter-CG dependencies are managed by the graph implementation.
This PR implements this point and ensures that recording an in-order does not impact the normal execution sequence.
Tests (e2e and unitest) have been added to check it.