Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
6d86ff54
Commit
6d86ff54
authored
Oct 31, 2022
by
umangyadav
Browse files
move error/warnings in Finalize()
parent
c7bb2fc3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
22 deletions
+38
-22
src/program.cpp
src/program.cpp
+5
-2
src/targets/gpu/include/migraphx/gpu/context.hpp
src/targets/gpu/include/migraphx/gpu/context.hpp
+5
-17
src/targets/gpu/include/migraphx/gpu/convolution.hpp
src/targets/gpu/include/migraphx/gpu/convolution.hpp
+27
-0
src/version.h.in
src/version.h.in
+1
-3
No files found.
src/program.cpp
View file @
6d86ff54
...
@@ -493,6 +493,10 @@ std::vector<argument> program::eval(parameter_map params, execution_environment
...
@@ -493,6 +493,10 @@ std::vector<argument> program::eval(parameter_map params, execution_environment
return
ret
;
return
ret
;
}
}
inline
std
::
string
get_migraphx_version
()
{
return
std
::
to_string
(
MIGRAPHX_VERSION_MAJOR
)
+
"."
+
std
::
to_string
(
MIGRAPHX_VERSION_MINOR
);
}
const
int
program_file_version
=
5
;
const
int
program_file_version
=
5
;
value
program
::
to_value
()
const
value
program
::
to_value
()
const
...
@@ -633,8 +637,7 @@ void program::from_value(const value& v)
...
@@ -633,8 +637,7 @@ void program::from_value(const value& v)
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
::
cerr
<<
"MIGraphX version mismatch, consider recompiling model with environment "
std
::
clog
<<
"MIGraphX version mismatch, Operators may not be compatbile."
"variable MIOPEN_FIND_ENFORCE=3 to re-tune the model "
<<
std
::
endl
;
<<
std
::
endl
;
}
}
...
...
src/targets/gpu/include/migraphx/gpu/context.hpp
View file @
6d86ff54
...
@@ -286,25 +286,13 @@ struct context
...
@@ -286,25 +286,13 @@ struct context
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
();
if
(
n_cu_count
!=
current_cu_count
or
v_gfx_arch
!=
current_gfx_arch
)
if
(
n_cu_count
!=
current_cu_count
or
v_gfx_arch
!=
current_gfx_arch
)
{
{
std
::
cerr
<<
"MIGraphX model was compiled for gfx_arch: "
<<
v_gfx_arch
MIGRAPHX_THROW
(
"MIGraphX model was compiled for gfx_arch: "
+
v_gfx_arch
\
<<
" with number of CUs="
<<
n_cu_count
+
" with number of CUs="
+
std
::
to_string
(
n_cu_count
)
\
<<
", but current device has gfx_arch: "
<<
current_gfx_arch
+
", but current device has gfx_arch: "
+
current_gfx_arch
\
<<
" with number of CUs="
<<
current_cu_count
+
" with number of CUs="
+
std
::
to_string
(
current_cu_count
)
\
<<
", performance may suffer. \
+
", performance may suffer. Consider re-compiling the model with environment variable MIOPEN_FIND_ENFORCE=3 to re-tune the model."
);
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
::
cerr
<<
"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
...
...
src/targets/gpu/include/migraphx/gpu/convolution.hpp
View file @
6d86ff54
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include <migraphx/op/convolution.hpp>
#include <migraphx/op/convolution.hpp>
#include <migraphx/op/quant_convolution.hpp>
#include <migraphx/op/quant_convolution.hpp>
#include <migraphx/op/deconvolution.hpp>
#include <migraphx/op/deconvolution.hpp>
#include <miopen/miopen.h>
#include <unordered_map>
#include <unordered_map>
#include <migraphx/reflect.hpp>
#include <migraphx/reflect.hpp>
#include <migraphx/gpu/context.hpp>
#include <migraphx/gpu/context.hpp>
...
@@ -288,6 +289,32 @@ struct miopen_convolution
...
@@ -288,6 +289,32 @@ 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
)
{
std
::
clog
<<
"MIOpen convolution was compiled with different MIOpen version. But this machine has MIOpen version: "
<<
get_miopen_version
()
<<
", Performance may suffer.\
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_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
current_gfx_arch
=
current_device
.
get_device_name
();
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
\
+
" with number of CUs="
+
std
::
to_string
(
n_cu_count
)
\
+
", but current device has gfx_arch: "
+
current_gfx_arch
\
+
" with number of CUs="
+
std
::
to_string
(
current_cu_count
)
\
+
", performance may suffer. Consider re-compiling the model with environment variable MIOPEN_FIND_ENFORCE=3 to re-tune the model."
);
}
}
}
}
}
#else
#else
...
...
src/version.h.in
View file @
6d86ff54
...
@@ -27,8 +27,6 @@
...
@@ -27,8 +27,6 @@
#define MIGRAPHX_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define MIGRAPHX_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define MIGRAPHX_VERSION_MINOR @PROJECT_VERSION_MINOR@
#define MIGRAPHX_VERSION_MINOR @PROJECT_VERSION_MINOR@
inline std::string get_migraphx_version() {
return std::to_string(MIGRAPHX_VERSION_MAJOR) + "." +std::to_string(MIGRAPHX_VERSION_MINOR);
}
// clang-format on
// clang-format on
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment