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

Add support for SimSYCL as a SYCL implementation #871

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

Conversation

fknorr
Copy link
Contributor

@fknorr fknorr commented Feb 17, 2024

This adds SimSYCL as a supported SYCL implementation, complete with CMake integration and an exclude-list for the "fast" conformance build.

This should be merged after #870 #872 and #873, because the CTS it will not actually compile for many of the non-excluded cases unless those bugs are addressed.

@fknorr fknorr requested a review from a team as a code owner February 17, 2024 17:59
if (NOT ${SYCL_IMPLEMENTATION} IN_LIST KNOWN_SYCL_IMPLEMENTATIONS)
message(FATAL_ERROR
"The SYCL CTS requires specifying a SYCL implementation with "
"-DSYCL_IMPLEMENTATION=[Intel_SYCL,DPCPP;hipSYCL]")
"-DSYCL_IMPLEMENTATION=[Intel_SYCL,DPCPP;hipSYCL;SimSYCL]")
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should just put KNOWN_SYCL_IMPLEMENTATIONS directly into the message instead of modifying it every time we change list of known implementations?

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps CTS_GRADE_SYCL_IMPLEMENTATION or something better, because we know quite many other implementations. :-)

Comment on lines 77 to 79
#if SYCL_CTS_COMPILING_WITH_SIMSYCL
SKIP("SimSYCL does not implement asynchronous execution.");
#endif
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 that from the conformance point of view the better to use DISABLED_FOR_TEST_CASE macro so the test appears as failed.

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'm not sure this is even non-conformant. IIRC an implementation only needs to guarantee forward progress on an event when wait is called on it, which does not happen in any of these test cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this test requires a guarantee of forward progress, does it? It seems like it is just calling event::get_wait_list and making sure the list contains the direct dependencies of a pending command. There is no expectation that the command has completed when get_wait_list is called.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, I don't understand why SimSYCL couldn't implement these features.

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're right, I read this code the wrong way! It needs the host task to launch asynchronously in the background at least once wait() is called, and then start running once the delayed_host_event is signalled. SimSYCL is fully synchronous and does not overlap command groups with the main thread, so the host task unconditionally deadlocks. This will probably never work. I changed the SKIP to FAIL to account for this.

tests/usm/CMakeLists.txt Outdated Show resolved Hide resolved
@psalz
Copy link
Contributor

psalz commented Feb 21, 2024

Please also document SimSYCL in README.md and docs/README.adoc!

cmake/AdaptSimSYCL.cmake Outdated Show resolved Hide resolved
@psalz
Copy link
Contributor

psalz commented Feb 21, 2024

Ideally we should also include SimSYCL in our CI setup. I think it should be relatively straightforward to add, analogously to hipSYCL/AdaptiveCpp.

@keryell
Copy link
Member

keryell commented Sep 10, 2024

How do we move on this?

@fknorr
Copy link
Contributor Author

fknorr commented Dec 18, 2024

Rebased onto #1011 and #874 and #872 , and now mentions SimSYCL in docs.

@fknorr fknorr force-pushed the build-with-simsycl branch from 3c601ad to 28402a6 Compare December 28, 2024 12:14
@fknorr fknorr force-pushed the build-with-simsycl branch from 28402a6 to 47b7b26 Compare January 8, 2025 11:26
@fknorr
Copy link
Contributor Author

fknorr commented Jan 8, 2025

I've added a CI step for a SimSYCL build, but creating the docker image needs some secrets. Not sure how to proceed on this.

@psalz
Copy link
Contributor

psalz commented Jan 8, 2025

I've added a CI step for a SimSYCL build, but creating the docker image needs some secrets. Not sure how to proceed on this.

I've launched a manual run to create the image here. It went through, but it looks like there's some issue while building the CTS itself!

@fknorr
Copy link
Contributor Author

fknorr commented Jan 8, 2025

Thanks, it's building now!

Copy link
Member

@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.

