Skip to content

Latest commit

 

History

History
60 lines (51 loc) · 3.22 KB

spin_runtime_validation.md

File metadata and controls

60 lines (51 loc) · 3.22 KB

Fixed-spin runtime validation

Build gpumd and nep on a CUDA node, choosing the device architecture:

make -C src -j8 CUDA_ARCH=-arch=sm_70 gpumd nep
export GPUMD_COMMAND="$PWD/src/gpumd"
export NEP_COMMAND="$PWD/src/nep"

Use Python with NumPy and pytest. Set RESULTS to a new output directory outside this checkout. The first two GPU scripts need one GPU; run them with one allocated device visible. The third requires four allocated GPUs in one process.

python -m pytest --noconftest -q tests_pytest/test_spin_model_format.py tests_pytest/test_spin_validation.py
python tests_pytest/validate_nep_spin3_runtime.py
python tests_pytest/validate_mfield_runtime.py
python tests_pytest/validate_spin_multigpu.py --binary "$GPUMD_COMMAND" --model tests_pytest/fixtures/nep_spin3/nep_spin_o3c2_uniform.nep --output "$RESULTS/runtime"

The runtime oracle checks cover energy, atomic force, magnetic force and all nine virial components, plus energy-reference invariance, excluded-spin masking, replication and fixed-spin restart. Model-selection checks include uppercase fields, attached comments and a model record after numeric blocks. Small-cell checks cover capacity growth and a 10,000-atom thin cell compared with an equivalent expanded cell. Split XYZ output is checked after restart. The frozen reference provenance is documented in fixtures. The external-field script checks analytic Zeeman energy and magnetic force, group and region selection, boundary crossing, excluded spins and invalid inputs. It also checks additive fields and clearing/redeclaring them across runs. Ordinary-model checks require extra scalar, vector, nonfinite, string and duplicate spin properties to leave predictions and restart output unchanged. Multi-GPU comparisons use componentwise tolerances and reject nonfinite values. To compare revisions, add --reference /path/to/reference/gpumd to the multi-GPU command. Every reference case then uses that executable on one GPU; without this option, the candidate executable supplies the one-GPU reference. They cover small cells, nonuniform and triclinic systems, cutoff boundaries, partition directions, motion across partition boundaries, additive magnetic fields and energy references. An additional supported n_max 4 8, l_max 8 2 1 model needs 51,840 bytes in the direct angular-force path and therefore exercises its 48 KiB fallback on one, two and four GPUs with nonzero forces.

Run the training validation against the same build to check the shared descriptor implementation and native/JIT agreement. Keep its model, seed, budget and GPU settings fixed when comparing revisions.

For ordinary GPUMD and NEP behavior, build an unmodified upstream checkout and run the full regression suite. BASELINE_GPUMD and BASELINE_NEP must identify those independently built upstream executables:

python tests_regression/run_regression.py --repo-root "$PWD" \
  --baseline "$BASELINE_GPUMD" --candidate "$GPUMD_COMMAND" \
  --baseline-nep "$BASELINE_NEP" --candidate-nep "$NEP_COMMAND" --suite full

These checks validate implementation contracts, not fit quality or performance. Spin integrators and their checkpoint state are outside this suite.