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

[SYCL] Honor dependencies of empty command groups #16180

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

aelovikov-intel
Copy link
Contributor

No description provided.

@aelovikov-intel
Copy link
Contributor Author

Not very familiar with the scheduler, so this can be totally wrong. And if this is the right direction, then there might be some work left for @intel/sycl-graphs-reviewers to support the same when part of SYCL graph.

@EwanC
Copy link
Contributor

EwanC commented Nov 26, 2024

Not very familiar with the scheduler, so this can be totally wrong. And if this is the right direction, then there might be some work left for @intel/sycl-graphs-reviewers to support the same when part of SYCL graph.

Thanks for the ping, it's a good question. I think we already have a test for this which hasn't regressed based on the CI of this PR.
Our add_empty_node() E2E helper function does

  Graph.begin_recording(Queue);
  auto ev = Queue.submit(
      [&](sycl::handler &CGH) { CGH.depends_on(std::vector<event>{Deps...}); });
  Graph.end_recording(Queue);

Which should be a code path stressed by this input https://github.com/intel/llvm/blob/sycl/sycl/test-e2e/Graph/Inputs/empty_node.cpp used as part of E2E test https://github.com/intel/llvm/blob/sycl/sycl/test-e2e/Graph/RecordReplay/empty_node.cpp

Copy link
Contributor

@sergey-semenov sergey-semenov left a comment

Choose a reason for hiding this comment

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

LGTM, just a tiny nitpick.

sycl/source/detail/scheduler/commands.cpp Outdated Show resolved Hide resolved
@aelovikov-intel aelovikov-intel merged commit 86e9ad2 into intel:sycl Nov 26, 2024
13 checks passed
@aelovikov-intel aelovikov-intel deleted the empty-cg branch November 26, 2024 18:13
@sarnex
Copy link
Contributor

sarnex commented Nov 26, 2024

@aelovikov-intel Are these postcommit fails related?

https://github.com/intel/llvm/actions/runs/12036585964/job/33558551326

# |   what():  Enqueue process failed.

@aelovikov-intel
Copy link
Contributor Author

Hm, I wouldn't expect. I'm going to wait till the job finishes and restart the failing task plus see how the next commit's post-commit CI behaves.

@aelovikov-intel
Copy link
Contributor Author

Interesting,

#include <sycl/sycl.hpp>

int main() {
  sycl::queue q;
  sycl::buffer<int, 1> b{1};

  q.submit([&](sycl::handler &cgh) {
    sycl::accessor a{b, cgh, sycl::read_write_host_task};
  });
  return 0;
}

passes, but

#include <sycl/sycl.hpp>

using namespace sycl::access;

int main() {
  sycl::queue q;

  sycl::unsampled_image<1> UImg(sycl::image_format::r32b32g32a32_uint, 3);

  q.submit([&](sycl::handler &cgh) {
    auto A1 =
        UImg.get_access<sycl::uint4, mode::read, sycl::image_target::host_task>(
            cgh);
  });
  return 0;
}

fails:

$ clang++ -fsycl a.cpp -O0 -gdwarf-4
$ ./a.out
terminate called after throwing an instance of 'sycl::_V1::exception'
  what():  Enqueue process failed.
Aborted (core dumped)

@sarnex
Copy link
Contributor

sarnex commented Nov 26, 2024

I don't understand why it didn't fail in precommit either. It looks like the failure case is L0 + gen12 + linux, which we definitely have in precommit. Weird.

aelovikov-intel added a commit to aelovikov-intel/llvm that referenced this pull request Nov 27, 2024
This is a recommit of intel#16180.
Post-commit CI had a few tests failing so the original PR was reverted.
The reason of the failures is that with proper dependencies tracking we
now try to actually create images on the device and it might fail if
device isn't capable of that. This updated version of the PR also
modifies those failing tests to skip checks on unsupported devices

Co-authored-by: Sergey Semenov <[email protected]>
aelovikov-intel added a commit that referenced this pull request Nov 27, 2024
This is a recommit of #16180.
Post-commit CI had a few tests failing so the original PR was reverted.
The reason of the failures is that with proper dependencies tracking we
now try to actually create images on the device and it might fail if
device isn't capable of that. This updated version of the PR also
modifies those failing tests to skip checks on unsupported devices

Co-authored-by: Sergey Semenov <[email protected]>
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