Skip to content

Reject GEN-ELPA with GPU device - #7738

Merged
mohanchen merged 1 commit into
deepmodeling:developfrom
Stardust0831:fix/reject-genelpa-gpu
Aug 1, 2026
Merged

Reject GEN-ELPA with GPU device#7738
mohanchen merged 1 commit into
deepmodeling:developfrom
Stardust0831:fix/reject-genelpa-gpu

Conversation

@Stardust0831

@Stardust0831 Stardust0831 commented Aug 1, 2026

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 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.

Related Issue

Related to #7719, which audits existing INPUT reset semantics and recommends rejecting unsupported explicit combinations during final validation rather than silently rewriting user intent. This focused PR does not close that broader issue.

When does the problem occur?

The unsupported state occurs for an LCAO calculation when the user explicitly sets both ks_solver = genelpa and device = gpu. GEN-ELPA is a CPU-only interface, but the combination previously passed INPUT validation and could fail later inside ELPA.

The existing ks_solver reset behavior is unaffected: with basis_type = lcao, device = gpu, and the default ks_solver, ABACUS derives ks_solver = cusolver. CPU genelpa remains valid, and GPU ELPA acceleration remains available through ks_solver = elpa.

Unit Tests and/or Case Tests for my changes

A focused INPUT validation test covers the explicit LCAO genelpa/GPU combination and checks that ABACUS exits with guidance to use ks_solver = elpa. Existing solver reset tests continue to cover the default GPU selection behavior.

What changed?

  • Reject explicit ks_solver = genelpa with device = gpu during final INPUT validation.
  • Direct users to ks_solver = elpa for ELPA GPU acceleration.
  • Describe GEN-ELPA as CPU-only in parameter metadata and generated user documentation.

Governance Notes

  • INPUT/docs changes: ks_solver validation and description changed; docs/parameters.yaml and docs/advanced/input_files/input-main.md are updated together.
  • Core module impact: limited to final INPUT validation in source_io; no ESolver, HSolver, ELPA implementation, or numerical path is modified.
  • Exceptions requested: none.

@AsTonyshment AsTonyshment left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Currently if device=gpu and ks_solver=genelpa is set simultaneously, the compute-bound diagonalization process will be done on CPU, which is rather misleading. This fix would make the users clearly aware of what they are doing exactly.

@mohanchen mohanchen added Input&Output Suitable for coders without knowing too many DFT details Refactor Refactor ABACUS codes labels Aug 1, 2026
@mohanchen
mohanchen merged commit 5f7a9eb into deepmodeling:develop Aug 1, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Input&Output Suitable for coders without knowing too many DFT details Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants