Commit 4f7d8fa9 authored by Ashok Emani's avatar Ashok Emani Committed by Scott Cyphers

move CollpaseDims pass into core (#3869)

* move CollpaseDims pass into core

* style apply

* skip plaidml tests
parent 5f8d7005
...@@ -391,6 +391,8 @@ set (SRC ...@@ -391,6 +391,8 @@ set (SRC
pass/implicit_broadcast_elimination.cpp pass/implicit_broadcast_elimination.cpp
pass/batch_fusion.hpp pass/batch_fusion.hpp
pass/batch_fusion.cpp pass/batch_fusion.cpp
pass/collapse_dims.cpp
pass/collapse_dims.hpp
pass/common_function_collection.cpp pass/common_function_collection.cpp
pass/common_function_collection.hpp pass/common_function_collection.hpp
pass/constant_folding.cpp pass/constant_folding.cpp
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
// limitations under the License. // limitations under the License.
//***************************************************************************** //*****************************************************************************
#include "cpu_collapse_dims.hpp" #include "collapse_dims.hpp"
#include <algorithm> #include <algorithm>
#include <iostream> #include <iostream>
#include <numeric> #include <numeric>
...@@ -239,7 +239,7 @@ static bool collapse_dot(std::shared_ptr<Node> n) ...@@ -239,7 +239,7 @@ static bool collapse_dot(std::shared_ptr<Node> n)
return replaced; return replaced;
} }
bool runtime::cpu::pass::CPUCollapseDims::run_on_function(std::shared_ptr<ngraph::Function> f) bool ngraph::pass::CollapseDims::run_on_function(std::shared_ptr<ngraph::Function> f)
{ {
bool replaced = false; bool replaced = false;
for (auto n : f->get_ordered_ops()) for (auto n : f->get_ordered_ops())
......
...@@ -20,18 +20,12 @@ ...@@ -20,18 +20,12 @@
namespace ngraph namespace ngraph
{ {
namespace runtime namespace pass
{ {
namespace cpu class CollapseDims : public ngraph::pass::FunctionPass
{ {
namespace pass public:
{ bool run_on_function(std::shared_ptr<ngraph::Function> function) override;
class CPUCollapseDims : public ngraph::pass::FunctionPass };
{
public:
bool run_on_function(std::shared_ptr<ngraph::Function> function) override;
};
}
}
} }
} }
...@@ -29,8 +29,8 @@ pass::PassConfig::PassConfig() ...@@ -29,8 +29,8 @@ pass::PassConfig::PassConfig()
// Parses the semi-colon separated environment string passed through NGRAPH_PASS_ENABLES // Parses the semi-colon separated environment string passed through NGRAPH_PASS_ENABLES
// and returns the pass names and whether they should be enabled or disabled in the // and returns the pass names and whether they should be enabled or disabled in the
// provided unordered_map. Implementation of pass selection is up to the backend // provided unordered_map. Implementation of pass selection is up to the backend
// E.g., NGRAPH_PASS_ENABLES="CoreFusion:0;LikeReplacement:1;CPUCollapseDims" would // E.g., NGRAPH_PASS_ENABLES="CoreFusion:0;LikeReplacement:1;CollapseDims" would
// set disables on CoreFusion and enables on LikeReplacement and CPUCollapseDims // set disables on CoreFusion and enables on LikeReplacement and CollapseDims
// //
const char* env_str = getenv("NGRAPH_PASS_ENABLES"); const char* env_str = getenv("NGRAPH_PASS_ENABLES");
if (env_str) if (env_str)
......
...@@ -120,7 +120,6 @@ set(SRC ...@@ -120,7 +120,6 @@ set(SRC
op/sigmoid_mul.cpp op/sigmoid_mul.cpp
op/update_slice.cpp op/update_slice.cpp
pass/cpu_assignment.cpp pass/cpu_assignment.cpp
pass/cpu_collapse_dims.cpp
pass/cpu_fusion.cpp pass/cpu_fusion.cpp
pass/cpu_horizontal_fusion.cpp pass/cpu_horizontal_fusion.cpp
pass/cpu_layout.cpp pass/cpu_layout.cpp
......
...@@ -140,6 +140,7 @@ ...@@ -140,6 +140,7 @@
#include "ngraph/op/xor.hpp" #include "ngraph/op/xor.hpp"
#include "ngraph/pass/algebraic_simplification.hpp" #include "ngraph/pass/algebraic_simplification.hpp"
#include "ngraph/pass/batch_fusion.hpp" #include "ngraph/pass/batch_fusion.hpp"
#include "ngraph/pass/collapse_dims.hpp"
#include "ngraph/pass/common_function_collection.hpp" #include "ngraph/pass/common_function_collection.hpp"
#include "ngraph/pass/constant_folding.hpp" #include "ngraph/pass/constant_folding.hpp"
#include "ngraph/pass/core_fusion.hpp" #include "ngraph/pass/core_fusion.hpp"
...@@ -190,7 +191,6 @@ ...@@ -190,7 +191,6 @@
#include "ngraph/runtime/cpu/op/sigmoid_mul.hpp" #include "ngraph/runtime/cpu/op/sigmoid_mul.hpp"
#include "ngraph/runtime/cpu/op/update_slice.hpp" #include "ngraph/runtime/cpu/op/update_slice.hpp"
#include "ngraph/runtime/cpu/pass/cpu_assignment.hpp" #include "ngraph/runtime/cpu/pass/cpu_assignment.hpp"
#include "ngraph/runtime/cpu/pass/cpu_collapse_dims.hpp"
#include "ngraph/runtime/cpu/pass/cpu_fusion.hpp" #include "ngraph/runtime/cpu/pass/cpu_fusion.hpp"
#include "ngraph/runtime/cpu/pass/cpu_horizontal_fusion.hpp" #include "ngraph/runtime/cpu/pass/cpu_horizontal_fusion.hpp"
#include "ngraph/runtime/cpu/pass/cpu_layout.hpp" #include "ngraph/runtime/cpu/pass/cpu_layout.hpp"
...@@ -1224,7 +1224,7 @@ void runtime::cpu::CPU_ExternalFunction::register_common_passes( ...@@ -1224,7 +1224,7 @@ void runtime::cpu::CPU_ExternalFunction::register_common_passes(
} }
REGISTER_KNOBBED_PASS(CPUQuantFusion, true, runtime::cpu::pass) REGISTER_KNOBBED_PASS(CPUQuantFusion, true, runtime::cpu::pass)
REGISTER_KNOBBED_PASS(CPUHorizontalFusion, true, runtime::cpu::pass) REGISTER_KNOBBED_PASS(CPUHorizontalFusion, true, runtime::cpu::pass)
REGISTER_KNOBBED_PASS(CPUCollapseDims, true, runtime::cpu::pass) REGISTER_KNOBBED_PASS(CollapseDims, true, ngraph::pass)
#if defined(NGRAPH_HALIDE) #if defined(NGRAPH_HALIDE)
REGISTER_KNOBBED_PASS(HalideSubgraphExtraction, true, ngraph::runtime::cpu::pass) REGISTER_KNOBBED_PASS(HalideSubgraphExtraction, true, ngraph::runtime::cpu::pass)
#endif #endif
......
...@@ -250,6 +250,9 @@ model_argmax_int32 ...@@ -250,6 +250,9 @@ model_argmax_int32
model_argmin_int32 model_argmin_int32
model_lp_norm_default model_lp_norm_default
model_instance_normalization model_instance_normalization
model_qlinear_matmul_3d
model_matmul_integer_4d
model_matmul_integer_4d_zero_point
# failings on plaidml_nGPU # failings on plaidml_nGPU
argmin_4D_i64 argmin_4D_i64
......
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