Skip to content
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

ROCm packages: externals consistency #150

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,27 @@ packages:
prefix: /opt/rocm-5.4.3/
- spec: [email protected]
prefix: /opt/rocm-5.5.1/
hsakmt-roct:
buildable: false
externals:
- spec: [email protected]
prefix: /opt/rocm-5.4.3/
- spec: [email protected]
prefix: /opt/rocm-5.5.1/
roctracer-dev-api:
buildable: false
externals:
- spec: [email protected]
prefix: /opt/rocm-5.4.3/
- spec: [email protected]
prefix: /opt/rocm-5.5.1/
rocminfo:
buildable: false
externals:
- spec: [email protected]
prefix: /opt/rocm-5.4.3/
- spec: [email protected]
prefix: /opt/rocm-5.5.1/
llvm-amdgpu:
externals:
- spec: [email protected]
Expand Down
4 changes: 0 additions & 4 deletions experiments/gromacs/rocm/ramble.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ ramble:
environments:
gromacs:
packages:
- hip543
Copy link
Collaborator

Choose a reason for hiding this comment

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

This works for rocm/5.4.3. However, if I change the compiler to [email protected], the spack concretizer still uses v5.4.3 for some packages. Following is the concretizer output for [email protected]

==> Concretized [email protected]%[email protected]~double~hwloc+mpi+openmp+rocm+sycl amdgpu_target=gfx90a
 -   2fjfk3y  [email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~cp2k~cuda~cycle_subcounters~double+gmxapi~heffte~hwloc~intel-data-center-gpu-max~intel_provided_gcc~ipo~mdrun_only+mpi+nblib~nosuffix~opencl+openmp~plumed~relaxed_double_precision+rocm+shared+sycl amdgpu_target=gfx90a build_system=cmake build_type=Release generator=make openmp_max_threads=none arch=linux-rhel8-x86_64
[e]  jmwvqsy      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~doc+ncurses+ownlibs build_system=generic build_type=Release arch=linux-rhel8-x86_64
[e]  elntlub      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2'  build_system=cmake build_type=Release generator=make arch=linux-rhel8-x86_64
[e]  v42qoop      ^[email protected]%[email protected]~gtl+wrappers build_system=generic arch=linux-rhel8-x86_64
[e]  6nfuiwx      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~guile build_system=generic patches=ca60bd9,fe5b60d arch=linux-rhel8-x86_64
[e]  43ygv4w      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~cuda+rocm build_system=cmake build_type=Release generator=make patches=5068750,c2ee21c,ca523f1,ddd86f0 arch=linux-rhel8-x86_64
 -   uisys2n      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~cuda~ipo+rocm amdgpu_target=gfx90a build_system=cmake build_type=Release generator=make arch=linux-rhel8-x86_64
 -   rzxtvzu          ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~atomic~chrono~clanglibcpp~container+context~contract~coroutine~date_time~debug~exception+fiber+filesystem~graph~graph_parallel~icu~iostreams~json~locale~log~math~mpi+multithreaded~nowide~numpy~pic~program_options~python~random~regex~serialization+shared~signals~singlethreaded~stacktrace~system~taggedlayout~test~thread~timer~type_erasure~versionedlayout~wave build_system=generic context-impl=fcontext cxxstd=17 patches=3a83d90,5da7ad2,607b077 visibility=hidden arch=linux-rhel8-x86_64
[e]  goajfe5          ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' +bz2+crypt+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches=0d98e93,4c24573,ebdca64,f2fd060 arch=linux-rhel8-x86_64
[e]  qd5rbts      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~asan+image+shared build_system=cmake build_type=Release generator=make patches=9267179 arch=linux-rhel8-x86_64
[e]  3f7dz3g      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~asan+shared build_system=cmake build_type=Release generator=make patches=114b05a arch=linux-rhel8-x86_64
[e]  e4ljwkx      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~cluster+envmods~ilp64+shared build_system=generic mpi_family=none threads=none arch=linux-rhel8-x86_64
[e]  5554olq      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~link_llvm_dylib~llvm_dylib~openmp+rocm-device-libs build_system=cmake build_type=Release generator=ninja patches=a08bbe1 arch=linux-rhel8-x86_64
[e]  tsvmocc      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2'  build_system=cmake build_type=Release generator=make arch=linux-rhel8-x86_64
[e]  6bvget5      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2'  build_system=generic arch=linux-rhel8-x86_64

==> Concretized [email protected]%[email protected]+rocm
 -   uisys2n  [email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~cuda~ipo+rocm amdgpu_target=gfx90a build_system=cmake build_type=Release generator=make arch=linux-rhel8-x86_64
 -   rzxtvzu      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~atomic~chrono~clanglibcpp~container+context~contract~coroutine~date_time~debug~exception+fiber+filesystem~graph~graph_parallel~icu~iostreams~json~locale~log~math~mpi+multithreaded~nowide~numpy~pic~program_options~python~random~regex~serialization+shared~signals~singlethreaded~stacktrace~system~taggedlayout~test~thread~timer~type_erasure~versionedlayout~wave build_system=generic context-impl=fcontext cxxstd=17 patches=3a83d90,5da7ad2,607b077 visibility=hidden arch=linux-rhel8-x86_64
[e]  jmwvqsy      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~doc+ncurses+ownlibs build_system=generic build_type=Release arch=linux-rhel8-x86_64
[e]  6nfuiwx      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~guile build_system=generic patches=ca60bd9,fe5b60d arch=linux-rhel8-x86_64
[e]  43ygv4w      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~cuda+rocm build_system=cmake build_type=Release generator=make patches=5068750,c2ee21c,ca523f1,ddd86f0 arch=linux-rhel8-x86_64
[e]  qd5rbts      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~asan+image+shared build_system=cmake build_type=Release generator=make patches=9267179 arch=linux-rhel8-x86_64
[e]  5554olq      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~link_llvm_dylib~llvm_dylib~openmp+rocm-device-libs build_system=cmake build_type=Release generator=ninja patches=a08bbe1 arch=linux-rhel8-x86_64
[e]  goajfe5      ^[email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' +bz2+crypt+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches=0d98e93,4c24573,ebdca64,f2fd060 arch=linux-rhel8-x86_64

==> Concretized [email protected]
[e]  e4ljwkx  [email protected]%[email protected] cflags='-g -O2' cxxflags='-g -O2' ~cluster+envmods~ilp64+shared build_system=generic mpi_family=none threads=none arch=linux-rhel8-x86_64

Copy link
Collaborator Author

@scheibelp scheibelp Feb 28, 2024

Choose a reason for hiding this comment

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

Thanks: the components were synchronized with each other WRT version, but not with the compiler version. I added another constraint for that in 1f16b8b So when building with %[email protected], we will use ^[email protected].

I'll note that with this change specifically, Benchpark constraints for rocmcc/rocm-externals are now more strict than within the non-external Spack builtin case (there's nothing inherently wrong with that).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Would this still work for a non-rocmcc compiler, say cce?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes: this does not force the use of %rocmcc, it just makes sure that if you use %rocmcc, that the compiler version matches the component version.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The spack concretization works for consistently for both rocm 5.4 and 5.5

- hsa-rocr-dev543
- blas-rocm543
- lapack-rocm543
- mpi-rocm-no-gtl
- hipsycl
- fftw
Expand Down
3 changes: 2 additions & 1 deletion repo/gromacs/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
import llnl.util.filesystem as fs

from spack.package import *
from spack.pkg.benchpark.rocm_consistency import RocmConsistency as RocmConsistency


class Gromacs(CMakePackage, CudaPackage, ROCmPackage):
class Gromacs(CMakePackage, CudaPackage, ROCmPackage, RocmConsistency):
"""GROMACS is a molecular dynamics package primarily designed for simulations
of proteins, lipids and nucleic acids. It was originally developed in
the Biophysical Chemistry department of University of Groningen, and is now
Expand Down
37 changes: 37 additions & 0 deletions repo/rocm-consistency/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack.package import *
from spack.package_base import PackageBase


class RocmConsistency(PackageBase):
with when("+rocm"):
for ver in [
"5.1.0",
"5.1.3",
"5.2.0",
"5.2.1",
"5.2.3",
"5.3.0",
"5.3.3",
"5.4.0",
"5.4.3",
"5.5.0",
"5.5.1",
"5.6.0",
"5.6.1",
"5.7.0",
"5.7.1",
"6.0.0",
"6.0.2",
]:
depends_on(f"hip@{ver}", when=f"%rocmcc@{ver} ^hip")
depends_on(f"hsakmt-roct@{ver}", when=f"^hip@{ver}")
depends_on(f"hsa-rocr-dev@{ver}", when=f"^hip@{ver}")
depends_on(f"comgr@{ver}", when=f"^hip@{ver}")
depends_on(f"llvm-amdgpu@{ver} +rocm-device-libs", when=f"^hip@{ver}")
depends_on(f"rocminfo@{ver}", when=f"^hip@{ver}")
depends_on(f"roctracer-dev-api@{ver}", when=f"^hip@{ver}")