Skip to content

fix(exx): validate device_exx choices and make selector types explicit - #8390

Open
Stardust0831 wants to merge 4 commits into
deepmodeling:developfrom
Stardust0831:fix/exx-device-selector
Open

Stardust0831 wants to merge 4 commits into
deepmodeling:developfrom
Stardust0831:fix/exx-device-selector

Conversation

@Stardust0831

Copy link
Copy Markdown
Collaborator

Reminder

  • I have read AGENTS.md and docs/developers_guide/agent_governance.md.
  • I have linked an issue or explained why this PR does not need one.
  • I have added adequate unit tests and/or case tests, or explained why not.
  • I have listed the exact verification commands run and their results.
  • I have described user-visible behavior changes, including INPUT parameter changes.
  • I have explained core-module impact for ESolver, HSolver, ElecState, Hamilt, Operator, Psi, or other source/ changes.
  • I have requested any needed governance exception below.

Linked Issue

Follows the review of the LibRI/DDLA device selector in #8169.

Unit Tests and/or Case Tests for my changes

  • Built the serial INPUT and EXX test sources with GCC 13.3, with __GPU_RI disabled and enabled. In each host build, OMP_NUM_THREADS=1 ./input-tests passed 53/53 and OMP_NUM_THREADS=1 ./exx-input-test --gtest_filter=DeviceExxInput.SelectionAndValidation passed 1/1. The optional Google Test 1.11 --gtest_death_test_style=threadsafe mode lost captured stdout on both the base and this commit.
  • Called the production INPUT reader on LCAO input files in both builds. Omitted and explicit cpu succeeded. ../cpu/read-device-exx INPUT.ddla exited 1 with Invalid INPUT parameter 'device_exx': supplied 'ddla'. Expected one String from {cpu, gpu}. The same diagnostic appeared with GPU RI enabled. ../cpu/read-device-exx --help-device-exx listed both choices. The selector test exercised the LCAO, GPU device and build-capability requirements.
  • g++ -std=c++14 -fopenmp -fsyntax-only compiled the four real/complex Exx_LRI_Interface::set_gpu specializations against the LibRI v0.3.0.0 and DDLA v0.0.7 GPU headers. Coverage was limited to the host reader, selector and header instantiations. A full ABACUS build, MPI calculation and on-device EXX run were outside this check.

What's changed?

Register cpu and gpu with item.domain.set_choices for device_exx. This lets INPUT validation report an invalid value together with the accepted choices and makes those choices available in parameter help. The default is cpu. Selecting gpu still requires LCAO, device=gpu and a build with ENABLE_LIBRI_GPU.

Exercise the invalid ddla value through a real INPUT file. Remove the five uses of auto introduced by the EXX selector change. The LibRI mode uses RI::LRI_Cal_Mode&. The test names its list, iterator and input-reference types and uses a static helper for rejection assertions.

Governance Notes

No documentation update required because the built-in help and generated INPUT manual read the choices from the Input_Item registration. No governance exception is needed.

@Stardust0831

Copy link
Copy Markdown
Collaborator Author

Could a maintainer please rerun the Build with CUDA support job for #8390? The Ubuntu package mirror returned HTTP 520 during apt update, so the runner skipped the ninja-build installation. CMake then stopped before compilation because it couldn’t find Ninja. Thank you! CI log

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants