Skip to content

test(ofdft): stabilize the fast Al TDOFDFT regression - #8273

Merged
mohanchen merged 3 commits into
deepmodeling:developfrom
zzlinpku:fix/tdofdft-al-stable-timestep
Nov 10, 2026
Merged

mohanchen merged 3 commits into
deepmodeling:developfrom
zzlinpku:fix/tdofdft-al-stable-timestep

Conversation

@zzlinpku

@zzlinpku zzlinpku commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

The Al TDOFDFT regression used a 0.25 fs electronic timestep that produced severe energy drift and amplified differences between parallel layouts. Use md_dt=0.001 fs and 51 outputs (initial state plus 50 advances to 0.05 fs) for a stable, fast regression. Regenerate the reference for the shorter trajectory and preserve all existing comparison thresholds.

Linked Issue

Closes #8272.

What's changed?

Only three files differ from the upstream baseline:

  • INPUT: reduce the timestep from 0.25 to 0.001 fs and use 51 outputs rather than 3.
  • README: describe the short regression and its separate timestep-validation evidence.
  • result.ref: update the final energy, force and stress for the intended 0.05 fs trajectory. The new stress absolute sum is 11356.687687 kbar.

The final diff contains neither VALIDATION.md nor check_tdofdft_timestep.py. It uses the existing Autotest collectors and comparisons. Production sources, parameter defaults/metadata, pseudopotentials, initial optimization settings and comparison thresholds are unchanged.

Unit Tests and/or Case Tests for my changes

Local final-file verification

A clean GCC/FFTW/OpenBLAS/OpenMPI PW build with production sources identical to this head was used. Native optimization was disabled and BLAS threads were limited to one.

cmake -S . -B build -DENABLE_LCAO=OFF -DENABLE_LIBXC=OFF \
  -DENABLE_MPI=ON -DENABLE_OPENMP=ON -DENABLE_NATIVE_OPTIMIZATION=OFF \
  -DBUILD_TESTING=OFF -DGIT_SUBMODULE=OFF
cmake --build build -j 8

# From isolated 07_OFDFT copies. CASES_ONE.txt selects only 30_TDOFDFT_Al.
# REPO denotes the checkout; EXE denotes the clean PW executable.
bash "$REPO/tests/integrate/Autotest.sh" -a "$EXE" -n 1 -o 1 -f CASES_ONE.txt
bash "$REPO/tests/integrate/Autotest.sh" -a "$EXE" -n 4 -o 1 -f CASES_ONE.txt
# The 4-MPI/1-OpenMP test above was repeated three times.
bash "$REPO/tests/integrate/Autotest.sh" -a "$EXE" -n 4 -o 2 -f CASES_ONE.txt
"$EXE" --check-input
"$EXE" --version
python3 tools/03_code_analysis/agent_governance_check.py \
  --base f4c3dd3a135ae8bd09ac7e7d09134fd5cdfa1912 --head HEAD --format text
git diff --check f4c3dd3a135ae8bd09ac7e7d09134fd5cdfa1912 HEAD

All five Autotest runs passed all four final-property checks: 20/20 comparisons, using the committed reference without changing tolerances. CLI, executable identity, governance and diff-format checks passed. Complete local 4-MPI Autotest median was about 2.25 s; internal calculation was about 0.63 s. Full local unit/integration/GPU suites were not rerun for this case-only update; GitHub CI for the new head is separate.

Independent Beijixing validation of the exact final head (2026-11-05)

The user supplied independent validation of 96bc180, transferred before publication and checked out with a clean worktree. Intel Classic 2021.6.0, Open MPI 5.0.6 and MKL 2022.1.0 were used; MPI/OpenMP were enabled, LCAO/LibXC/native optimization were disabled. Build, transfer checks and --check-input passed. No production source, reference or threshold was modified, and reference generation (-g) was not used.

MPI x OpenMP Repetition Passed properties Complete Autotest script wall time Internal ABACUS time
1 x 1 1 4/4 1.82 s 0.61 s
4 x 1 1 4/4 1.69 s 0.22 s
4 x 1 2 4/4 1.51 s 0.22 s
4 x 1 3 4/4 1.53 s 0.22 s
4 x 2 1 4/4 2.53 s 1.23 s

All 20/20 fixed-input checks passed, including the normal CI parallel layout. Every run had 51 consecutive MD outputs, with initial optimization reported converged and finite output. All four printed properties were identical across the three 4-MPI repeats. Maximum total electronic energy difference from the committed reference was 4.40e-12 eV; energy per atom, force sum and stress sum matched the reference at the collector's printed precision. The 4-MPI/1-OpenMP complete-script median was 1.53 s (range 1.51–1.69 s).

Runtime comparison with the original case

The user also supplied a same-environment comparison using 4 MPI x 1 OpenMP. These numbers use Autotest's single-case timed block (MPI launch, calculation, collection and comparison), rather than the outer complete-script wall time above.

Input/version Advances End time Median single-case timed block
Original dt=0.25 fs, develop c907953 2 0.5 fs 1.260 s
Earlier long dt=0.001 fs, eb5ed2d 500 0.5 fs 3.264 s
Final short dt=0.001 fs, 96bc180 50 0.05 fs 1.479 s

The final case adds 0.219 s (about 17%) to the original median while avoiding the unstable large timestep. These are measurements of separately built versions in the same toolchain/layout, subject to startup and system-load variation; a one-second runtime is not an acceptance requirement. The five validation repetitions are one-time verification, not five new routine CI cases. The short regression intentionally covers 0.05 fs, rather than preserving the original 0.5 fs end time.

Timestep evidence and limits

Offline local comparisons at the same 0.05 fs end time used dt=0.001/0.0005/0.00025 fs with 51/101/201 outputs. Maximum energy departures were 0.028633/0.029177/0.029443 meV per atom. Aligned stress-component differences decreased from 0.0005911613 to 0.0002927182 kbar on refinement. Selected-step MPI/OpenMP stress differences were below 3.1e-10 kbar. A dt=0.01 fs control reaching the same 0.05 fs was unstable and rejected by the original harness.

Force sums at dt/dt2/dt4 were 0.399212/0.400954/0.401824 eV/Angstrom. The finer controls differ from the selected-step reference by 0.001742 and 0.002612, exceeding the existing 0.001 fixed-input force threshold; energy and stress comparisons pass. These are recorded time-discretization differences. The selected fixed input passes its original regression requirements across both tested toolchains; this PR does not claim that every observable is timestep-converged within those regression thresholds.

Separate earlier 0.5 fs experiments, independently reproduced on Beijixing at eb5ed2d, support the timestep choice: dt=0.001/0.0005/0.00025 fs produced maximum energy departures 0.716680/0.705707/0.700265 meV per atom, with aligned stress differences decreasing from 0.005632303 to 0.002937635 kbar. That long-trajectory evidence is separate from the exact-head short-case verification above. Residual energy drift remains; no exact conservation or coupled-propagator convergence-order claim is made.

Governance Notes

  • INPUT/docs: only per-case values and README change; no global parameter metadata changes.
  • Core-module impact: none; no production source changes.
  • Exceptions requested: none.

Reminder

  • Read AGENTS.md and complete agent governance.
  • Linked issue and documented verification, runtime and limitations.
  • Described INPUT changes and core-module impact.

@mohanchen mohanchen added Refactor Refactor ABACUS codes Tests/Examples Issues/PR related to unit tests and integrate tests labels Nov 4, 2026
@zzlinpku zzlinpku changed the title test(ofdft): validate the Al trajectory with a smaller timestep test(ofdft): stabilize the fast Al TDOFDFT regression Nov 5, 2026
@mohanchen
mohanchen merged commit 5664ee7 into deepmodeling:develop Nov 10, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Refactor ABACUS codes Tests/Examples Issues/PR related to unit tests and integrate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TDOFDFT Al regression uses a timestep-unconverged trajectory

2 participants