Skip to content

Commit e9549c1

Browse files
Add missing additions from Frontier Merge (#389)
Co-authored-by: Spencer Bryngelson <[email protected]>
1 parent ad9237f commit e9549c1

File tree

3 files changed

+37
-6
lines changed

3 files changed

+37
-6
lines changed

.github/pull_request_template.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,21 @@ Please also list any relevant details for your test configuration
3838
- [ ] I added Doxygen docstrings to the new code
3939
- [ ] I have made corresponding changes to the documentation (`docs/`)
4040
- [ ] I have added regression tests to the test suite so that people can verify in the future that the feature is behaving as expected
41-
- [ ] I have added example cases in `examples/` that demonstrate my new feature performing as expected
41+
- [ ] I have added example cases in `examples/` that demonstrate my new feature performing as expected.
42+
They run to completion and demonstrate "interesting physics"
4243
- [ ] I ran `./mfc.sh format` before committing my code
43-
- [ ] New and existing tests pass locally with my changes, including with GPU capability enabled and disabled
44+
- [ ] New and existing tests pass locally with my changes, including with GPU capability enabled (both NVIDIA hardware with NVHPC compilers and AMD hardware with CRAY compilers) and disabled
4445
- [ ] This PR does not introduce any repeated code (it follows the [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) principle)
4546
- [ ] I cannot think of a way to condense this code and reduce any introduced additional line count
4647

47-
### If your code changes any code source files (anything in `src/`)
48+
### If your code changes any code source files (anything in `src/simulation`)
4849

4950
To make sure the code is performing as expected on GPU devices, I have:
5051
- [ ] Checked that the code compiles using NVHPC compilers
52+
- [ ] Checked that the code compiles using CRAY compilers
5153
- [ ] Ran the code on either V100, A100, or H100 GPUs and ensured the new feature performed as expected (the GPU results match the CPU results)
54+
- [ ] Ran the code on MI200+ GPUs and ensure the new features performed as expected (the GPU results match the CPU results)
5255
- [ ] Enclosed the new feature via `nvtx` ranges so that they can be identified in profiles
5356
- [ ] Ran a Nsight Systems profile using `./mfc.sh run XXXX --gpu -t simulation --nsys`, and have attached the output file (`.nsys-rep`) and plain text results to this PR
57+
- [ ] Ran an Omniperf profile using `./mfc.sh run XXXX --gpu -t simulation --omniperf`, and have attached the output file and plain text results to this PR.
5458
- [ ] Ran my code using various numbers of different GPUs (1, 2, and 8, for example) in parallel and made sure that the results scale similarly to what happens if you run without the new code/feature

docs/documentation/running.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,35 @@ As an example, one might request GPUs on a SLURM system using the following:
8181
**Disclaimer**: IBM's JSRUN on LSF-managed computers does not use the traditional node-based approach to
8282
allocate resources. Therefore, the MFC constructs equivalent resource sets in the task and GPU count.
8383

84-
### Profiling with NVIDIA Nsight
84+
### GPU Profiling
85+
86+
#### NVIDIA GPUs
8587

8688
MFC provides two different arguments to facilitate profiling with NVIDIA Nsight.
8789
**Please ensure the used argument is placed at the end so their respective flags can be appended.**
88-
- Nsight Systems (Nsys): `./mfc.sh run ... --nsys [nsys flags]` allows one to visualize MFC's system-wide performance with [NVIDIA Nsight Systems](https://developer.nvidia.com/nsight-systems).
90+
- Nsight Systems (Nsys): `./mfc.sh run ... -t simulation --nsys [nsys flags]` allows one to visualize MFC's system-wide performance with [NVIDIA Nsight Systems](https://developer.nvidia.com/nsight-systems).
8991
NSys is best for understanding the order and execution times of major subroutines (WENO, Riemann, etc.) in MFC.
9092
When used, `--nsys` will run the simulation and generate `.nsys-rep` files in the case directory for all targets.
9193
These files can then be imported into Nsight System's GUI, which can be downloaded [here](https://developer.nvidia.com/nsight-systems/get-started#latest-Platforms). It is best to run case files with a few timesteps to keep the report files small. Learn more about NVIDIA Nsight Systems [here](https://docs.nvidia.com/nsight-systems/UserGuide/index.html).
92-
- Nsight Compute (NCU): `./mfc.sh run ... --ncu [ncu flags]` allows one to conduct kernel-level profiling with [NVIDIA Nsight Compute](https://developer.nvidia.com/nsight-compute).
94+
- Nsight Compute (NCU): `./mfc.sh run ... -t simulation --ncu [ncu flags]` allows one to conduct kernel-level profiling with [NVIDIA Nsight Compute](https://developer.nvidia.com/nsight-compute).
9395
NCU provides profiling information for every subroutine called and is more detailed than NSys.
9496
When used, `--ncu` will output profiling information for all subroutines, including elapsed clock cycles, memory used, and more after the simulation is run.
9597
Adding this argument will significantly slow the simulation and should only be used on case files with a few timesteps.
9698
Learn more about NVIDIA Nsight Compute [here](https://docs.nvidia.com/nsight-compute/NsightCompute/index.html).
9799

100+
101+
#### AMD GPUs
102+
- Rocprof (ROC): `./mfc.sh run ... -t simulation --roc --hip-trace [rocprof flags]` allows one to visualize MFC's system-wide performance with [Perfetto UI](https://ui.perfetto.dev/).
103+
When used, `--roc` will run the simulation and generate files in the case directory for all targets.
104+
`results.json` can then be imported in [Perfetto's UI](https://ui.perfetto.dev/).
105+
Learn more about AMD Rocprof [here](https://rocm.docs.amd.com/projects/rocprofiler/en/docs-5.5.1/rocprof.html)
106+
It is best to run case files with a few timesteps to keep the report files small.
107+
- Omniperf (OMNI): `./mfc.sh run ... -t simulation --omni [omniperf flags]`allows one to conduct kernel-level profiling with [AMD Omniperf](https://rocm.github.io/omniperf/introduction.html#what-is-omniperf).
108+
When used, `--omni` will output profiling information for all subroutines, including rooflines, cache usage, register usage, and more after the simulation is run.
109+
Adding this argument will moderately slow down the simulation and run the MFC executable several times.
110+
For this reason it should only be used with case files that have a few timesteps.
111+
112+
98113
### Restarting Cases
99114

100115
When running a simulation, MFC generates a `./restart_data` folder in the case directory that contains `lustre_*.dat` files that can be used to restart a simulation from saved timesteps.

toolchain/mfc/run/run.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ def __profiler_prepend() -> typing.List[str]:
4545

4646
return ["nsys", "profile", "--stats=true", "--trace=mpi,nvtx,openacc"] + ARG("nsys")
4747

48+
if ARG("omni") is not None:
49+
if not does_command_exist("omniperf"):
50+
raise MFCException("Failed to locate [bold red]ROCM Omniperf[/bold red] (omniperf).")
51+
52+
return ["omniperf", "profile"] + ARG("omni") + ["--"]
53+
54+
if ARG("roc") is not None:
55+
if not does_command_exist("rocprof"):
56+
raise MFCException("Failed to locate [bold red]ROCM rocprof[/bold red] (rocprof).")
57+
58+
return ["rocprof"] + ARG("roc")
59+
4860
return []
4961

5062

0 commit comments

Comments
 (0)