-
Notifications
You must be signed in to change notification settings - Fork 115
Frontier UVM and other preparations to reproduce 100T #967
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # 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. |
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 output
src/pre_process/m_data_output.fpp
• Added
m_helper
module import andq_cons_temp
temporary variable fordownsampling
• Modified function signatures to make parameters
optional and change intent from
in
toinout
• 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 steppers
src/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_UNIFIED
preprocessor flag
m_data_input.f90
Add downsampling support to post-process data input
src/post_process/m_data_input.f90
• Added
q_cons_temp
temporary 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 output
src/simulation/m_data_output.fpp
• Added
m_boundary_common
module import andq_cons_temp
variable•
Modified function signatures to include
bc_type
parameter 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 startup
src/simulation/m_start_up.fpp
• Added
down_sample
parameter 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 indexing
src/pre_process/m_global_parameters.fpp
• Added
down_sample
logical 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_order
parameter
m_compute_levelset.fpp
Make levelset parameters optional and reorder signatures
src/pre_process/m_compute_levelset.fpp
• Modified all levelset computation subroutines to make parameters
optional
• Changed parameter order to put
ib_patch_id
first 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-process
src/post_process/m_global_parameters.fpp
• Added
down_sample
logical 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 globals
src/simulation/m_global_parameters.fpp
• Added
down_sample
parameter 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_order
parameterm_sim_helpers.fpp
Add data upsampling functionality and fix IGR alpha
src/simulation/m_sim_helpers.fpp
• Fixed IGR alpha calculation to use constant value for single fluid
case
• Added
s_upsample_data
subroutine for converting downsampleddata back to full resolution
• Implemented trilinear interpolation
algorithm for upsampling conservative variables
m_patches.fpp
Make IB parameters optional in patch application
src/pre_process/m_patches.fpp
• Made IB-related parameters optional in
s_apply_domain_patches
subroutine
• 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 assignment
src/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 conditions
src/pre_process/m_initial_condition.fpp
• Made IB-related allocations conditional based on
ib
flag• Updated
patch application call to handle optional IB parameters
• Added proper
initialization and deallocation of IB-related variables
m_helper.fpp
Add data downsampling functionality
src/common/m_helper.fpp
• Added
s_downsample_data
subroutine 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 broadcasts
src/post_process/m_mpi_proxy.fpp
• Added
down_sample
to 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 functions
src/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 initialization
src/common/m_mpi_common.fpp
• Added
s_initialize_mpi_data_ds
subroutine 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 MPI
src/pre_process/m_mpi_proxy.fpp
• Added
igr_order
to integer parameter broadcast list• Added
down_sample
to logical parameter broadcast list• Updated MPI
parameter synchronization for new downsampling features
m_start_up.f90
Add downsampling support to post-process startup
src/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 IGR
src/common/m_helper_basic.fpp
• Updated
s_configure_coordinate_bounds
to includeigr_order
parameter• Modified buffer size calculation for IGR to use
igr_order
instead ofhardcoded values
• Improved coordinate bounds configuration for IGR
cases
m_start_up.fpp
Add downsampling parameter to pre-process startup
src/pre_process/m_start_up.fpp
• Added
down_sample
parameter 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 feature
src/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 MPI
src/simulation/m_mpi_proxy.fpp
• Added
down_sample
to logical parameter broadcast list• Updated MPI
parameter synchronization for simulation module
1 files
m_variables_conversion.fpp
Fix IGR variable conversion for single fluid cases
src/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 dictionaries
toolchain/mfc/run/case_dicts.py
• Added
down_sample
parameter 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 template
toolchain/templates/frontier.mako
• Added conditional export of
CRAY_ACC_USE_UNIFIED_MEM=1
environmentvariable
• Enabled unified memory support when
unified
flag is setCMakeLists.txt
Add Frontier unified memory CMake configuration
CMakeLists.txt
• Added Frontier unified memory support for Cray compiler
• Added
-DFRONTIER_UNIFIED
compile flag whenMFC_Unified
is enabled•
Integrated HIP and hipfort library linking for unified memory
.typos.toml
Add HSA to typos whitelist
.typos.toml
• Added
HSA
to the list of accepted words in typos configuration13 files
golden-metadata.txt
Update test metadata for 106C0BE6
tests/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 CEAF553A
tests/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 execution
tests/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 execution
tests/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 execution
tests/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 execution
tests/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 execution
tests/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 execution
tests/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 execution
tests/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 execution
tests/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 execution
tests/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 execution
tests/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 execution
tests/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 formatting
toolchain/modules
• Minor formatting cleanup removing trailing whitespace
• Updated
module configuration for various HPC systems