#!/bin/bash -l #SBATCH --job-name=nrhs-fault #SBATCH --nodes=1 #SBATCH --ntasks-per-node=8 #SBATCH --cpus-per-task=7 #SBATCH --gpus-per-node=8 #SBATCH --time=0:45:00 #SBATCH --account=phy157_dwf #SBATCH --gpu-bind=none #SBATCH --exclusive #SBATCH --mem=0 #SBATCH -S 0 #SBATCH -q debug ############################################################################## # GPU "Memory access fault ... Reason: Unknown" in the 3-level example, # 2026-08-27/28: NRHS=12 and NRHS=6 (adaptive gcr/gcr) deep in the solve; once # at Nrhs=1 after an Nrhs=4 solve (replay cell S6). NRHS=4 has never faulted. # --debug-signals catches nothing: the fault is raised by the ROCm runtime, # asynchronously, possibly long after the offending kernel/copy was queued. # # Plan: a 1-node reproducer (debug queue, minutes), then make the fault # ATTRIBUTABLE. AMD_SERIALIZE_KERNEL=3 / AMD_SERIALIZE_COPY=3 make every # kernel launch and copy synchronous, so the fault surfaces at the call that # caused it; AMD_LOG_LEVEL=3 prints each kernel's name as it launches, so the # last name before the fault is the culprit. ~5-10x slower: fine at this size. # # Cells: F0 NRHS=4 control | F1 NRHS=6 (reproduce?) | F2 NRHS=6 serialised # F3 NRHS=6 DENSE_CC=0 (no dense bottom) | F4 NRHS=6 --device-mem 48000 (no LRU eviction) # Read: grep -n -B8 "Memory access fault" log.fault.F* ; for F2 the last # "ShaderName"/kernel lines before the fault; F3/F4 say whether the # dense bottom or MemoryManager eviction is involved. ############################################################################## # Run in a per-job subdirectory on Lustre: logs, per-rank --debug-stdout trees and GPU # core files are large and must not land in $HOME (quota). Everything below is # relative to RUNDIR; the job's own slurm-*.out stays where sbatch was run. LUSTRE=/lustre/orion/phy157/proj-shared/phy157_dwf/paboyle RUNDIR=$LUSTRE/runs/${SLURM_JOB_NAME}_${SLURM_JOB_ID} mkdir -p $RUNDIR && cd $RUNDIR && echo "RUNDIR $RUNDIR" cat << EOF > select_gpu #!/bin/bash export GPU_MAP=(0 1 2 3 7 6 5 4) export NUMA_MAP=(3 3 1 1 2 2 0 0) export GPU=\${GPU_MAP[\$SLURM_LOCALID]} export NUMA=\${NUMA_MAP[\$SLURM_LOCALID]} export HIP_VISIBLE_DEVICES=\$GPU unset ROCR_VISIBLE_DEVICES if [ \$SLURM_PROCID = "0" ]; then echo \$*; fi exec numactl -m \$NUMA -N \$NUMA \$* EOF chmod +x ./select_gpu root=$HOME/ParallelIO/systems/Frontier source $root/sourceme-rocm7.2.sh export OMP_NUM_THREADS=7 # No core dumps: the ROCm runtime's GPU core dump (gpucore., ~22 GB per faulting GCD, the # .nfs quota disaster of 2026-08-25) obeys ulimit -c like the kernel's (ROCgdb docs, "AMD GPU # core dumps"); Slurm propagates the batch shell's limits to srun tasks by default. ulimit -c 0 export FI_MR_CACHE_MONITOR=kdreg2 # REQUIRED for device-buffer MPI on Slingshot: libfabric memhooks monitor (default) is defective, see systems/WorkArounds.txt (libfabric #11451) export MPICH_GPU_SUPPORT_ENABLED=1 export MPICH_SMP_SINGLE_COPY_MODE=CMA export MPICH_OFI_NIC_POLICY=GPU module load libfabric BIN=$root/examples/Example_pvdagm_v2_3level_DenseCoarseMatrix OPTS1="--accelerator-threads 8 --shm 4096 --shm-mpi 1" # LOCAL VOLUME MATCHED to production: 48.48.48.96 on 3.6.4.4 is local 16.8.12.24; on 8 GCDs # (1.1.2.4) that is global 16.8.24.96 with the production blockings 2.2.3.3 / 4.4.2.4: # coarse local 8.4.4.8 and coarse-coarse local 2.1.2.2 exactly as at 288 ranks. The global # lattice is oddly shaped and the dense bottom is tiny (N = 2.1.4.8 x 60 = 3840, one block), # but every solver-side buffer has the production shape. (First submission, 2026-08-28, # used 16.16.16.32 with 2^4 blocks: local 16.16.8.8 -- NOT matched.) vol=16.8.24.96 MPI_GEOM=1.1.2.4 # The example sizes its lattice from LATT/LS (env), NOT from --grid (first submission # asserted heap_bytes $fname 2>&1 echo " exit $?"; sleep 10 grep -h "V2 3-level solve\|Memory access fault\|GRID_ASSERT\|Converged on iteration" $fname | sed 's/^Grid : Message : [0-9.]* s : //' | tail -4 | cut -c1-140 grep -n -B3 "Memory access fault" $fname | tail -5 | cut -c1-160 } # name devmem environment run_cell F0_nrhs4 16000 NRHS=4 # control: never faulted at 288 run_cell F1_nrhs6 16000 NRHS=6 # reproduce on 1 node? run_cell F2_nrhs6_ser 16000 NRHS=6 AMD_SERIALIZE_KERNEL=3 AMD_SERIALIZE_COPY=3 AMD_LOG_LEVEL=3 GRID_LOG_EXTRA=Memory # attributable fault run_cell F3_nrhs6_nodense 16000 NRHS=6 DENSE_CC=0 # dense bottom out of the loop run_cell F4_nrhs6_bigmem 48000 NRHS=6 # no MemoryManager eviction echo "=========================================================" for f in log.fault.F*; do echo "$f: $(grep -c 'Memory access fault' $f) faults; $(grep -h 'V2 3-level solve' $f | tail -1 | sed 's/.*V2/V2/' | cut -c1-60)"; done echo "========================================================="