feat(gint): enable mixed-precision (fp32/fp64) support for GPU path#7207
Merged
mohanchen merged 1 commit intodeepmodeling:developfrom Apr 5, 2026
Merged
feat(gint): enable mixed-precision (fp32/fp64) support for GPU path#7207mohanchen merged 1 commit intodeepmodeling:developfrom
mohanchen merged 1 commit intodeepmodeling:developfrom
Conversation
Template the GPU grid integration kernels, batch GEMM operations, and PhiOperatorGpu class to support both single and double precision. - Template phi_operator_gpu and phi_operator_kernel for fp32/fp64 - Template dgemm_vbatch and gemm kernels for precision dispatch - Update gint_vl_gpu, gint_rho_gpu to use templated GPU operators - Propagate precision template through fvl, tau, metagga GPU paths - Remove GPU restriction for gint_precision=single/mix in input validation
6197ddc to
1364327
Compare
mohanchen
approved these changes
Apr 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reminder
Linked Issue
Follow-up to #7149 (CPU mixed-precision gint support)
Unit Tests and/or Case Tests for my changes
gint_precision = doublevsgint_precision = mixon GPU.What's changed?
This PR extends the mixed-precision grid integration (
gint_precision = mix/single) support from CPU-only to GPU. The key changes include:GPU Kernel Templating
phi_operator_gpuandphi_operator_kernel: Templated thePhiOperatorGpuclass and associated CUDA kernels to support bothfloatanddoubleprecision types.dgemm_vbatchandgemm_nn/tn_vbatch: Templated the batch GEMM operations to dispatch betweenfloatanddoubleat compile time.GPU Gint Functions
gint_vl_gpu/gint_rho_gpu: Updated to use the templated GPU operators, dispatching precision based on thegint_precisionparameter.gint_fvl_gpu,gint_tau_gpu,gint_vl_metagga_gpu,gint_vl_nspin4_gpu,gint_fvl_meta_gpu,gint_vl_metagga_nspin4_gpu: Propagated the precision template parameter through all GPU gint entry points.Input Validation
read_input_item_system.cpp: Removed the restriction that forcedgint_precisionback todoublewhen running on GPU, allowingsingleandmixmodes to work with GPU acceleration.How Mixed-Precision Works on GPU
When
gint_precision = mix:gint_vlandgint_rhocomputations → faster kernel execution and reduced memory bandwidth.drho) approachesscf_thr, theGintPrecisionControllerswitches to fp64 for final convergence accuracy.Any changes of core modules? (ignore if not applicable)
module_gintand input parameter validation.