-
Notifications
You must be signed in to change notification settings - Fork 42
Add tutorial for building FRNN on OLCF's Spock system (AMD GPUs) #77
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
Techercise
wants to merge
5
commits into
PPPLDeepLearning:master
Choose a base branch
from
Techercise:olcf_amd_docs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0b59a7a
Adding CoriGPU run files and modifying conf.yaml
Techercise a0f0516
Manually add OLCF-AMD documentation to master branch
Techercise ee4d8a8
Reset conf.yaml to default and remove WIP Cori job scripts
Techercise d8966f1
Update OLCF-AMD.md to reflect @felker 's comments
Techercise 13181da
Correct the location of backticks on mpi.cfg
Techercise File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
# OLCF Spock Tutorial | ||
*Last updated 2021-10-1* | ||
|
||
*This document is built off of the excellent how-to guide created for [Princeton's TigerGPU](./PrincetonUTutorial.md)* | ||
|
||
## Building the package | ||
### Login to Spock | ||
|
||
First, login to the Spock headnode via ssh: | ||
``` | ||
ssh -X <yourusername>@spock.olcf.ornl.gov | ||
``` | ||
Note, `-X` is optional; it is only necessary if you are planning on performing remote visualization, e.g. the output `.png` files from the below [section](#Learning-curves-and-ROC-per-epoch). Trusted X11 forwarding can be used with `-Y` instead of `-X` and may prevent timeouts, but it disables X11 SECURITY extension controls. | ||
|
||
### Sample installation on Spock | ||
|
||
#### Check out the Code Repository | ||
Next, check out the source code from github: | ||
``` | ||
git clone https://github.com/PPPLDeepLearning/plasma-python | ||
cd plasma-python | ||
``` | ||
|
||
#### Install Miniconda | ||
At the time of writing, Anaconda and Miniconda are not installed on Spock, therefore one of them must be manually downloaded. In their system documentation, AMD recommends downloading Miniconda. | ||
|
||
To install Miniconda, download the Linux installer [here](https://docs.conda.io/en/latest/miniconda.html#linux-installers) and follow the installation instructions for Miniconda on [this page](https://conda.io/projects/conda/en/latest/user-guide/install/linux.html) | ||
|
||
Once Miniconda is installed, create a conda environment: | ||
``` | ||
conda create -n your_env_name python=3.8 -y | ||
``` | ||
|
||
Then, activate the environment: | ||
``` | ||
conda activate your_env_name | ||
``` | ||
|
||
Ensure the following packages are installed in your conda environment: | ||
``` | ||
pyyaml # pip install pyyaml | ||
pathos # pip install pathos | ||
hyperopt # pip install hyperopt | ||
matplotlib # pip install matplotlib | ||
keras # pip install keras | ||
tensorflow-rocm # pip install tensorflow-rocm | ||
``` | ||
|
||
#### Modules | ||
In order to load the correct modules with ease, creating a profile is recommended. Create a profile named | ||
``` | ||
frnn_spock.profile | ||
``` | ||
|
||
Write the following to the profile: | ||
``` | ||
module load rocm | ||
module load cray-python | ||
module load gcc | ||
module load craype-accel-amd-gfx908 | ||
module load cray-mpich/8.1.7 | ||
module use /sw/aaims/spock/modulefiles | ||
module load tensorflow | ||
|
||
# These must be set before running if wanting to use the Cray GPU-Aware MPI | ||
# If running on only 1 GPU, there is no need to uncomment these lines | ||
|
||
# export MPIR_CVAR_GPU_EAGER_DEVICE_MEM=0 | ||
# export MPICH_GPU_SUPPORT_ENABLED=1 | ||
# export HIPCC_COMPILE_FLAGS_APPEND="$HIPCC_COMPILE_FLAGS_APPEND -I${MPICH_DIR}/include -L${MPICH_DIR}/lib -lmpi -L/opt/cray/pe/mpich/8.1.7/gtl/lib -lmpi_gtl_hsa" | ||
|
||
export MPICC="$(which mpicc)" | ||
``` | ||
|
||
|
||
As of the latest update of this document (Summer 2021), the above modules correspond to the following versions on the Spock system, given by `module list` (Note that this list also includes the default system modules): | ||
``` | ||
Currently Loaded Modules: | ||
1) craype/2.7.8 3) libfabric/1.11.0.4.75 5) cray-dsmml/0.1.5 7) xpmem/2.2.40-2.1_2.28__g3cf3325.shasta 9) cray-pmi/6.0.12 11) DefApps/default 13) cray-python/3.8.5.1 15) craype-accel-amd-gfx908 17) rocm/4.1.0 | ||
2) craype-x86-rome 4) craype-network-ofi 6) perftools-base/21.05.0 8) cray-libsci/21.06.1.1 10) cray-pmi-lib/6.0.12 12) PrgEnv-cray/8.1.0 14) gcc/10.3.0 16) cray-mpich/8.1.7 18) tensorflow/2.3.6 | ||
``` | ||
|
||
#### Build mpi4py | ||
If wanting to run on multiple GPUs, mpi4py is needed. At the time of writing, a manual installation of mpi4py is needed on the Spock system. To install mpi4py, do the following: | ||
``` | ||
# Ensure your conda environment is activated: | ||
conda activate your_env_name | ||
|
||
# Download mpi4py to your home directory | ||
#cd ~ | ||
curl -O -L https://bitbucket.org/mpi4py/mpi4py/downloads/mpi4py-3.0.3.tar.gz | ||
|
||
# Untar the file | ||
tar -xzvf mpi4py-3.0.3.tar.gz | ||
|
||
cd mpi4py-3.0.3 | ||
|
||
# Edit the mpi.cfg file | ||
mpi.cfg | ||
``` | ||
|
||
Include the following segment in the `mpi.cfg` file: | ||
``` | ||
[craympi] | ||
mpi_dir = /opt/cray/pe/mpich/8.1.4/ofi/crayclang/9.1 | ||
mpicc = cc | ||
mpicxx = CC | ||
include_dirs = /opt/cray/pe/mpich/8.1.4/ofi/crayclang/9.1/include | ||
libraries = mpi | ||
library_dirs = /opt/cray/pe/mpich/8.1.4/ofi/crayclang/9.1/ | ||
``` | ||
|
||
Build and install mpi4py: | ||
``` | ||
python setup.py build --mpi=craympi | ||
python setup.py install | ||
``` | ||
|
||
Next, install the `plasma-python` package: | ||
|
||
```bash | ||
#conda activate your_env_name | ||
#cd ~/plasma-python | ||
python setup.py install | ||
``` | ||
|
||
## Understanding and preparing the input data | ||
|
||
To learn how to understand and prepare the input data, please see the [corresponding section in the TigerGPU tutorial](./PrincetonUTutorial.md#understanding-and-preparing-the-input-data) | ||
|
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.
Uh oh!
There was an error while loading. Please reload this page.