Commit c0e2714c authored by Adam Procter's avatar Adam Procter Committed by Scott Cyphers

Workaround to allow BEs to disable revalidation in pass manager (#3254) (#3256)

* Workaround to allow BEs to disable revalidation in pass manager

* No no no, your _other_ `false`.
parent ce5b9a26
......@@ -57,7 +57,7 @@ void pass::Manager::initialize_default_passes()
{
}
void pass::Manager::run_passes(shared_ptr<Function> func, bool transitive)
void pass::Manager::run_passes(shared_ptr<Function> func, bool transitive, bool revalidate)
{
bool profile_enabled = getenv("NGRAPH_PROFILE_PASS_ENABLE") != nullptr;
......@@ -139,10 +139,13 @@ void pass::Manager::run_passes(shared_ptr<Function> func, bool transitive)
}
// Better to do this in node replacement but this will do for now
for (auto f_pair : fs)
if (revalidate)
{
shared_ptr<Function> f = f_pair.first;
f->validate_nodes_and_infer_types();
for (auto f_pair : fs)
{
shared_ptr<Function> f = f_pair.first;
f->validate_nodes_and_infer_types();
}
}
if (m_visualize || m_serialize)
......
......@@ -64,7 +64,7 @@ public:
}
}
void run_passes(std::shared_ptr<Function>, bool transitive = true);
void run_passes(std::shared_ptr<Function>, bool transitive = true, bool revalidate = true);
ManagerState& get_state();
PassConfig& get_pass_config() { return m_pass_config; }
......
......@@ -123,8 +123,8 @@ std::shared_ptr<ngraph::runtime::plaidml::PlaidML_Executable>
// before we rewrite, we make our own copy of the function.
auto rewrite_func = clone_function(*func);
// Apply passes.
pass_manager.run_passes(rewrite_func);
// Apply passes, with revalidation disabled.
pass_manager.run_passes(rewrite_func, true, false);
// Compile the resulting function.
Build b;
......
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