Skip to content

libomptarget tests #368

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

Open
Meinersbur opened this issue Dec 8, 2021 · 7 comments
Open

libomptarget tests #368

Meinersbur opened this issue Dec 8, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@Meinersbur
Copy link

Meinersbur commented Dec 8, 2021

Could we add libomptarget tests to the pre-merge checks? This would consist of 3 parts:

  1. Compile libomptarget and plugins
  2. Run host-offloading regression tests (use the CPU as offloading-target)
  3. Run device-offloading tests (CUDA and/or AMD)

Compiling libomptarget has some additional dependencies: libelf-dev, libffi-dev, gcc-multilib (Ubuntu/Debian package names) and the CUDA toolkit for device offloading. Could those be installed on the workers? Currently building libomptarget plugins are skipped by the pre-merge check workers with this cmake messages:

-- Could NOT find LIBOMPTARGET_DEP_LIBELF (missing: LIBOMPTARGET_DEP_LIBELF_LIBRARIES LIBOMPTARGET_DEP_LIBELF_INCLUDE_DIRS) 
-- Found LIBOMPTARGET_DEP_LIBFFI: /usr/lib/x86_64-linux-gnu/libffi.so  
-- Could NOT find LIBOMPTARGET_DEP_CUDA_DRIVER (missing: LIBOMPTARGET_DEP_CUDA_DRIVER_LIBRARIES) 
-- LIBOMPTARGET: Building offloading runtime library libomptarget.
-- LIBOMPTARGET: Not building AMDGPU plugin: LIBELF not found
-- LIBOMPTARGET: Not building CUDA offloading plugin: libelf dependency not found.
-- LIBOMPTARGET: Not building x86_64 offloading plugin: libelf dependency not found.

Once these dependencies are available, check-openmp should run the host-offloading regression tests. libomp(target) regressions tests are end-to-end tests that execute the compiled code. For device-offloading, it obviously need actual hardware (either NVIDIA or AMD) in the worker. @jdoerfert mentioned the LLVM project has GCE cloud credits we might be able to use for that, but even only running host-offloading tests would be helpful.

@Meinersbur Meinersbur added the bug Something isn't working label Dec 8, 2021
@metaflow metaflow self-assigned this Dec 9, 2021
@metaflow
Copy link
Collaborator

metaflow commented Dec 9, 2021

I am planning to add this deps to agents. hat I see now (locally) with new deps:

-- LIBOMPTARGET: Building offloading runtime library libomptarget.
-- LIBOMPTARGET: Not building aarch64 offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Building AMDGPU plugin for dlopened libhsa
-- LIBOMPTARGET: Not generating amdgcn test targets as amdgpu-arch is not found
-- LIBOMPTARGET: Building CUDA offloading plugin.
-- LIBOMPTARGET: Building CUDA plugin for dlopened libcuda
-- LIBOMPTARGET: Disabling tests using CUDA plugin as cuda may not be available
-- LIBOMPTARGET: Not building PPC64 offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Not building PPC64le offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Not building nec-aurora plugin: libveo or libveosinfo not found.
-- LIBOMPTARGET: Building x86_64 offloading plugin.
-- LIBOMPTARGET: Building AMDGCN device RTL. Using clang from in-tree build
-- LIBOMPTARGET: Building CUDA LLVM bitcode offloading device RTL using in-tree clang.
-- LIBOMPTARGET: Building DeviceRTL. Using clang from in-tree build
-- LIBOMPTARGET: Building the llvm-omp-device-info tool

Running ninja check-openmp fails 13 tests as "./bin/not" not found (I guess it should be in deps somewhere).
Running after ninja not passes 379 tests for me.

@Meinersbur does this look good to you?

@Meinersbur
Copy link
Author

Meinersbur commented Dec 9, 2021

The cmake output looks as expected (with no CUDA toolkit or ROCm installed), thanks. Is openmp configured with LLVM_ENABLE_PROJECTS=openmp or LLVM_ENABLE_RUNTIMES=openmp (both should work).

I'll have a look at the not dependency. Should be part of the normal test dependency, and I have not encountered it with my buildbots (eg. http://meinersbur.de:8011/#/builders/11)

@Meinersbur
Copy link
Author

not fix here: https://reviews.llvm.org/D115454

@metaflow
Copy link
Collaborator

I have build an image and run tests on "clang;openmp" . Current setup :
https://buildkite.com/llvm-project/llvm-main/builds/3881#96d288c5-b132-4b45-9fa4-aecac023e845

  | Skipped          :    11
  | Unsupported      :    75
  | Passed           : 29431
  | Expectedly Failed:    29

new:
https://buildkite.com/llvm-project/llvm-main/builds/3880#e497f1f2-b098-48ac-8abf-cfe55d44760b

Skipped          :    11
  | Unsupported      :    75
  | Passed           : 29431
  | Expectedly Failed:    29

so I don't see any new test, guess we do care about compiling the offloading targets.

I have also updated toolchain in image to 13.
Will update all agents today.

@metaflow
Copy link
Collaborator

@Meinersbur please tell if you need anything else. E.g. help with setup new agents with GPU

Meinersbur added a commit to llvm/llvm-project that referenced this issue Dec 12, 2021
The `not` program is used to test executions prefixed with `%libomptarget-run-fail-`. Currently `not` is not used for libomp tests, but might be used in the future and its dependency does not add any additional burden over the already established `FileCheck` dependency.

Required to add libomptarget testing to the Phabricator pre-merge check (see google/llvm-premerge-checks#368)

Reviewed By: jdenny, JonChesterfield

Differential Revision: https://reviews.llvm.org/D115454
@Meinersbur
Copy link
Author

Meinersbur commented Dec 16, 2021

I see new tests in the log file, e.g. PASS: libomptarget :: x86_64-pc-linux-gnu :: mapping/target_implicit_partial_map.c (364 of 401) that are not in the "current setup" configuration. I think you only looked at the summary report for check-clang ("Running the Clang regression tests"), but check-openmp has its own summary report:

Old:

Testing Time: 28.36s
  Unsupported:  33
  Passed     : 284

New:

Testing Time: 33.86s
  Unsupported:  50
  Passed     : 351

I think instead of ninja check-clang check-openmp, running ninja check gives just one summary report.

@Meinersbur
Copy link
Author

@Meinersbur please tell if you need anything else. E.g. help with setup new agents with GPU

Running GPU tests with an actual GPU would be nice, if feasible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants