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

Pip Runtime Dependencies & CRAY AMD Support #314

Draft
wants to merge 44 commits into
base: develop
Choose a base branch
from

Conversation

mdavis36
Copy link
Collaborator

@mdavis36 mdavis36 commented Nov 8, 2024

Summary

  • This PR:
    • Refactors our package management system for python packages in the Spheral build pipeline.
    • Moves Spheral CI off of BlueOS/NVIDA systems and adds support for CRAY/AMD

PIP Runtime Dependencies

Spheral +python variant

  • The spheral spack package will default to +python. This will add python as a dependency for building spheral. It will also enable +python for polytope.
  • We no longer need any of our pip package dependencies in spack.
    • Reduces Docker TPL builds from ~60 min to ~30.

Build Time Deps

  • We still need spack to manage Python for us but it can be passed as an external.
  • Using the new Spheral_Python_Env function we build a virtual environment target in the build tree with dependencies listed in build-requirements.txt. All pybind11 code and documentation is generated from this environment.
  • docs-requirements.txt is added to the environment when ENABLE_DOCS=On.

Runtime Deps

  • Using the same Spheral_Python_Env function we can generate a Virtual Env in the Install directory from runtime-requirements.txt.
  • spheral-setup-venv now only needs to copy the installed Spheral libraries into the environment at install time.

The python_build_env and python_runtime_env targets are built and installed only one time in a build tree. Stamp files are created to ensure pip isn't re-run on every make.

Caching Builds for LC

We have pip cache to a local directory ~/.cache/spheral_pip/. This directory can be overridden with SPHERAL_PIP_CACHE_DIR.

  • ATS has been added as a submodule as they do not provide a proper pypi package, so we must treat it as a local repo install through pip requirements.

CRAY AMD

Due to issues with pip dependencies being unsupported on BlueOS systems this PR requires us to make the switch over to CRAY/AMD.

  • HIP support has been added for our device/offload tests.
  • TPLs have been updated to versions that support a HIP enabled build.
  • CHAI Changes for HIP Support have been added.
  • Gitlab CI and script changes for executing under a flux scheduling system.

ToDo :

  • Annotate RELEASE_NOTES.md with notable changes.
  • Create LLNLSpheral PR pointing at this branch. (PR#123)
  • LLNLSpheral PR has passed all tests.
  • Merge Virtual Env Support PYB11Generator#10 and update submodule

…IR; System + compiler specific cache directories; Clean targets for pip cache and envs.
@mdavis36 mdavis36 added this to the 2025.01.0 Release milestone Jan 3, 2025
Comment on lines +37 to +53
#TODO: Remove this once blueos3 is no longer supported.
if("${SPHERAL_ENV_SYS_TYPE}" STREQUAL "blueos_3_ppc64le_ib_p9")
set(PIP_INSTALL_CMD env MPICC=${MPI_C_COMPILER} MPICXX=${MPI_CXX_COMPILER} CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}
python -m pip install
--disable-pip-version-check
)

add_custom_command(
OUTPUT ${${target_name}_PREFIX}/.venv/${target_name}_stamp
COMMAND ${Python3_EXECUTABLE} -m venv --system-site-packages ${${target_name}_PREFIX}/.venv;
COMMAND . ${${target_name}_PREFIX}/.venv/bin/activate &&

${PIP_INSTALL_CMD} ${REQUIREMENTS_ARGS}

DEPENDS Python3::Python ${${target_name}_REQUIREMENTS}
)
else()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

blueos will not be supported as of this PR - Remove this

@@ -237,6 +236,7 @@ function(spheral_add_pybind11_library package_name module_list_name)
USE_BLT ON
EXTRA_SOURCE ${${package_name}_SOURCES}
INSTALL OFF
VIRTUAL_ENV python_build_env
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need to make a Pyb11Generator PR to support this change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Merge changes to Develop then update submodule here.

Comment on lines +15 to +27
- compiler:
spec: cce@=18.0.0
paths:
cc: /usr/tce/packages/cce-tce/cce-18.0.0/bin/craycc
cxx: /usr/tce/packages/cce-tce/cce-18.0.0/bin/crayCC
f77: /usr/tce/packages/cce-tce/cce-18.0.0/bin/crayftn
fc: /usr/tce/packages/cce-tce/cce-18.0.0/bin/crayftn
flags: {}
operating_system: rhel8
target: x86_64
modules: []
environment: {}
extra_rpaths: []
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove, this isn't used

# Copy Spheral source and generate host config from tpl-manager (all dependencies should already be installed).
COPY . .
RUN python3 scripts/devtools/tpl-manager.py --spec $SPEC --upstream-dir /home/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder_ --spack-url /home/spack

# Configure Spheral with SPEC TPLs.
RUN mv *.cmake $HOST_CONFIG.cmake
RUN python3 scripts/devtools/host-config-build.py --host-config $HOST_CONFIG.cmake
RUN python3 scripts/devtools/host-config-build.py --host-config $HOST_CONFIG.cmake -DSPHERAL_NETWORK_CONNECTED=Off
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Add documentation on SPHERAL_NETWORK_CONNECTED

@@ -57,6 +57,7 @@ Notable changes include:
* Bugfix for RZ solid CRKSPH with compatible energy.
* Parsing of None string now always becomes None python type. Tests have been updated accordingly.
* IO for checkpoints and visuzalization can now be properly turned off through SpheralController input options.
* Bugfix for atomicWeight in ANEOS

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Add RELEASE_NOTES Documentation

#----------------------------------------------------------------------------------------


set(SPHERAL_PIP_CACHE_DIR ~/.cache/spheral_pip)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Document SPHERAL_PIP_CACHE_DIR

@mdavis36 mdavis36 linked an issue Jan 17, 2025 that may be closed by this pull request
@mdavis36 mdavis36 changed the title Pip Managed Runtime Dependencies Pip Runtime Dependencies & CRAY AMD Support Jan 17, 2025
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.

spheral_cuda_test rename
2 participants