Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tuning] Do not insert default perf-config into empty tuning container #2296

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions src/include/miopen/generic_search.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,24 +381,17 @@ auto GenericSearch(const Solver s,
std::random_device rd{};
auto rng = std::default_random_engine{rd()};
std::shuffle(all_configs.begin(), all_configs.end(), rng);
std::size_t n_runs_total = std::min(all_configs.size(), GetTuningIterationsMax());
const std::size_t n_runs_total = std::min(all_configs.size(), GetTuningIterationsMax());
all_configs.resize(n_runs_total);

// If a Solver produces none performanceConfigs for tuning (container is empty),
// then something is definitely wrong and needs to be fixed (e.g. applicability
// of the solver needs to be corrected or so).
if(all_configs.empty())
{
const auto default_config = s.GetDefaultPerformanceConfig(context, problem);

if(default_config.IsValid(context, problem))
{
all_configs.emplace_back(default_config);
n_runs_total += 1;
}
else
{
const auto id = s.SolverDbId();
MIOPEN_THROW("Generic search has failed. Solver " + id +
" cannot produce any valid configuration.");
}
const auto id = s.SolverDbId();
MIOPEN_THROW("Generic search has failed. Solver " + id +
" cannot produce any valid configuration.");
}

bool is_passed = false; // left false only if all iterations failed.
Expand Down