Skip to content

[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

Merged

Conversation

mfrancepillois
Copy link
Contributor

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.

…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)
@mfrancepillois mfrancepillois marked this pull request as ready for review January 18, 2024 12:40
@mfrancepillois mfrancepillois requested review from a team as code owners January 18, 2024 12:40
std::vector<T> Reference(Size);
std::memset(Reference.data(), 1, Size * sizeof(T));
for (size_t i = 0; i < Size; i++) {
Reference[i] += i;
Copy link
Contributor

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);.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

mfrancepillois and others added 15 commits January 19, 2024 14:56
…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>
mfrancepillois and others added 2 commits January 19, 2024 16:49
…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>
Copy link
Contributor

github-actions bot commented Jan 19, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Contributor

@maarquitos14 maarquitos14 left a comment

Choose a reason for hiding this comment

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

LGTM.

@EwanC
Copy link
Contributor

EwanC commented Jan 23, 2024

tagging @intel/llvm-gatekeepers for merging

@sommerlukas sommerlukas merged commit 82a83f0 into intel:sycl Jan 23, 2024
sommerlukas pushed a commit that referenced this pull request Jan 29, 2024
Fix memory leaks in newly added graph tests in
#12433.

Signed-off-by: Marcos Maronas <marcos.maronas@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants