Skip to content

[CI] Add libclc tests to pre- and post-commit validation #5062

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
Dec 2, 2021

Conversation

jchlanda
Copy link
Contributor

@jchlanda jchlanda commented Dec 1, 2021

Run check-libclc as part of continues integration system. Time-wise it shouldn't be noticeable, on an mi100 node it takes ~3.5sec.

Also adjust XFAILs.

@jchlanda jchlanda requested review from bader and a team as code owners December 1, 2021 10:09
@@ -60,7 +60,7 @@ add_lit_testsuite(check-sycl-spirv "Running device-agnostic SYCL regression test
)

add_custom_target(check-sycl)
add_dependencies(check-sycl check-sycl-spirv)
add_dependencies(check-sycl check-sycl-spirv check-libclc)
Copy link
Contributor

@bader bader Dec 1, 2021

Choose a reason for hiding this comment

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

I'm not sure if it works. libclc is not enabled by default (only with CUDA/HIP back-ends), so I assume there might be problems if this library is not built. Right?

I suggest adding a separate command to this GitHub Actions script: https://github.com/intel/llvm/blob/sycl/.github/workflows/sycl_linux_build_and_test.yml#L136.
@alexbatashev can help with that.

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 are right: https://github.com/jchlanda/llvm/blob/jakub/check_sycl_check_libclc/buildbot/configure.py#L62
Do you think it's worth adding it to the list of llvm_enabled_projects by default?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, it's a dead code by default, but it must be enabled in pre-/post-commit CI validation.
It might be worth adding when CUDA or HIP backends included to the build, but I'd like to avoid the drawback mentioned in the description:

The only slight drawback is that if check-libclc fails it will not proceed to running check-sycl.

To avoid this, we can run check-libclc separately from check-sycl as we do for the compiler (i.e. check-clang).
If we need simplify the workflow for DPC++ compiler developers we can make check-sycl-toolchain CMake target with dependencies on check-* testing the compiler, runtime and other DPC++ components, which can be executed concurrently and do not block each other. Python script instead of cmake target works as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jchlanda Alexey is right, you don't need to add dependencies to the check-sycl. Please, adjust configure.py call here and just add a new step for the build job as @bader described earlier. All the logs will be public, both pre-commit and post-commit testing will be enabled, and you'll be able to modify the run command as you see fit.

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've folded it into: b8f99bc
It'll build libclc in ci_default mode and run it through linux build and test. I've decided against adding another target.

@jchlanda jchlanda force-pushed the jakub/check_sycl_check_libclc branch from 8375d1e to b7d0206 Compare December 2, 2021 08:46
Copy link
Contributor

@alexbatashev alexbatashev left a comment

Choose a reason for hiding this comment

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

LGTM

@alexbatashev
Copy link
Contributor

alexbatashev commented Dec 2, 2021

@jchlanda do these logs look right to you?
https://github.com/intel/llvm/runs/4392597907?check_suite_focus=true
image

UPD. I guess since no targets were requested, no tests were run (-DLIBCLC_TARGETS_TO_BUILD= in the logs).

@jchlanda
Copy link
Contributor Author

jchlanda commented Dec 2, 2021

@jchlanda jchlanda closed this Dec 2, 2021
@jchlanda jchlanda reopened this Dec 2, 2021
@jchlanda
Copy link
Contributor Author

jchlanda commented Dec 2, 2021

@jchlanda do these logs look right to you? https://github.com/intel/llvm/runs/4392597907?check_suite_focus=true image

UPD. I guess since no targets were requested, no tests were run (-DLIBCLC_TARGETS_TO_BUILD= in the logs).

Yeah, that's exactly it, it was enabled but, like you say, no libclc targets were selected: https://github.com/intel/llvm/runs/4392597907?check_suite_focus=true#step:5:605
I'm not sure what the best way to handle it would be. Is there a safe libclc target that can be enabled by default on the CI machines?

@bader bader changed the title [SYCL] Add check-libclc to check-sycl [CI] Add libclc tests to pre- and post-commit validation Dec 2, 2021
@bader bader merged commit 318f2ed into intel:sycl Dec 2, 2021
@bader
Copy link
Contributor

bader commented Dec 2, 2021

@jchlanda, @alexbatashev, sorry, I forgot that this comment is not addressed yet:

I guess since no targets were requested, no tests were run (-DLIBCLC_TARGETS_TO_BUILD= in the logs).

So, check-libclc is executed by CI, but it does nothing today. We need another change to make this step useful. :)

@jchlanda
Copy link
Contributor Author

jchlanda commented Dec 2, 2021

yeap, but I don't know if there is a default libclc target that CI machines should be building?

@bader
Copy link
Contributor

bader commented Dec 2, 2021

yeap, but I don't know if there is a default libclc target that CI machines should be building?

I assume you wanted to test libclc for nvptx and amdgcn targets. So, I suppose corresponding triples can be set in the python script. Right? Enabling these in CI doesn't seem to require specific HW and can executed. @alexbatashev, what do you think about this? AFIAK, other targets are not used in our project.
https://github.com/intel/llvm/blob/sycl/buildbot/configure.py#L70
https://github.com/intel/llvm/blob/sycl/buildbot/configure.py#L77

@jchlanda
Copy link
Contributor Author

jchlanda commented Dec 2, 2021

yeap, but I don't know if there is a default libclc target that CI machines should be building?

I assume you wanted to test libclc for nvptx and amdgcn targets. So, I suppose corresponding triples can be set in the python script. Right? Enabling these in CI doesn't seem to require specific HW and can executed. @alexbatashev, what do you think about this? AFIAK, other targets are not used in our project. https://github.com/intel/llvm/blob/sycl/buildbot/configure.py#L70 https://github.com/intel/llvm/blob/sycl/buildbot/configure.py#L77

Out of the box check-libclc will complain about the device libraries, I've just tried amdgcn--;amdgcn--amdhsa on my dev machine, that has no ROCm installed and it fails with:

clang-14: error: cannot find ROCm device library; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library

@bader
Copy link
Contributor

bader commented Dec 3, 2021

Do we need ROCm device library to run libclc tests? I see that test just emit LLVM.

@jchlanda
Copy link
Contributor Author

jchlanda commented Dec 6, 2021

Do we need ROCm device library to run libclc tests? I see that test just emit LLVM.

I've addressed it in: #5091

bader pushed a commit that referenced this pull request Dec 6, 2021
Follow up to #5062

This PR ensures that `libclc` is built and tested against:
*  `amdgcn--;amdgcn--amdhsa`
* `nvptx64--;nvptx64--nvidiacl`
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.

3 participants