Skip to content

[SPIR-V] Cherry-pick of "Add SPIR-V 1.4 checks" #7493

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 2 commits into from
Feb 22, 2023

Conversation

MrSidims
Copy link
Contributor

One of the patches missing in intel/llvm

Signed-off-by: Sidorov, Dmitry dmitry.sidorov@intel.com

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@c5b3c8e3283b

Second attempt

@MrSidims MrSidims marked this pull request as ready for review November 22, 2022 18:14
@MrSidims MrSidims requested a review from a team as a code owner November 22, 2022 18:14
@MrSidims
Copy link
Contributor Author

/verify

@MrSidims
Copy link
Contributor Author

/summary:run

@MrSidims MrSidims marked this pull request as draft November 22, 2022 18:32
@MrSidims MrSidims changed the title Cherry-pick of "Add SPIR-V 1.4 checks" [DO NOT MERGE] Cherry-pick of "Add SPIR-V 1.4 checks" Nov 22, 2022
@MrSidims
Copy link
Contributor Author

trying to trigger windows testing

@MrSidims
Copy link
Contributor Author

/verify with intel/llvm-test-suite#1414

@MrSidims MrSidims marked this pull request as ready for review December 30, 2022 10:41
@MrSidims
Copy link
Contributor Author

/verify with intel/llvm-test-suite#1414

@MrSidims
Copy link
Contributor Author

/start Windows testing

@MrSidims MrSidims force-pushed the cherry-pick-add14-no2 branch from 44de063 to 0c17303 Compare December 30, 2022 10:45
@MrSidims
Copy link
Contributor Author

/start Windows testing

@MrSidims MrSidims changed the title [DO NOT MERGE] Cherry-pick of "Add SPIR-V 1.4 checks" [SPIR-V] Cherry-pick of "Add SPIR-V 1.4 checks" Dec 30, 2022
@MrSidims MrSidims temporarily deployed to aws December 30, 2022 11:09 — with GitHub Actions Inactive
@MrSidims MrSidims temporarily deployed to aws December 30, 2022 11:39 — with GitHub Actions Inactive
@MrSidims
Copy link
Contributor Author

/start Windows testing

@MrSidims
Copy link
Contributor Author

/verify with intel/llvm-test-suite#1477

@MrSidims
Copy link
Contributor Author

MrSidims commented Jan 2, 2023

/testwin

@MrSidims
Copy link
Contributor Author

MrSidims commented Jan 3, 2023

/verify with intel/llvm-test-suite#1479

@MrSidims
Copy link
Contributor Author

MrSidims commented Jan 3, 2023

select_device.cpp is unrelated test failure, reported internally
level_zero_batch_barrier.cpp is unrelated test failure, that is being fixed in intel/llvm-test-suite#1481

SubGroupMask/Basic.cpp on windows to investigate

Copy link
Contributor

@asudarsa asudarsa left a comment

Choose a reason for hiding this comment

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

LGTM overall. Just some nitpicks on some changes. But I suppose I am also not looking at the full commit here. Ok to merge. Thanks. And yes, sorry for delay in review.

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.

Please, resolve merge conflicts.

One of the patches missing in intel/llvm

Signed-off-by: Sidorov, Dmitry dmitry.sidorov@intel.com

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@c5b3c8e3283b

Second attempt
@MrSidims MrSidims force-pushed the cherry-pick-add14-no2 branch from 0c17303 to 082b2fe Compare February 6, 2023 12:13
@MrSidims
Copy link
Contributor Author

MrSidims commented Feb 6, 2023

/summary:run

@MrSidims MrSidims temporarily deployed to aws February 6, 2023 12:38 — with GitHub Actions Inactive
@MrSidims MrSidims temporarily deployed to aws February 6, 2023 13:10 — with GitHub Actions Inactive
@MrSidims MrSidims temporarily deployed to aws February 10, 2023 12:58 — with GitHub Actions Inactive
@MrSidims MrSidims temporarily deployed to aws February 10, 2023 13:15 — with GitHub Actions Inactive
@MrSidims MrSidims closed this Feb 10, 2023
@MrSidims MrSidims reopened this Feb 10, 2023
@MrSidims MrSidims temporarily deployed to aws February 10, 2023 13:47 — with GitHub Actions Inactive
@MrSidims MrSidims temporarily deployed to aws February 10, 2023 14:19 — with GitHub Actions Inactive
@MrSidims MrSidims marked this pull request as draft February 10, 2023 14:25
@MrSidims
Copy link
Contributor Author

Other issues are found - seems like CPU and GPU SPIR-V consumers restrict max to 1.2, but I'm not sure why. Also for some reasons it happens only for KernelFusion tests (only they use SPIR-V 1.4 functionality?). Need to have extra investigation. Converted to draft for now.

@MrSidims
Copy link
Contributor Author

MrSidims commented Feb 15, 2023

It seems like that before going to the device's driver, the code is being put to the translator one more (or two more?) time(s). And when it's done, --spirv-max-version is set to 1.2, while the module can already contain SPIR-V 1.4 features. @sommerlukas @Naghasan is my understanding correct? If so, can we change --spirv-max-version to 1.4 in whatever tool, that fusion uses? TBH I can't find in intel/llvm, where it's being set with an exception of clang driver, where it's set to 1.4 (unless we compile to HIP, where SPIR-V is 1.1).

@sommerlukas
Copy link
Contributor

It seems like that before going to the device's driver, the code is being but to the translator one more (or two more?) time(s). And when it's done, --spirv-max-version is set to 1.2, while the module can already contain SPIR-V 1.4 features. @sommerlukas @Naghasan is my understanding correct? If so, can we change --spirv-max-version to 1.4 in whatever tool, that fusion uses? TBH I can't find in intel/llvm, where it's being set with an exception of clang driver, where it's set to 1.4 (unless we compile to HIP, where SPIR-V is 1.1).

Hi @MrSidims,
the SPIR-V version for translation to/from SPIR-V for fusion is set here:
https://github.com/intel/llvm/blob/sycl/sycl-fusion/jit-compiler/lib/translation/SPIRVLLVMTranslation.cpp#L63

We initially chose 1.2 as the maximum value, as this is a safe default for OpenCL 2.2 devices.

You can remove setting the maximum version there, so kernel fusion would use the tool default.

@MrSidims
Copy link
Contributor Author

MrSidims commented Feb 15, 2023

@sommerlukas thanks! I've created #8358 . One of the biggest reasons to move to 1.4 is that partial unrolling started to be supported only in this version, and we would lack performance in some workloads if we wouldn't switch. Also our compiler implementation heavily relies on UserSemantic decoration, which is also added in 1.4. So while OpenCL 2.2 reasoning is legit, unfortunately we can't stick to it :( .

@sommerlukas
Copy link
Contributor

@MrSidims: Thanks for the explanation! From our side, 1.2 was only the initial choice, it should be fine to switch to 1.4.

@MrSidims MrSidims marked this pull request as ready for review February 20, 2023 12:00
@MrSidims
Copy link
Contributor Author

/summary:run

@MrSidims MrSidims temporarily deployed to aws February 21, 2023 06:06 — with GitHub Actions Inactive
@MrSidims MrSidims temporarily deployed to aws February 21, 2023 10:17 — with GitHub Actions Inactive
@MrSidims MrSidims requested a review from bader February 22, 2023 09:30
@MrSidims
Copy link
Contributor Author

Alexey's requested change was to merge sycl branch into this one
With the tests passing I believe the PR is good to go @intel/llvm-gatekeepers

@bader bader merged commit 812cd8a into intel:sycl Feb 22, 2023
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