That looks good after merge conflict resolution.

@fknorr fknorr force-pushed the build-with-simsycl branch 2 times, most recently from acfbda6 to 613b97d Compare January 23, 2025 07:53
@tomdeakin
Copy link
Contributor

The WG discussed this today - can you resolve the CI failure please. Thanks!

@bader
Copy link
Contributor

bader commented Jan 23, 2025

@fknorr, you need fix the compilation by updating SYCL_LANGUAGE_VERSION in SimSYCL implementation. We recently updated the test to verify the version value - #989.

@fknorr fknorr force-pushed the build-with-simsycl branch from 613b97d to 07edd6c Compare January 23, 2025 17:12
@fknorr
Copy link
Contributor Author

fknorr commented Jan 23, 2025

@bader I've turned these into runtime checks (2cf5cc4) so we don't need to re-build containers for now. I don't feel like the checks actually benefitted from being static assertions, please correct me if I'm wrong!

@AlexeySachkov I've drive-by fixed two inconsistencies (3dc17f6, 110c739) that caused a lot of warnings with GCC.

@bader
Copy link
Contributor

bader commented Jan 23, 2025

@bader I've turned these into runtime checks (2cf5cc4) so we don't need to re-build containers for now. I don't feel like the checks actually benefitted from being static assertions, please correct me if I'm wrong!

Usually, the earlier you detect the problem the better. I.e. compile-time checks usually preferred over the run-time checks. I suggest we keep the check compile time but disable it for SimSYCL implementation. We should enable the check for SimSYCL with the implementation update. Does it sound okay to you?

@fknorr
Copy link
Contributor Author

fknorr commented Jan 23, 2025

@tomdeakin Note that this PR is based on #1011, so we need to figure out what the correct behavior is supposed to be and implement it in SimSYCL before this PR can proceed (at least with the current filter list).

@bader Since we need to update SimSYCL ^ now anyway I'm going to implement the new behavior and drop that commit.

@AlexeySachkov
Copy link
Contributor

@bader I've turned these into runtime checks (2cf5cc4) so we don't need to re-build containers for now. I don't feel like the checks actually benefitted from being static assertions, please correct me if I'm wrong!

See also discussion here. What we can do is switch catch2 static assertions to be runtime-only for the purpose of pre-commit in this repo, but leave them as static assertion in every other configuration (i.e. certification run and local development).

@AlexeySachkov I've drive-by fixed two inconsistencies (3dc17f6, 110c739) that caused a lot of warnings with GCC.

Thanks, warnings cleanup is always appreciated!

@bader
Copy link
Contributor

bader commented Jan 24, 2025

What we can do is switch catch2 static assertions to be runtime-only for the purpose of pre-commit in this repo, but leave them as static assertion in every other configuration (i.e. certification run and local development).

I don't think this is a good idea. Technically, you suggest disabling all "static assertions" checks in pre-commit as CI do not run compiled tests (i.e. there is no run-time). Disabling either the compilation of the whole test via CMake filters or specific test cases via macro is preferable as it provides fine-grain control over tested functionality.

@fknorr fknorr force-pushed the build-with-simsycl branch from 07edd6c to 00c3a37 Compare January 24, 2025 18:18
Comment on lines +71 to +72
CHECK(std::is_same_v<decltype(SYCL_LANGUAGE_VERSION), long>);
CHECK(SYCL_LANGUAGE_VERSION == 202012L);
Copy link
Contributor

Choose a reason for hiding this comment

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

@fknorr, please, revert this change.
You can disable these checks for SimSYCL if needed.

@bader bader requested review from AlexeySachkov and psalz January 24, 2025 22:54
Copy link
Contributor

@psalz psalz left a comment

Choose a reason for hiding this comment

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

LGTM! There are still quite a lot compiler warnings left, but it looks to me like most/all of those are legitimate issues with the CTS, and not SimSYCL's fault. We'll have to look into these separately I guess.

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.

8 participants