Skip to content

Commit

Permalink
Lower reliable_delta to 1e-1, 1e-2 and 1e-4 for half, single and do…
Browse files Browse the repository at this point in the history
…uble sloppy precision, respectively. At the same time, set `max_res_increase` to larger values to avoid the solver aborting due to many residual norm increases.
  • Loading branch information
kostrzewa committed Jun 23, 2022
1 parent 164c415 commit bff599c
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions quda_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,17 @@ void _setDefaultQudaParam(void){

inv_param.residual_type = (QudaResidualType)(QUDA_L2_RELATIVE_RESIDUAL);
inv_param.tol_hq = 0.1;
// alternative reliable does not seem to work well with twisted mass (clover) fermions
inv_param.use_alternative_reliable = 0;
// anything smaller than this and we break down in double-half in most solves
inv_param.reliable_delta = 1e-3; // ignored by multi-shift solver

// Tests show that setting reliable_delta = 1e-1 results in good time to solution and good
// convergence also in double-half mixed precision
// However, it is important to set 'max_res_increase' and 'max_res_increase_total'
// to sufficiently large values
inv_param.reliable_delta = 1e-1;
inv_param.reliable_delta_refinement = 1e-1;
inv_param.max_res_increase = 10;
inv_param.max_res_increase_total = 40;
inv_param.use_sloppy_partial_accumulator = 0;

// domain decomposition preconditioner parameters
Expand Down Expand Up @@ -899,33 +907,33 @@ void set_sloppy_prec(const SloppyPrecision sloppy_precision, const SloppyPrecisi
QudaPrecision cuda_prec_sloppy;
QudaPrecision cuda_prec_refinement_sloppy;
if( sloppy_precision==SLOPPY_DOUBLE ) {
inv_param->reliable_delta = 1e-8;
inv_param->reliable_delta = 1e-4;
cuda_prec_sloppy = QUDA_DOUBLE_PRECISION;
if(g_proc_id == 0) printf("# TM_QUDA: Using double prec. as sloppy!\n");
}
else if( sloppy_precision==SLOPPY_HALF ) {
// in double-half, we perform many reliable updates
inv_param->reliable_delta = 1e-2;
inv_param->reliable_delta = 1e-1;
cuda_prec_sloppy = QUDA_HALF_PRECISION;
if(g_proc_id == 0) printf("# TM_QUDA: Using half prec. as sloppy!\n");
}
else {
inv_param->reliable_delta = 1e-4;
inv_param->reliable_delta = 1e-2;
cuda_prec_sloppy = QUDA_SINGLE_PRECISION;
if(g_proc_id == 0) printf("# TM_QUDA: Using single prec. as sloppy!\n");
}

if( refinement_precision == SLOPPY_DOUBLE ){
inv_param->reliable_delta_refinement = 1e-8;
inv_param->reliable_delta_refinement = 1e-4;
cuda_prec_refinement_sloppy = QUDA_DOUBLE_PRECISION;
}
else if( refinement_precision == SLOPPY_HALF ){
inv_param->reliable_delta_refinement = 1e-2;
inv_param->reliable_delta_refinement = 1e-1;
cuda_prec_refinement_sloppy = QUDA_HALF_PRECISION;
if(g_proc_id == 0) printf("# TM_QUDA: Using double-half refinement in mshift-solver!\n");
}
else {
inv_param->reliable_delta_refinement = 1e-4;
inv_param->reliable_delta_refinement = 1e-2;
cuda_prec_refinement_sloppy = QUDA_SINGLE_PRECISION;
if(g_proc_id == 0) printf("# TM_QUDA: Using double-single refinement in mshift-solver!\n");
}
Expand Down

0 comments on commit bff599c

Please sign in to comment.