-
Notifications
You must be signed in to change notification settings - Fork 795
[CI] Introduce SPIR-V Backend support in LIT config #16600
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
[CI] Introduce SPIR-V Backend support in LIT config #16600
Conversation
|
It was agreed that we split #16317 into three parts:
|
sycl/test-e2e/format.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the main problem is our choice for the %{sycl_triple} substitution. If it included the entire option and not its value only, we could have extended that, and it would make the most sense. IIUC, spirv-backend option is only needed when we use -fsycl-targets=spir*[,.*]*. As such, fixing that might be the right way to implement this PR.
@sarnex , @steffenlarsen , @AlexeySachkov , WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexeySachkov , WDYT?
Do we have a test which needs %{sycl_triple} for something other than -fsycl-targets? If not, then I fully support replacing it with something like %{fsycl-targets} which will simplify passing extra arguments which are unique to specific targets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple},spir64 -o %t1.out %s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think that its a good idea to have a higher-level substitution, even if some tests won't be using it (I assume that there are just a small fraction of tests which pass triple explicitly because they want to test something specific).
And we can decide on a case-by-case basis if any of those remaining tests needs to be specialized to run with SPIR-V backend.
I also wouldn't block the PR on this refactoring: considering that passing -fsycl-use-spirv-backend-for-spirv-gen won't do anything for non-SPIRV targets the refactoring seems to be unrelated to this and the code doesn't look that bad to me in its current form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry is the idea here to make sycl_triple be -fsycl-targets=whatever,whatever instead of whatever,whatever and if this feature is enabled we just append the option to sycl_triple? if so sounds good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it "won't do anything", just pass it inside %clangxx. That would make it working for tests that don't use %{build}.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic of the change is that %{build} means now two different things, either "build with support of SPIR-V Backend" or "build", whereas previously it meant just "build". It's implemented by modifying %{build} contents depending on the use case.
I has no personal preference as for the way of how to implement this. We need to pass -fsycl-use-spirv-backend-for-spirv-gen parameter as the part of %{build} when "spirv-backend" is in test.config.available_features, that's all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic of the change is that %{build} means now two different things
I'm not sure what you mean, but it doesn't sound right to me.
We need to pass -fsycl-use-spirv-backend-for-spirv-gen parameter as the part of %{build} when "spirv-backend" is in test.config.available_features, that's all.
I don't agree with this either. IMO, we need to pass the option anytime we're compiling for spirv triple, and %{build} is definitely the wrong place to do that.
sarnex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont have strong enough of an opinion to hold up the PR on the sycl_targets thing, but probably andrei should state his opinion before merging
sycl/test-e2e/README.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| It's possible to use the LLVM SPIR-V Backend instead of llvm-spirv tool to | |
| It's possible to use the LLVM SPIR-V Backend instead of the `llvm-spirv` tool to |
919f209 to
8c98af4
Compare
Co-authored-by: aelovikov-intel <[email protected]>
|
I rebased the PR to #16614 and aligned with refactoring of the %{sycl_target_opts} substitution. |
steffenlarsen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
We introduce here SPIR-V Backend support in LIT config by adding a new LIT feature 'spirv-backend', and in a way that substitutions in end-to-end tests are aware about the new LIT feature.