Skip to content

[SYCL][LIT] Mark spec const LIT as pass #1875

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

Conversation

bjoernknafla
Copy link
Contributor

The spec_const LIT tests start to pass for Intel CPU and GPU devices
with the Intel OpenCL GPU driver 20.19.16754.

Fixes #1873

Signed-off-by: Bjoern Knafla [email protected]

bader
bader previously approved these changes Jun 11, 2020
@bjoernknafla
Copy link
Contributor Author

bjoernknafla commented Jun 11, 2020

Exactly the two spec const LIT tests that start passing locally for OpenCL CPU and GPU are failing on the buildbots. Weird.

Both tests failled on the ACC.

@bjoernknafla
Copy link
Contributor Author

Interesting that this passes for Windows but not for Linux.

@@ -5,7 +5,7 @@
// RUN: %ACC_RUN_PLACEHOLDER %t.out
// TODO: re-enable after CI drivers are updated to newer which support spec
// constants:
// XFAIL: linux && opencl
// XFAIL: linux && opencl && !gpu && !cpu
Copy link
Contributor

Choose a reason for hiding this comment

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

Another idea:

Suggested change
// XFAIL: linux && opencl && !gpu && !cpu
// XFAIL: linux && opencl && accelerator

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will make the test fail as expected though we do not get test coverage if it actually passes for CPU and GPU.

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 wonder if to duplicate the test to make an accelerator-specific version with an XFAIL in it?

@bjoernknafla
Copy link
Contributor Author

I guess the problem is that for OpenCL the test find cpu, gpu, and acceleator. Therefore the expression

// XFAIL: linux && opencl && !gpu && !cpu

evaluates as // XFAIL: false and (as both !gpu and !cpu are false) and therefore the test fails when the accelerator is not passing.

We could change the test to

// XFAIL: linux && opencl && accelerator

but then we do not see if it passes as we want for the CPU and GPU.

v-klochkov
v-klochkov previously approved these changes Jun 11, 2020
@v-klochkov
Copy link
Contributor

@againull Do you have a good advise for this situation? 2 tests fail on linux+opencl+accelerator only.

@v-klochkov
Copy link
Contributor

v-klochkov commented Jun 12, 2020

Artur (@againull) recommended trying '// XFAIL: linux && opencl && accelerator'.

@bader
Copy link
Contributor

bader commented Jun 15, 2020

@v-klochkov, @againull, I think you are missing the point @bjoernknafla is trying to make.

// XFAIL: linux && opencl && accelerator can be interpreted as "expect fails if we run on Linux system with OpenCL ACCELERATOR device type". This is not very useful because if we have other device types available and test fails there, it won't be considered as a failure.

We need more flexible/configurable testing system, but I think it will require significant changes.
Meanwhile there are a few options how we can fix this test, but it will make testing approach inconsistent. Moving the check on accelerator device type is one option. Another option is just disable accelerator check in existing test source and remove XFAIL. Third, add new lit variable expecting to fail particular run e.g. %NOT_ACC_RUN_PLACEHOLDER == not %ACC_RUN_PLACEHOLDER.

@bjoernknafla
Copy link
Contributor Author

bjoernknafla commented Jun 15, 2020

What about this: we add extra test files named ..._accelerator.cpp. All these files do is:

  • Add XFAIL: accelerator
  • Include the assocaited cpp test file.

A bit unorthodox but prevents code duplication and makes it easy to move back to a single file later on. Gives us time until we rework the testing approach.

@v-klochkov
Copy link
Contributor

What about this: we add extra test files named ..._accelerator.cpp. All these files do is:

  • Add XFAIL: accelerator
  • Include the assocaited cpp test file.

A bit unorthodox but prevents code duplication and makes it easy to move back to a single file later on. Gives us time until we rework the testing approach.

This approach looks the easiest and clear to me. I vote for it.
Alexey's third idea is interesting, but I not fully understand the implementation details and don't know how common the problem that is fixed in this PR is. If it happen to be met often, we can add a variable later.

@bjoernknafla bjoernknafla dismissed stale reviews from v-klochkov and bader via 514519c July 21, 2020 16:13
@bjoernknafla bjoernknafla force-pushed the bjoern/mark-lit-spec-const-opencl-as-pass branch from 86f748e to 514519c Compare July 21, 2020 16:13
@bjoernknafla
Copy link
Contributor Author

Sorry that it took me so long to come back to this. I have put the discussed changes in place to:

  • XFAIL for accelerators
  • Catch regressions for OpenCL CPU and GPU devices.

@bjoernknafla
Copy link
Contributor Author

Interesting, seems that clang-format testing can fail for LIT tests. Changing the formatting.

The spec_const LIT tests start to pass for Intel CPU and GPU devices
with the Intel OpenCL GPU driver 20.19.16754.

Duplicate the test for accelerators, e.g., FPGA, and only fail it for
these.

As a result regressions are now caught for OpenCL CPU and GPU devices.

Fixes #1873

Signed-off-by: Bjoern Knafla <[email protected]>
@bjoernknafla bjoernknafla force-pushed the bjoern/mark-lit-spec-const-opencl-as-pass branch from 514519c to b9b7e4d Compare July 21, 2020 16:19
@bader
Copy link
Contributor

bader commented Jul 21, 2020

Thanks!

@bader bader requested a review from v-klochkov July 21, 2020 18:11
@bader bader merged commit 400e1e6 into intel:sycl Jul 22, 2020
@bjoernknafla bjoernknafla deleted the bjoern/mark-lit-spec-const-opencl-as-pass branch July 22, 2020 08:20
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.

LIT XFAIL spec_const tests passing with Intel OpenCL GPU 20.19.16754
3 participants