"vscode:/vscode.git/clone" did not exist on "66ba1147b0a158ba998f43d6cc6fffdc876a7178"
Commit 6878ea29 authored by umangyadav's avatar umangyadav
Browse files

fromatting

parent f840b994
...@@ -631,8 +631,11 @@ void program::from_value(const value& v) ...@@ -631,8 +631,11 @@ void program::from_value(const value& v)
MIGRAPHX_THROW("Warning: Program version mismatch"); MIGRAPHX_THROW("Warning: Program version mismatch");
} }
auto migx_version = v.at("migraphx_version").to<std::string>(); auto migx_version = v.at("migraphx_version").to<std::string>();
if(migx_version != get_migraphx_version()) { if(migx_version != get_migraphx_version())
std::clog << "MIGraphX version mismatch, consider recompiling model with environment variable MIOPEN_FIND_ENFORCE=3 to re-tune the model " << std::endl; {
std::clog << "MIGraphX version mismatch, consider recompiling model with environment "
"variable MIOPEN_FIND_ENFORCE=3 to re-tune the model "
<< std::endl;
} }
this->impl->target_name = v.at("target").to<std::string>(); this->impl->target_name = v.at("target").to<std::string>();
......
...@@ -284,21 +284,32 @@ struct context ...@@ -284,21 +284,32 @@ struct context
this->current_device = std::make_shared<hip_device>(0, n_streams); this->current_device = std::make_shared<hip_device>(0, n_streams);
#ifdef MIGRAPHX_HAS_FIND_2_API #ifdef MIGRAPHX_HAS_FIND_2_API
{ {
std::string current_gfx_arch = this->current_device->get_device_name(); std::string current_gfx_arch = this->current_device->get_device_name();
std::size_t current_cu_count = this->current_device->get_cu_count(); std::size_t current_cu_count = this->current_device->get_cu_count();
std::string current_miopen_version = get_miopen_version(); std::string current_miopen_version = get_miopen_version();
if(n_cu_count != current_cu_count || v_gfx_arch != current_gfx_arch) { if(n_cu_count != current_cu_count || v_gfx_arch != current_gfx_arch)
std::clog << "MIGraphX model was compiled for gfx_arch: " << v_gfx_arch << " with number of CUs=" << n_cu_count << ", but current device has gfx_arch: " << current_gfx_arch << " with number of CUs=" << current_cu_count<<", performance may suffer. \ {
Consider re-compiling the model with environment variable MIOPEN_FIND_ENFORCE=3 to re-tune the model." << std::endl; std::clog << "MIGraphX model was compiled for gfx_arch: " << v_gfx_arch
} << " with number of CUs=" << n_cu_count
if(current_miopen_version != v_miopen_version) { << ", but current device has gfx_arch: " << current_gfx_arch
std::clog << "MIGraphX model was compiled with MIOpen version : " << v_miopen_version << ", but this machine has MIOpen version: " << current_miopen_version << ", Performance may suffer.\ << " with number of CUs=" << current_cu_count
Consider re-compiling the model with environment variable MIOPEN_FIND_ENFORCE=3 to re-tune the model." << std::endl; << ", performance may suffer. \
Consider re-compiling the model with environment variable MIOPEN_FIND_ENFORCE=3 to re-tune the model."
<< std::endl;
}
if(current_miopen_version != v_miopen_version)
{
std::clog << "MIGraphX model was compiled with MIOpen version : "
<< v_miopen_version
<< ", but this machine has MIOpen version: " << current_miopen_version
<< ", Performance may suffer.\
Consider re-compiling the model with environment variable MIOPEN_FIND_ENFORCE=3 to re-tune the model."
<< std::endl;
} }
} }
#endif #endif
} }
void wait_for(any_ptr queue) void wait_for(any_ptr queue)
......
...@@ -76,8 +76,6 @@ using miopen_find_options = MIGRAPHX_MANAGE_PTR(miopenFindOptions_t, miopenDestr ...@@ -76,8 +76,6 @@ using miopen_find_options = MIGRAPHX_MANAGE_PTR(miopenFindOptions_t, miopenDestr
using miopen_problem = MIGRAPHX_MANAGE_PTR(miopenProblem_t, miopenDestroyProblem); using miopen_problem = MIGRAPHX_MANAGE_PTR(miopenProblem_t, miopenDestroyProblem);
using miopen_solution = MIGRAPHX_MANAGE_PTR(miopenSolution_t, miopenDestroySolution); using miopen_solution = MIGRAPHX_MANAGE_PTR(miopenSolution_t, miopenDestroySolution);
inline miopen_solution find_solution(miopenHandle_t handle, miopenProblem_t problem) inline miopen_solution find_solution(miopenHandle_t handle, miopenProblem_t problem)
{ {
miopenSolution_t solution; miopenSolution_t solution;
...@@ -101,13 +99,16 @@ inline void set_tensor_descriptor(miopenTensorArgumentId_t name, ...@@ -101,13 +99,16 @@ inline void set_tensor_descriptor(miopenTensorArgumentId_t name,
} }
#endif #endif
inline std::string get_miopen_version() { inline std::string get_miopen_version()
size_t major=0, minor=0, patch=0; {
size_t major = 0, minor = 0, patch = 0;
auto status = miopenGetVersion(&major, &minor, &patch); auto status = miopenGetVersion(&major, &minor, &patch);
if(status != miopenStatusSuccess) { if(status != miopenStatusSuccess)
{
MIGRAPHX_THROW("MIOpen failed to retrieve miopen version info"); MIGRAPHX_THROW("MIOpen failed to retrieve miopen version info");
} }
std::string version = std::to_string(major) +"."+ std::to_string(minor) +"."+ std::to_string(patch); std::string version =
std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(patch);
return version; return version;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment