Skip to content

[GPU] Non-collinear spin stress calculation produces ~83% deviation in 038_PW_NC #7691

Description

@chengleizheng

Describe the bug

038_PW_NC (non-collinear spin, Fe2) produces a ~83% stress deviation on GPU vs CPU. Energy and force pass within tolerance. The Autotest harness reports:

-----AUTO TESTS OF ABACUS ------
ABACUS path: /home/chenglei/abacus-develop/build/abacus_basic_gpu
Number of processes: 1
Number of threads: 32
Test accuracy totenergy: 0.0000001 eV
Test accuracy force: 0.0001
Test accuracy stress: 0.001
Test accuracy descriptor mean: 0.00001
Check accuaracy: 8
Test cases file: /dev/fd/63
Test cases regex: ^[^#].*_.*$
Generate reference:
--------------------------------

[ RUN      ] 038_PW_NC
[----------] Test noncolliner-spin calculation for FM-Fe2 , test force and stress for k-222
[      OK  ]  etotref
[      OK  ]  etotperatomref
[      OK  ]  totalforceref
[WARNING   ]  totalstressref cal=12381.02663200 ref=73803.12998800 deviation=61422.10335600
[ERROR      ]  An unacceptable deviation occurs.
[----------] Time elapsed: 18.968 seconds

[WARNING]    1 test cases out of 5 failed.
038_PW_NC
[ERROR     ] 1 test cases out of 5 produced fatal error.
038_PW_NC
[ERROR     ] Fatal deviation details:
038_PW_NC: totalstressref cal=12381.02663200 ref=73803.12998800 deviation=61422.10335600

Expected behavior

The GPU results of stress tensor and total pressure should match CPU results within Autotest tolerance (0.001).

To Reproduce

  • Build
cmake -B build -DUSE_CUDA=1 -DCUDA_SEPARABLE_COMPILATION=OFF \
-DCMAKE_CUDA_FLAGS="--static-global-template-stub=false"
cd build && make -j$(nproc)
  • Switch to GPU mode (only needed if INPUT defaults to cpu)
cd tests/01_PW
find . -name INPUT -exec sed -i 's/^device.*/device    gpu/' {} \;
  • Run the failing case
bash ../integrate/Autotest.sh -n 1 -a /home/chenglei/abacus-develop/build/abacus_basic_gpu -f <(echo
"038_PW_NC")

Environment

  • ABACUS v3.11.0-beta.6 (GPU build with -DUSE_CUDA=ON)
  • NVIDIA RTX 4060 Laptop GPU, CUDA 13.1
  • Intel(R) Core(TM) i9-14900HX

Additional Context

No response

Task list for Issue attackers (only for developers)

  • Verify the issue is not a duplicate.
  • Describe the bug.
  • Steps to reproduce.
  • Expected behavior.
  • Error message.
  • Environment details.
  • Additional context.
  • Assign a priority level (low, medium, high, urgent).
  • Assign the issue to a team member.
  • Label the issue with relevant tags.
  • Identify possible related issues.
  • Create a unit test or automated test to reproduce the bug (if applicable).
  • Fix the bug.
  • Test the fix.
  • Update documentation (if necessary).
  • Close the issue and inform the reporter (if applicable).

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugsBugs that only solvable with sufficient knowledge of DFTGPU & DCU & HPCGPU and DCU and HPC related any issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions