"examples/git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "af198888285943f0a8844c1a7af2fc685a47a9db"
Commit 345ff08e authored by umangyadav's avatar umangyadav
Browse files

add environment flag for warnings

parent 0d27c2bc
...@@ -46,7 +46,7 @@ inline namespace MIGRAPHX_INLINE_NS { ...@@ -46,7 +46,7 @@ inline namespace MIGRAPHX_INLINE_NS {
MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_TRACE_COMPILE) MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_TRACE_COMPILE)
MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_TRACE_EVAL) MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_TRACE_EVAL)
MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_ENABLE_TUNING_WARNINGS)
struct program_impl; struct program_impl;
struct marker; struct marker;
......
...@@ -636,7 +636,7 @@ void program::from_value(const value& v) ...@@ -636,7 +636,7 @@ 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() && enabled(MIGRAPHX_ENABLE_TUNING_WARNINGS{}))
{ {
std::clog << "MIGraphX version mismatch, Operators may not be compatbile." << std::endl; std::clog << "MIGraphX version mismatch, Operators may not be compatbile." << std::endl;
} }
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#ifndef MIGRAPHX_GUARD_RTGLIB_CONVOLUTION_HPP #ifndef MIGRAPHX_GUARD_RTGLIB_CONVOLUTION_HPP
#define MIGRAPHX_GUARD_RTGLIB_CONVOLUTION_HPP #define MIGRAPHX_GUARD_RTGLIB_CONVOLUTION_HPP
#include "migraphx/program.hpp"
#include <migraphx/shape.hpp> #include <migraphx/shape.hpp>
#include <migraphx/generate.hpp> #include <migraphx/generate.hpp>
#include <migraphx/operation.hpp> #include <migraphx/operation.hpp>
...@@ -289,34 +290,36 @@ struct miopen_convolution ...@@ -289,34 +290,36 @@ struct miopen_convolution
solution_ptr = miopen_solution{ptr}; solution_ptr = miopen_solution{ptr};
if(status != miopenStatusSuccess) if(status != miopenStatusSuccess)
MIGRAPHX_THROW("MIOpen " + op.name() + ": loading convolution solution failed"); MIGRAPHX_THROW("MIOpen " + op.name() + ": loading convolution solution failed");
if(status == miopenStatusVersionMismatch) if(enabled(MIGRAPHX_ENABLE_TUNING_WARNINGS{})) {
{ if(status == miopenStatusVersionMismatch)
std::clog << "MIOpen convolution was compiled with different MIOpen version. " {
"But this machine has MIOpen version: " std::clog << "MIOpen convolution was compiled with different MIOpen version. "
<< get_miopen_version() << ", Performance may suffer.\ "But this machine has MIOpen version: "
Consider re-compiling the model with environment variable MIOPEN_FIND_ENFORCE=3 to re-tune the model." << get_miopen_version() << ", Performance may suffer.\
<< std::endl; Consider re-compiling the model with environment variable MIOPEN_FIND_ENFORCE=3 to re-tune the model."
} << std::endl;
}
auto v = ctx.to_value();
auto v_gfx_arch = v.at("gfx_arch").to<std::string>(); auto v = ctx.to_value();
auto v_gfx_arch = v.at("gfx_arch").to<std::string>();
auto v_cu_count = v.at("cu_count");
std::size_t n_cu_count = v_cu_count.without_key().to<std::size_t>(); auto v_cu_count = v.at("cu_count");
std::size_t n_cu_count = v_cu_count.without_key().to<std::size_t>();
std::string v_miopen_version = v.at("miopen_version").to<std::string>();
auto current_device = ctx.get_current_device(); std::string v_miopen_version = v.at("miopen_version").to<std::string>();
std::string current_gfx_arch = current_device.get_device_name(); auto current_device = ctx.get_current_device();
std::size_t current_cu_count = current_device.get_cu_count(); std::string current_gfx_arch = current_device.get_device_name();
if(n_cu_count != current_cu_count or v_gfx_arch != current_gfx_arch) std::size_t current_cu_count = current_device.get_cu_count();
{ if(n_cu_count != current_cu_count or v_gfx_arch != current_gfx_arch)
MIGRAPHX_THROW( {
"MIGraphX model was compiled for gfx_arch: " + v_gfx_arch + MIGRAPHX_THROW(
" with number of CUs=" + std::to_string(n_cu_count) + "MIGraphX model was compiled for gfx_arch: " + v_gfx_arch +
", but current device has gfx_arch: " + current_gfx_arch + " with number of CUs=" + std::to_string(n_cu_count) +
" with number of CUs=" + std::to_string(current_cu_count) + ", but current device has gfx_arch: " + current_gfx_arch +
", performance may suffer. Consider re-compiling the model with " " with number of CUs=" + std::to_string(current_cu_count) +
"environment variable MIOPEN_FIND_ENFORCE=3 to re-tune the model."); ", performance may suffer. Consider re-compiling the model with "
"environment variable MIOPEN_FIND_ENFORCE=3 to re-tune the model.");
}
} }
} }
} }
......
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