-
Notifications
You must be signed in to change notification settings - Fork 121
Frontier UVM and other preparations to reproduce 100T #967
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR prepares for 100T simulations on Frontier by adding unified virtual memory (UVM) support and I/O downsampling capabilities. It removes memory allocation bottlenecks from pre_process to handle large-scale simulations and updates test golden files to reflect minor numerical differences.
Key Changes
- Added UVM support for Frontier via environment variable configuration
- Implemented I/O downsampling functionality with new parameter types
- Updated test golden files to reflect numerical precision changes
Reviewed Changes
Copilot reviewed 44 out of 55 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| toolchain/templates/frontier.mako | Adds conditional UVM environment variable support |
| toolchain/mfc/run/case_dicts.py | Adds downsampling parameter and domain boundary parameters |
| tests/EB58AF7F/golden.txt | Updates golden test data with minor numerical changes |
| tests/EB58AF7F/golden-metadata.txt | Updates test metadata with new generation timestamp |
Comments suppressed due to low confidence (1)
toolchain/templates/frontier.mako:47
- [nitpick] The variable name 'unified' is ambiguous in this context. Consider using a more descriptive name like 'enable_unified_memory' or 'use_uvm' to clearly indicate this controls unified virtual memory.
%if unified:
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #967 +/- ##
==========================================
- Coverage 43.67% 43.33% -0.34%
==========================================
Files 70 70
Lines 19818 20046 +228
Branches 2473 2510 +37
==========================================
+ Hits 8655 8687 +32
- Misses 9644 9824 +180
- Partials 1519 1535 +16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
let me know how you want to deal with this PR |
|
@sbryngelson I need to do two quick visualizations and then some profiles with UVM on Frontier. Can you trigger the benchmarking to see if anything else slowed down unexpectedly? |
|
yes |
|
According to benchmarks IGR is 17% slower so it failed CPU benchmark. IGR is faster on GPU cases for both nvidia and amd gpu, not sure what to make of that... perhaps you are including some other things that make it faster... |
Yeah, I noticed the CPU slowdown. I don't remember seeing that GPU was faster, but maybe I just missed it. Still working on getting the expected unified performance on Frontier |
|
@sbryngelson This should be ready to merge once the tests/benchmarks pass |
|
CPU benchmarking is still showing a slowdown while GPU benchmarks show a slight speedup. My vote is to ignore that slowdown because GPU is what really matters. |
sbryngelson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor
|
Comments addressed. I'll need to verify that down-sampling still functions as expected, given the kind of changes I had to make. |
|
I can confirm that down sampling is working as expected with the changes |
|
i'm very confused why this is slower on cpu.... and meaningfully so. |
I have no clue. None of the changes I made should have slowed anything down. I observe a similar CPU slowdown on my Mac with GNU 14.2.0 |
|
It didn't slow down. The variable
I've included the relevant printed logs output from the CI. What's still weird is that CPU reports a slowdown and GPU reports a speedup. In the GPU printed logs, the results for the master branch are printed first, followed by the results for the PR. In the CPU printed logs, the order is reversed. Basically, the code isn't slower, but there's something up with the benchmarking diffs. CPU Master Logigr: CPU PR Logigr: GPU Master Logigr: GPU PR Logigr: |
User description
Description
Adds UVM and downsampling of I/O for Frontier. Also removes some additional memory allocations from pre_process that result in out-of-memory errors for large simulations. I validated that the cases with modified golden files pass by hacking the serial I/O output to remove the line count failures before regenerating the golden data. Still need to do some manual tests, but I'm marking this as ready for review now to accelerate the merge process.
Type of change
Please delete options that are not relevant.
Scope
How Has This Been Tested?
Unified Roc-Prof Profile
resultsUNIFIED.csv
No Unified Roc-Prof Profile
resultsNOUNIFIED.csv
Downsample verification. The left frame shows full resolution and the right frame shows downsample. The differences are there, but difficult to see.
out.mp4
PR Type
Enhancement, Tests
Description
• Frontier Unified Memory Support: Implemented unified memory allocation for Frontier HPC system with HIP memory pools and conditional compilation flags
• Data Downsampling Feature: Added comprehensive downsampling functionality across pre-process, simulation, and post-process modules with 3x3x3 averaging algorithm
• IGR (Infinite Gas Relaxation) Fixes: Fixed IGR alpha calculations and variable conversion for single fluid cases across multiple modules
• Memory Optimization: Removed additional memory allocations from pre-process to prevent out-of-memory errors in large simulations
• Optional Parameter Support: Made IB (immersed boundary) parameters optional in levelset computations and patch applications
• MPI Integration: Updated MPI parameter broadcasts and data initialization to support downsampling features
• Configuration Updates: Added CMake support for Frontier unified memory, updated case dictionaries, and modified Frontier template
• Test Updates: Regenerated golden metadata files for multiple test cases with updated timestamps and configuration
Diagram Walkthrough
File Walkthrough
23 files
m_data_output.fpp
Add downsampling support to pre-process data outputsrc/pre_process/m_data_output.fpp
• Added
m_helpermodule import andq_cons_temptemporary variable fordownsampling
• Modified function signatures to make parameters
optional and change intent from
intoinout• Added conditional logic
for IB (immersed boundary) data output
• Integrated downsampling
functionality with buffer population and data processing
m_time_steppers.fpp
Implement Frontier unified memory for time stepperssrc/simulation/m_time_steppers.fpp
• Added Frontier unified memory support with HIP memory allocation
•
Implemented device and host memory pools for conservative variables
•
Modified Runge-Kutta time stepping loops to support unified memory
layout
• Added conditional compilation blocks for
FRONTIER_UNIFIEDpreprocessor flag
m_data_input.f90
Add downsampling support to post-process data inputsrc/post_process/m_data_input.f90
• Added
q_cons_temptemporary variable for downsampling support•
Modified grid coordinate reading to support uniform spacing for
downsampled data
• Updated MPI data reading to handle downsampled file
formats
• Added conditional logic for downsampling in parallel data
file reading
m_data_output.fpp
Add downsampling support to simulation data outputsrc/simulation/m_data_output.fpp
• Added
m_boundary_commonmodule import andq_cons_tempvariable•
Modified function signatures to include
bc_typeparameter and changeintent
• Integrated downsampling functionality with conditional buffer
allocation
• Updated MPI data writing to support downsampled output
formats
m_start_up.fpp
Integrate downsampling support in simulation startupsrc/simulation/m_start_up.fpp
• Added
down_sampleparameter to input reading and validation•
Implemented downsampled data reading and upsampling functionality
•
Modified data file reading to support both regular and downsampled
formats
• Added conditional memory allocation for downsampling
temporary variables
m_global_parameters.fpp
Add downsampling parameter and fix IGR indexingsrc/pre_process/m_global_parameters.fpp
• Added
down_samplelogical parameter with default valuefalse• Fixed
IGR (infinite gas relaxation) index configuration for single fluid
cases
• Modified MPI data allocation to skip when downsampling is
enabled
• Updated coordinate bounds configuration to include
igr_orderparameter
m_compute_levelset.fpp
Make levelset parameters optional and reorder signaturessrc/pre_process/m_compute_levelset.fpp
• Modified all levelset computation subroutines to make parameters
optional
• Changed parameter order to put
ib_patch_idfirst infunction signatures
• Updated function interfaces for circle, airfoil,
rectangle, cuboid, sphere, and cylinder levelsets
m_global_parameters.fpp
Add downsampling and domain parameters to post-processsrc/post_process/m_global_parameters.fpp
• Added
down_samplelogical parameter and domain boundary variables•
Fixed IGR index configuration similar to pre-process module
• Modified
MPI data allocation to support downsampled array dimensions
• Updated
parameter initialization with domain boundary defaults
m_global_parameters.fpp
Add downsampling parameter to simulation globalssrc/simulation/m_global_parameters.fpp
• Added
down_sampleparameter with GPU declaration support• Fixed IGR
index configuration for consistent behavior across modules
• Modified
MPI data allocation to skip when downsampling is enabled
• Updated
coordinate bounds configuration call with
igr_orderparameterm_sim_helpers.fpp
Add data upsampling functionality and fix IGR alphasrc/simulation/m_sim_helpers.fpp
• Fixed IGR alpha calculation to use constant value for single fluid
case
• Added
s_upsample_datasubroutine for converting downsampleddata back to full resolution
• Implemented trilinear interpolation
algorithm for upsampling conservative variables
m_patches.fpp
Make IB parameters optional in patch applicationsrc/pre_process/m_patches.fpp
• Made IB-related parameters optional in
s_apply_domain_patchessubroutine
• Updated levelset function calls to use new parameter
ordering
• Added conditional logic for IB marker and levelset
processing
m_assign_variables.fpp
Add IGR conditional logic to variable assignmentsrc/pre_process/m_assign_variables.fpp
• Added conditional logic to skip volume fraction assignment for IGR
single fluid cases
• Updated patch assignment and smoothing functions
with IGR checks
• Modified variable assignment to handle IGR special
cases properly
m_initial_condition.fpp
Make IB allocations conditional in initial conditionssrc/pre_process/m_initial_condition.fpp
• Made IB-related allocations conditional based on
ibflag• Updated
patch application call to handle optional IB parameters
• Added proper
initialization and deallocation of IB-related variables
m_helper.fpp
Add data downsampling functionalitysrc/common/m_helper.fpp
• Added
s_downsample_datasubroutine to public interface• Implemented
3x3x3 averaging algorithm for downsampling conservative variables
•
Added GPU data transfer support for downsampling operations
m_mpi_proxy.fpp
Add downsampling parameters to MPI broadcastssrc/post_process/m_mpi_proxy.fpp
• Added
down_sampleto logical parameter broadcast list• Added domain
boundary parameters to real parameter broadcast list
• Updated MPI
communication to include new downsampling parameters
m_boundary_common.fpp
Add intent specifications to boundary functionssrc/common/m_boundary_common.fpp
• Added
intent(in)specifications to function parameters• Updated
function signatures for better const-correctness
• Modified boundary
condition file writing functions with proper intent declarations
m_mpi_common.fpp
Add downsampled MPI data initializationsrc/common/m_mpi_common.fpp
• Added
s_initialize_mpi_data_dssubroutine for downsampled MPI datainitialization
• Implemented downsampled array size calculations and
MPI type creation
• Added conditional compilation for post-process vs
other modules
m_mpi_proxy.fpp
Add downsampling parameters to pre-process MPIsrc/pre_process/m_mpi_proxy.fpp
• Added
igr_orderto integer parameter broadcast list• Added
down_sampleto logical parameter broadcast list• Updated MPI
parameter synchronization for new downsampling features
m_start_up.f90
Add downsampling support to post-process startupsrc/post_process/m_start_up.f90
• Added downsampling parameters to input file reading
• Modified grid
dimensions when downsampling is enabled
• Updated global cell count
calculation with proper integer types
m_helper_basic.fpp
Update coordinate bounds configuration for IGRsrc/common/m_helper_basic.fpp
• Updated
s_configure_coordinate_boundsto includeigr_orderparameter• Modified buffer size calculation for IGR to use
igr_orderinstead ofhardcoded values
• Improved coordinate bounds configuration for IGR
cases
m_start_up.fpp
Add downsampling parameter to pre-process startupsrc/pre_process/m_start_up.fpp
• Added
down_sampleparameter to input file reading• Updated data
file writing call to handle optional IB parameters
• Added conditional
logic for IB parameter passing
m_checker.fpp
Add validation checks for downsampling featuresrc/pre_process/m_checker.fpp
• Added comprehensive validation checks for downsampling feature
•
Enforced requirements: parallel I/O, IGR, 3D, file-per-process, and
grid divisibility by 3
• Added error messages for invalid downsampling
configurations
m_mpi_proxy.fpp
Add downsampling parameter to simulation MPIsrc/simulation/m_mpi_proxy.fpp
• Added
down_sampleto logical parameter broadcast list• Updated MPI
parameter synchronization for simulation module
1 files
m_variables_conversion.fpp
Fix IGR variable conversion for single fluid casessrc/common/m_variables_conversion.fpp
• Fixed IGR alpha calculations to use constant value for single fluid
cases
• Added conditional logic to skip advection variable processing
for IGR single fluid
• Updated primitive and conservative variable
conversion routines
4 files
case_dicts.py
Add downsampling parameters to case dictionariestoolchain/mfc/run/case_dicts.py
• Added
down_sampleparameter as logical type to common parameters•
Added domain boundary parameters for x, y, z coordinates
• Updated
parameter dictionaries for pre-process configuration
frontier.mako
Add unified memory environment variable to Frontier templatetoolchain/templates/frontier.mako
• Added conditional export of
CRAY_ACC_USE_UNIFIED_MEM=1environmentvariable
• Enabled unified memory support when
unifiedflag is setCMakeLists.txt
Add Frontier unified memory CMake configurationCMakeLists.txt
• Added Frontier unified memory support for Cray compiler
• Added
-DFRONTIER_UNIFIEDcompile flag whenMFC_Unifiedis enabled•
Integrated HIP and hipfort library linking for unified memory
.typos.toml
Add HSA to typos whitelist.typos.toml
• Added
HSAto the list of accepted words in typos configuration13 files
golden-metadata.txt
Update test metadata for 106C0BE6tests/106C0BE6/golden-metadata.txt
• Updated test metadata with new timestamps and git commit information
• Changed build configuration order and environment details
golden-metadata.txt
Update test metadata for CEAF553Atests/CEAF553A/golden-metadata.txt
• Updated test metadata with new timestamps and git commit information
• Changed build configuration order and environment details
golden-metadata.txt
Update test metadata for single test executiontests/6077374F/golden-metadata.txt
• Updated test metadata with new timestamp and git commit hash
•
Changed invocation command from batch test generation to single test
•
Reordered build configuration sections and updated environment
variables
• Modified hostname from network address to local machine
name
golden-metadata.txt
Update test metadata for single test executiontests/AE3FC5CB/golden-metadata.txt
• Updated test metadata with new timestamp and git commit hash
•
Changed invocation from batch to single test generation
• Reordered
build configuration sections and populated environment variables
•
Updated hostname and removed documentation section
golden-metadata.txt
Update test metadata for single test executiontests/0045D9F8/golden-metadata.txt
• Updated test metadata with new timestamp and git commit hash
•
Changed invocation from batch to single test generation
• Reordered
build configuration sections and populated environment variables
•
Updated hostname from network address to local machine
golden-metadata.txt
Update test metadata for single test executiontests/4440D46B/golden-metadata.txt
• Updated test metadata with new timestamp and git commit hash
•
Changed invocation from batch to single test generation
• Reordered
build configuration sections and populated environment variables
•
Updated hostname from network address to local machine
golden-metadata.txt
Update test metadata for single test executiontests/C7A6B609/golden-metadata.txt
• Updated test metadata with new timestamp and git commit hash
•
Changed invocation from batch to single test generation
• Reordered
build configuration sections and populated environment variables
•
Updated hostname from network address to local machine
golden-metadata.txt
Update test metadata for single test executiontests/E8979E4A/golden-metadata.txt
• Updated test metadata with new timestamp and git commit hash
•
Changed invocation from batch to single test generation
• Reordered
build configuration sections and populated environment variables
•
Updated hostname from network address to local machine
golden-metadata.txt
Update test metadata for single test executiontests/AFBCBDFA/golden-metadata.txt
• Updated test metadata with new timestamp and git commit hash
•
Changed invocation from batch to single test generation
• Reordered
build configuration sections and populated environment variables
•
Updated hostname from network address to local machine
golden-metadata.txt
Update test metadata for single test executiontests/37DDE283/golden-metadata.txt
• Updated test metadata with new timestamp and git commit hash
•
Changed invocation from batch to single test generation
• Populated
environment variables and removed documentation section
• Updated
hostname and reordered build configuration sections
golden-metadata.txt
Update test metadata for single test executiontests/EB58AF7F/golden-metadata.txt
• Updated test metadata with new timestamp and git commit hash
•
Changed invocation from batch to single test generation
• Populated
environment variables and removed simulation section
• Updated
hostname and reordered build configuration sections
golden-metadata.txt
Update test metadata for single test executiontests/A57E30FE/golden-metadata.txt
• Updated test metadata with new timestamp and git commit hash
•
Changed invocation from batch to single test generation
• Populated
environment variables with compiler paths
• Updated hostname from
network address to local machine
golden-metadata.txt
Update test metadata for single test executiontests/E49EF7B6/golden-metadata.txt
• Updated test metadata with new timestamp and git commit hash
•
Reordered build configuration sections
• Removed documentation section
from configuration
• Updated hostname from network address to local
machine
1 files
modules
Clean up module configuration formattingtoolchain/modules
• Minor formatting cleanup removing trailing whitespace
• Updated
module configuration for various HPC systems