Skip to content

Commit

Permalink
Merge branch 'develop' into changelog_develop
Browse files Browse the repository at this point in the history
  • Loading branch information
causten authored Aug 16, 2023
2 parents b54f2fb + 5bfc7a2 commit 5dc1850
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/.sphinx/requirements.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rocm-docs-core==0.11.0
rocm-docs-core>=0.20.0
8 changes: 2 additions & 6 deletions docs/.sphinx/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ jinja2==3.1.2
# via
# myst-parser
# sphinx
linkify-it-py==1.0.3
# via myst-parser
markdown-it-py==2.2.0
# via
# mdit-py-plugins
Expand All @@ -57,7 +55,7 @@ mdit-py-plugins==0.3.5
# via myst-parser
mdurl==0.1.2
# via markdown-it-py
myst-parser[linkify]==1.0.0
myst-parser==1.0.0
# via rocm-docs-core
packaging==23.1
# via
Expand Down Expand Up @@ -89,7 +87,7 @@ requests==2.28.2
# via
# pygithub
# sphinx
rocm-docs-core==0.11.0
rocm-docs-core>=0.20.0
# via -r requirements.in
smmap==5.0.0
# via gitdb
Expand Down Expand Up @@ -132,8 +130,6 @@ sphinxcontrib-serializinghtml==1.1.5
# via sphinx
typing-extensions==4.5.0
# via pydata-sphinx-theme
uc-micro-py==1.0.1
# via linkify-it-py
urllib3==1.26.15
# via requests
wrapt==1.15.0
Expand Down
19 changes: 19 additions & 0 deletions src/eliminate_contiguous.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {

MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_TRACE_ELIMINATE_CONTIGUOUS)

static bool try_compute_shape(instruction_ref ins,
const std::vector<shape>& inputs,
const std::vector<module_ref>& mods)
Expand Down Expand Up @@ -84,8 +86,20 @@ static bool try_compute_shape(instruction_ref ins,
}
}
}
catch(const std::exception& e)
{
if(enabled(MIGRAPHX_TRACE_ELIMINATE_CONTIGUOUS{}))
{
std::cout << "Exception: " << e.what() << std::endl;
}
return false;
}
catch(...)
{
if(enabled(MIGRAPHX_TRACE_ELIMINATE_CONTIGUOUS{}))
{
std::cout << "Unknown exception" << std::endl;
}
return false;
}

Expand Down Expand Up @@ -127,6 +141,11 @@ static void remove_contiguous(const std::string& op_name, module& m, F f)
{
if(arg->name() != op_name)
continue;
if(enabled(MIGRAPHX_TRACE_ELIMINATE_CONTIGUOUS{}))
{
std::cout << "eliminate_contiguous: ";
m.debug_print(ins);
}
auto prev = arg->inputs().front();
replace(new_args, arg, prev);
if(try_compute_shape(ins, new_args, mod_args))
Expand Down

0 comments on commit 5dc1850

Please sign in to comment.