Skip to content

[SYCL] Fix 2D slicepitch info #18960

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

Open
wants to merge 11 commits into
base: sycl
Choose a base branch
from
Open

Conversation

hdelan
Copy link
Contributor

@hdelan hdelan commented Jun 12, 2025

Make slicePitch equal to image size and numSlices 1 for a 2D image.

This was incorrect but wasn't failing as many backends ignore Pitch[1] for a 2D image.

Make slicepitch image size and num slices 1 for a 2D image.
@hdelan hdelan requested a review from a team as a code owner June 12, 2025 15:49
@hdelan hdelan requested a review from maarquitos14 June 12, 2025 15:49
@hdelan hdelan temporarily deployed to WindowsCILock June 12, 2025 15:50 — with GitHub Actions Inactive
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

@maarquitos14
Copy link
Contributor

Can we have a test for this?

@hdelan hdelan temporarily deployed to WindowsCILock June 12, 2025 16:45 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock June 12, 2025 16:45 — with GitHub Actions Inactive
@hdelan
Copy link
Contributor Author

hdelan commented Jun 12, 2025

I could potentially make a unittest that checks whether a valid slice pitch is passed to the backend. The slice pitch is not exposed to the user for 2D images so the test would need to look at a backend SYCL_UR_TRACE.

@maarquitos14
Copy link
Contributor

I could potentially make a unittest that checks whether a valid slice pitch is passed to the backend. The slice pitch is not exposed to the user for 2D images so the test would need to look at a backend SYCL_UR_TRACE.

unittest works for me! Thanks!

Make sure the SYCL runtime is passing correct values to
UR layer.
@hdelan hdelan temporarily deployed to WindowsCILock June 17, 2025 16:42 — with GitHub Actions Inactive
@hdelan
Copy link
Contributor Author

hdelan commented Jun 17, 2025

I've added a test in the E2E tests. There weren't any unittests using SYCL_UR_TRACE as this test does, and only a handful of tests in test so I though test-e2e was the most natural place for these.

Don't run on L0 and remove the std::cout at the end.
Don't include read write flags, these may differ per backend.
@hdelan hdelan temporarily deployed to WindowsCILock June 18, 2025 13:05 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock June 18, 2025 13:39 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock June 18, 2025 13:39 — with GitHub Actions Inactive
Pitches are only used when host ptr is non null.
@hdelan hdelan temporarily deployed to WindowsCILock June 18, 2025 15:40 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock June 18, 2025 17:17 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock June 18, 2025 17:17 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock June 19, 2025 10:55 — with GitHub Actions Inactive
Pitches are configured differently if a new allocation is made.
If a host ptr is used, exit early. This means that FileCheck
should only be invoked if the test doesn't exit early. This
conditional is best expressed in Python as it is portable
across Windows and Linux.
@hdelan hdelan force-pushed the image-pitch-bugfix branch from 25f99f2 to f62a8aa Compare June 25, 2025 11:03
@hdelan hdelan temporarily deployed to WindowsCILock June 25, 2025 11:03 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock June 25, 2025 11:28 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock June 25, 2025 11:28 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock June 25, 2025 12:42 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock June 25, 2025 13:07 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock June 25, 2025 13:07 — with GitHub Actions Inactive
@hdelan
Copy link
Contributor Author

hdelan commented Jun 25, 2025

@intel/llvm-gatekeepers the failure is unrelated. Can we merge this please?

@sarnex
Copy link
Contributor

sarnex commented Jun 25, 2025

@hdelan The failure is related, you need to add UNSUPPORTED-TRACKER or UNSUPPORTED-INTENDED to sycl/test-e2e/Basic/image/image_trace.cpp, grep the source for examples of exactly what to do.

@aelovikov-intel
Copy link
Contributor

@hdelan The failure is related, you need to add UNSUPPORTED-INFO or UNSUPPORTED-INTENDED to sycl/test-e2e/Basic/image/image_trace.cpp, grep the source for examples of exactly what to do.

And this is the reason why simply saying "failure is unrelated" without even copying the failing test name into the comment is wrong.

Comment on lines +10 to +14
// This test should be allowed to exit early if the image doesn't use a host
// ptr, but it should pipe stdout to FileCheck otherwise. A portable way to
// allow an early exit without any output to pipe to FileCheck logic is to use
// Python.
// RUN: env SYCL_UR_TRACE=-1 %{run} python -c "import subprocess, sys; p = subprocess.run(['%t.out'], stdout=subprocess.PIPE, check=True); o = p.stdout.strip(); sys.exit(0) if not o else subprocess.run(['FileCheck', '%s'], input=o, text=True).returncode"
Copy link
Contributor

Choose a reason for hiding this comment

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

Wow... And I still have no clue why is this necessary after reading this comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, IMO we really need to avoid this. We should split the test if there's no way to do it in a single test.

@sarnex
Copy link
Contributor

sarnex commented Jun 25, 2025

And this is the reason why simply saying "failure is unrelated" without even copying the failing test name into the comment is wrong.

I do it too something :(, I'll try to be better both myself and checking for it before merging :)

Comment on lines +56 to +57
// Trace will be different depending on whether host ptr is used or not
if (!Img1.has_property<sycl::property::image::use_host_ptr>()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Who sets this property?

@maarquitos14
Copy link
Contributor

@hdelan Please don't do 9 commits after approval without asking for it again. I'm happy to review as many times as needed.

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