Build CPU + Thrust + OMP-offload from a single install when NVHPC is present - #11
Closed
hfwen0502 wants to merge 1 commit into
Closed
Build CPU + Thrust + OMP-offload from a single install when NVHPC is present#11hfwen0502 wants to merge 1 commit into
hfwen0502 wants to merge 1 commit into
Conversation
…s present Previously auto built only CPU + Thrust, and the OMP-offload backend had to be installed alone in a separate venv on the assumption it conflicted on the OpenMP runtime. On a GPU box all three extensions compile with nvc++ and link the same runtime (libnvomp), so they co-load in one process (available_backends() -> ['cpu', 'gpu', 'gpu-omp'], all agree bit-for-bit). setup.py: - auto: build CPU + Thrust + OMP-offload when NVHPC is present; CPU only (g++/clang) otherwise. - add SBD_BUILD_BACKEND=all (builds all three; errors without NVHPC). - when CPU is built alongside any GPU backend, route the whole build through nvc++ up front so the CPU extension also links libnvomp. - macOS (clang) and Linux-without-NVHPC (g++) paths unchanged. README: rewrite the install section for the single-venv unified build and correct the backend co-load description.
Collaborator
Author
|
the solution provided is wrong. Not valid. still need to separate out the runtime between omp offload and cpu/thrust. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Previously
SBD_BUILD_BACKEND=autobuilt only CPU + Thrust, and the OpenMP target-offload backend (_core_gpu_omp_offload) had to be installed by itself in a separate venv, on the assumption it would conflict on the OpenMP runtime with the other backends.That assumption no longer holds. On a GPU box all three extensions compile with NVHPC
nvc++and therefore link the same OpenMP runtime (libnvomp) — CPU via-fopenmp(nvc++ treats it as-mp), Thrust via-mp -cuda, offload via-mp=gpu. They co-load in one process without conflict, so a singlepip installcan now provide all three.Changes
setup.pyauto: build CPU + Thrust + OMP-offload when NVHPC is present; CPU only (g++/clang) when it is not.SBD_BUILD_BACKEND=all(builds all three; errors if nvc++ is missing).libnvomp.README.mdpip install).SBD_BUILD_BACKENDtable (auto/all) and correct the backend co-load description and verify output.Testing
Submodule pinned at the current
vendor/sbd-upstream(21f73b4); no submodule change in this PR.autobuilds_core_cpu+_core_gpu_thrust+_core_gpu_omp_offload_core_cpuavailable_backends()['cpu', 'gpu', 'gpu-omp'](one process)['cpu']-76.2359465468— all three backends agree bit-for-bit-76.2359466293(within 1e-4 Davidson tol)On the GPU box the full SQD loop also runs end-to-end and converges.