mirror of
https://github.com/CNugteren/CLBlast.git
synced 2024-07-07 12:23:46 +02:00
Fixed some things in the tuner: bugs, style, and defaults to random search
This commit is contained in:
parent
6e95752054
commit
54e160cd88
|
@ -60,7 +60,7 @@ class TuneXgemm {
|
||||||
static double DefaultInfluenceGlobalPSO(){ return 0.1; }
|
static double DefaultInfluenceGlobalPSO(){ return 0.1; }
|
||||||
static double DefaultInfluenceLocalPSO(){ return 0.3; }
|
static double DefaultInfluenceLocalPSO(){ return 0.3; }
|
||||||
static double DefaultInfluenceRandomPSO(){ return 0.6; }
|
static double DefaultInfluenceRandomPSO(){ return 0.6; }
|
||||||
static size_t DefaultHeuristic(){ return static_cast<size_t> (cltune::SearchMethod::PSO);}
|
static size_t DefaultHeuristic(){ return static_cast<size_t>(cltune::SearchMethod::RandomSearch); }
|
||||||
static double DefaultMaxTempAnn(){ return 1.0;}
|
static double DefaultMaxTempAnn(){ return 1.0;}
|
||||||
|
|
||||||
// Describes how to obtain the sizes of the buffers
|
// Describes how to obtain the sizes of the buffers
|
||||||
|
@ -180,15 +180,17 @@ class TuneXgemm {
|
||||||
|
|
||||||
// Returns which Heuristic to run
|
// Returns which Heuristic to run
|
||||||
static size_t GetHeuristic(const Arguments<T> &args){
|
static size_t GetHeuristic(const Arguments<T> &args){
|
||||||
|
if (V==1) { return static_cast<size_t>(cltune::SearchMethod::FullSearch); }
|
||||||
|
else {
|
||||||
// Use full-search to explore all parameter combinations or another strategy to search only a
|
// Use full-search to explore all parameter combinations or another strategy to search only a
|
||||||
// part of the parameter values. The fraction is set as a command-line argument.
|
// part of the parameter values. The fraction is set as a command-line argument.
|
||||||
if (args.fraction == 1.0 || args.fraction == 0.0) {
|
if (args.fraction == 1.0 || args.fraction == 0.0) {
|
||||||
return static_cast<size_t>(cltune::SearchMethod::FullSearch);
|
return static_cast<size_t>(cltune::SearchMethod::FullSearch);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return args.heuristic_selection;
|
return args.heuristic_selection;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// =================================================================================================
|
// =================================================================================================
|
||||||
|
|
|
@ -60,7 +60,7 @@ class TuneXgemmDirect {
|
||||||
static double DefaultInfluenceGlobalPSO(){ return 0.1; }
|
static double DefaultInfluenceGlobalPSO(){ return 0.1; }
|
||||||
static double DefaultInfluenceLocalPSO(){ return 0.3; }
|
static double DefaultInfluenceLocalPSO(){ return 0.3; }
|
||||||
static double DefaultInfluenceRandomPSO(){ return 0.6; }
|
static double DefaultInfluenceRandomPSO(){ return 0.6; }
|
||||||
static size_t DefaultHeuristic(){ return static_cast<size_t>(cltune::SearchMethod::PSO);}
|
static size_t DefaultHeuristic(){ return static_cast<size_t>(cltune::SearchMethod::RandomSearch);}
|
||||||
static double DefaultMaxTempAnn(){ return 1.0;}
|
static double DefaultMaxTempAnn(){ return 1.0;}
|
||||||
|
|
||||||
// Describes how to obtain the sizes of the buffers
|
// Describes how to obtain the sizes of the buffers
|
||||||
|
@ -177,15 +177,17 @@ class TuneXgemmDirect {
|
||||||
|
|
||||||
// Returns which Heuristic to run
|
// Returns which Heuristic to run
|
||||||
static size_t GetHeuristic(const Arguments<T> &args){
|
static size_t GetHeuristic(const Arguments<T> &args){
|
||||||
|
if (V==1) { return static_cast<size_t>(cltune::SearchMethod::FullSearch); }
|
||||||
|
else {
|
||||||
// Use full-search to explore all parameter combinations or another strategy to search only a
|
// Use full-search to explore all parameter combinations or another strategy to search only a
|
||||||
// part of the parameter values. The fraction is set as a command-line argument.
|
// part of the parameter values. The fraction is set as a command-line argument.
|
||||||
if (args.fraction == 1.0 || args.fraction == 0.0) {
|
if (args.fraction == 1.0 || args.fraction == 0.0) {
|
||||||
return static_cast<size_t>(cltune::SearchMethod::FullSearch);
|
return static_cast<size_t>(cltune::SearchMethod::FullSearch);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return args.heuristic_selection;
|
return args.heuristic_selection;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// =================================================================================================
|
// =================================================================================================
|
||||||
|
|
|
@ -102,9 +102,9 @@ void Tuner(int argc, char* argv[]) {
|
||||||
auto method = C::GetHeuristic(args);
|
auto method = C::GetHeuristic(args);
|
||||||
|
|
||||||
if (method == 1) { tuner.UseRandomSearch(1.0/args.fraction); }
|
if (method == 1) { tuner.UseRandomSearch(1.0/args.fraction); }
|
||||||
else if (method == 2) { tuner.UseAnnealing(args.fraction, args.ann_max_temperature); }
|
else if (method == 2) { tuner.UseAnnealing(1.0/args.fraction, args.ann_max_temperature); }
|
||||||
else if (method == 3) {
|
else if (method == 3) {
|
||||||
tuner.UsePSO(args.fraction, args.pso_swarm_size, args.pso_inf_global, args.pso_inf_local, args.pso_inf_random);
|
tuner.UsePSO(1.0/args.fraction, args.pso_swarm_size, args.pso_inf_global, args.pso_inf_local, args.pso_inf_random);
|
||||||
}
|
}
|
||||||
else { tuner.UseFullSearch(); }
|
else { tuner.UseFullSearch(); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue