Skip to content

[SYCL] Added a new test case for sub-group attributes #537

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
merged 1 commit into from
Sep 19, 2019
Merged

[SYCL] Added a new test case for sub-group attributes #537

merged 1 commit into from
Sep 19, 2019

Conversation

shiltian
Copy link
Contributor

Signed-off-by: Shilei Tian [email protected]

} \
};

KERNEL_FUNCTOR_WITH_SIZE(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Overall this test looks good. I have only one concern that it might not work properly on any OpenCL RT with sub-groups support.

The problem is that all kernel functions described here are going to be included into a one device program which will be compiled later by a device compiler - and this might cause errors because apparently device doesn't have to support all sub-group sizes listed in here and it is legal to fail compilation if requested sub-group size is not supported.

Probably it is a bug in our implementation, that build_with_kernel_type actually performs build of all kernels instead of just one, but I don't know SYCL spec so good to say for sure.

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 remembered there's a ticket created by Evgeniy describing the issue of building all kernels.

bader
bader previously approved these changes Aug 24, 2019
@bader
Copy link
Contributor

bader commented Aug 28, 2019

@tianshilei1992, could you take a look at failing lit tests, please?

@shiltian
Copy link
Contributor Author

@tianshilei1992, could you take a look at failing lit tests, please?

Sorry for not solving it. I’ll do it in this week.

keryell
keryell previously approved these changes Aug 30, 2019
Copy link
Contributor

@keryell keryell left a comment

Choose a reason for hiding this comment

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

Since it is just a unit test, it does not worth over engineering it.

cl::sycl::program Prog(Queue.get_context());

// Store the `cl::sycl::kernel` into a vector because `cl::sycl::kernel`
// doesn't have default constructor
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for the comment.
It is not clear what you are trying to do here...

throw feature_not_supported("sub-group size is not supported");
}

auto Kernel = TheKernel[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

I see... You are emulating a C++17 std::optional since you are in C++11... :-(
On the other hand you could make a specification proposal to add a default constructor to a cl::sycl::kernel and a member function to test if the kernel is valid... :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure whether it makes sense to request it. :)

@shiltian
Copy link
Contributor Author

Since it is just a unit test, it does not worth over engineering it.

Well, mainly working on fixing an issue that could only be reproduced on GPU. But I don't have GPU system on my hand. Waiting for it. :)

@shiltian
Copy link
Contributor Author

Report the issue at #640.

@shiltian
Copy link
Contributor Author

I disabled the test on GPU intentionally as it fails because all kernels are actually built when calling building function to just one kernel.

SYCL exception caught: Program build error:
The program was built for 1 devices
Build program log for 'Intel(R) Gen9 HD Graphics NEO':

error: Unsupported required sub group size
error: backend compiler failed build.
 0 (CL_SUCCESS)%

Copy link
Contributor

@bader bader left a comment

Choose a reason for hiding this comment

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

AFAIK, Intel GPUs support only 8, 16 or 32 sub-group sizes.

@bader bader requested a review from AlexeySachkov September 18, 2019 13:03
@bader bader merged commit 863e808 into intel:sycl Sep 19, 2019
@shiltian shiltian deleted the sg_attributes branch September 19, 2019 15:38
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.

5 participants