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

Call hipInit before MPI_Init. #1629

Merged
merged 2 commits into from Sep 28, 2023
Merged

Call hipInit before MPI_Init. #1629

merged 2 commits into from Sep 28, 2023

Conversation

joaander
Copy link
Member

Description

Call hipInit(0) before MPI_Init.

Motivation and context

OLCF suggests this as a workaround for segmentation faults in MPI_Init: https://docs.olcf.ornl.gov/systems/frontier_user_guide.html#olcfdev-1655-occasional-seg-fault-during-mpi-init.

How has this been tested?

I attempted to reproduce the failure. Prior to this change, i did observe:

Fri Sep 22 11:49:53 2023: [PE_388]:_pmi_mmap_tmp: Warning bootstrap barrier failed: num_syncd=3, pes_this_node=8, timeout=180 secs
Fri Sep 22 11:49:53 2023: [PE_385]:_pmi_mmap_tmp: Warning bootstrap barrier failed: num_syncd=3, pes_this_node=8, timeout=180 secs
Fri Sep 22 11:49:53 2023: [PE_385]:_pmi_mmap_init:Failed to setup PMI mmap.Fri Sep 22 11:49:53 2023: [PE_385]:globals_init:_pmi_mmap_init returned -1
MPICH ERROR [Rank 0] [job id unknown] [Fri Sep 22 11:49:53 2023] [frontier04084] - Abort(1091855) (rank 0 in comm 0): Fatal error in PMPI_Init: Other MPI error, error stack:
MPIR_Init_thread(170): 
MPID_Init(441).......: 
MPIR_pmi_init(110)...: PMI_Init returned 1

very occasionally - approximately 3 times out of hundreds of launches ranging from 10 nodes to 500 nodes. This error occurred during both CPU-only and GPU jobs.

With ~20 submissions after this change, I did not observe the error. With such a low rate of occurrence, we will only be certain of the fix after long term testing with production runs. There is no harm in initializing the hip runtime early: https://rocm.docs.amd.com/projects/HIP/en/latest/.doxygen/docBin/html/group___driver.html#ga01baa652dda5815c594d047060496caa - it is normally initialized automatically on the first HIP call.

Change log

Fixed:

* Attempt to workaround `PMI_Init returned 1` error on OLCF Frontier.

Checklist:

@joaander joaander added the validate Execute long running validation tests on pull requests label Sep 28, 2023
@joaander joaander marked this pull request as ready for review September 28, 2023 14:04
@joaander joaander requested review from a team as code owners September 28, 2023 14:04
@joaander joaander requested review from tommy-waltmann and AlainKadar and removed request for a team September 28, 2023 14:04
Copy link
Contributor

@tommy-waltmann tommy-waltmann left a comment

Choose a reason for hiding this comment

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

The docs mention having to compile the code differently once this statement is added. Since you've already tested this change on frontier, I'm assuming that CMake automatically accounted for that. Is that right?

@joaander
Copy link
Member Author

Those instructions link to docs that explain how to compile with HIP. We already compile with HIP in HOOMD. I think that the difference implied is for CPU only codes that are not already building with HIP, or possibly codes that use OpenMP or other libraries for interfacing with the GPU.

It is true that an ENABLE_GPU=off build of HOOMD on Frontier would potentially still have this issue. However, there should be very few use-cases to do that and I do not wish to rewrite major portions of HOOMD's cmake to allow linking to HIP with ENABLE_GPU=off.

Copy link
Contributor

@tommy-waltmann tommy-waltmann left a comment

Choose a reason for hiding this comment

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

Ok, looks good then.

@joaander joaander merged commit 668f735 into trunk-patch Sep 28, 2023
51 of 57 checks passed
@joaander joaander deleted the hip-init branch September 28, 2023 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validate Execute long running validation tests on pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants