Removed BroadcastDistributed (#1430)
authorIlya Churaev <ilya.churaev@intel.com>
Mon, 27 Jul 2020 07:49:56 +0000 (10:49 +0300)
committerGitHub <noreply@github.com>
Mon, 27 Jul 2020 07:49:56 +0000 (10:49 +0300)
ngraph/src/ngraph/CMakeLists.txt
ngraph/src/ngraph/op/broadcast_distributed.cpp [deleted file]
ngraph/src/ngraph/op/broadcast_distributed.hpp [deleted file]
ngraph/src/ngraph/op/op_version_tbl.hpp
ngraph/src/ngraph/ops.hpp
ngraph/src/ngraph/runtime/reference/broadcast_distributed.hpp [deleted file]
ngraph/src/ngraph/serializer.cpp
ngraph/test/op_is.cpp
ngraph/test/runtime/interpreter/int_executable.hpp
ngraph/test/runtime/opset0_tbl.hpp

index e5717fd..351d88d 100644 (file)
@@ -136,7 +136,6 @@ set (SRC
     op/binary_convolution.cpp
     op/binary_convolution.hpp
     op/broadcast.cpp
-    op/broadcast_distributed.cpp
     op/bucketize.cpp
     op/bucketize.hpp
     op/ceiling.cpp
diff --git a/ngraph/src/ngraph/op/broadcast_distributed.cpp b/ngraph/src/ngraph/op/broadcast_distributed.cpp
deleted file mode 100644 (file)
index 7d4b4d2..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-//*****************************************************************************
-// Copyright 2017-2020 Intel Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//*****************************************************************************
-
-#include "ngraph/op/broadcast_distributed.hpp"
-#include "ngraph/attribute_visitor.hpp"
-
-using namespace std;
-using namespace ngraph;
-
-constexpr NodeTypeInfo op::BroadcastDistributed::type_info;
-
-op::BroadcastDistributed::BroadcastDistributed(const Output<Node>& arg, int64_t root_id)
-    : Op({arg})
-    , m_root_id(root_id)
-{
-    constructor_validate_and_infer_types();
-}
-
-bool op::BroadcastDistributed::visit_attributes(AttributeVisitor& visitor)
-{
-    visitor.on_attribute("root_id", m_root_id);
-    return true;
-}
-
-void op::BroadcastDistributed::validate_and_infer_types()
-{
-    NODE_VALIDATION_CHECK(this,
-                          get_input_element_type(0).is_dynamic() ||
-                              get_input_element_type(0) == element::f32 ||
-                              get_input_element_type(0) == element::f64,
-                          "Only element types f32 and f64 are supported (argument element type: ",
-                          get_input_element_type(0),
-                          ").");
-
-    set_output_type(0, get_input_element_type(0), get_input_partial_shape(0));
-}
-
-shared_ptr<Node> op::BroadcastDistributed::clone_with_new_inputs(const OutputVector& new_args) const
-{
-    check_new_args_count(this, new_args);
-    return make_shared<BroadcastDistributed>(new_args.at(0), m_root_id);
-}
-
-int64_t op::BroadcastDistributed::get_root_id() const
-{
-    return m_root_id;
-}
-
-void op::BroadcastDistributed::set_root_id(int64_t root_id)
-{
-    m_root_id = root_id;
-}
diff --git a/ngraph/src/ngraph/op/broadcast_distributed.hpp b/ngraph/src/ngraph/op/broadcast_distributed.hpp
deleted file mode 100644 (file)
index 1601d65..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//*****************************************************************************
-// Copyright 2017-2020 Intel Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//*****************************************************************************
-
-#pragma once
-
-#include <memory>
-
-#include "ngraph/op/op.hpp"
-
-namespace ngraph
-{
-    namespace op
-    {
-        namespace v0
-        {
-            class NGRAPH_API BroadcastDistributed : public Op
-            {
-            public:
-                static constexpr NodeTypeInfo type_info{"BroadcastDistributed", 0};
-                const NodeTypeInfo& get_type_info() const override { return type_info; }
-                BroadcastDistributed() = default;
-                BroadcastDistributed(const Output<Node>& arg, int64_t root_id = 0);
-                bool visit_attributes(AttributeVisitor& visitor) override;
-                void validate_and_infer_types() override;
-
-                std::shared_ptr<Node>
-                    clone_with_new_inputs(const OutputVector& new_args) const override;
-                int64_t get_root_id() const;
-                void set_root_id(int64_t root_id);
-
-            private:
-                int64_t m_root_id;
-            };
-        }
-        using v0::BroadcastDistributed;
-    }
-}
index fb1c6e6..12fe09a 100644 (file)
@@ -43,7 +43,6 @@ NGRAPH_OP(BinaryConvolution, ngraph::op::v1, 1)
 NGRAPH_OP(Broadcast, ngraph::op::v0, 0)
 NGRAPH_OP(Broadcast, ngraph::op::v1, 1)
 NGRAPH_OP(Broadcast, ngraph::op::v3, 3)
-NGRAPH_OP(BroadcastDistributed, ngraph::op::v0, 0)
 NGRAPH_OP(BroadcastLike, ngraph::op::v0, 0)
 NGRAPH_OP(Bucketize, ngraph::op::v3, 3)
 NGRAPH_OP(CTCGreedyDecoder, ngraph::op::v0, 0)
index 2b09fde..312184f 100644 (file)
@@ -33,7 +33,6 @@
 #include "ngraph/op/batch_norm.hpp"
 #include "ngraph/op/binary_convolution.hpp"
 #include "ngraph/op/broadcast.hpp"
-#include "ngraph/op/broadcast_distributed.hpp"
 #include "ngraph/op/bucketize.hpp"
 #include "ngraph/op/ceiling.hpp"
 #include "ngraph/op/concat.hpp"
diff --git a/ngraph/src/ngraph/runtime/reference/broadcast_distributed.hpp b/ngraph/src/ngraph/runtime/reference/broadcast_distributed.hpp
deleted file mode 100644 (file)
index 579a701..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//*****************************************************************************
-// Copyright 2017-2020 Intel Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//*****************************************************************************
-
-#pragma once
-
-#pragma once
-
-#include "ngraph/distributed.hpp"
-
-namespace ngraph
-{
-    namespace runtime
-    {
-        namespace reference
-        {
-            template <typename T>
-            void broadcastdistributed(T* arg,
-                                      const element::Type_t element_type,
-                                      int count,
-                                      int root_id)
-            {
-                get_distributed_interface()->broadcast(arg, element_type, count, root_id);
-            }
-        }
-    }
-}
index 0ac948d..4fe9b3b 100644 (file)
@@ -990,11 +990,6 @@ shared_ptr<Node> JSONDeserializer::deserialize_node(json node_js)
             node = make_shared<op::v0::Broadcast>(args[0], shape, axes);
             break;
         }
-        case OP_TYPEID::BroadcastDistributed:
-        {
-            node = make_shared<op::BroadcastDistributed>(args[0]);
-            break;
-        }
         case OP_TYPEID::BroadcastLike:
         {
             auto initial_axes = deserialize_axis_set(node_js.at("initial_axes"));
@@ -2239,8 +2234,6 @@ json JSONSerializer::serialize_node(const Node& n)
         node["shape"] = tmp->get_broadcast_shape();
         break;
     }
-    case OP_TYPEID::BroadcastDistributed: { break;
-    }
     case OP_TYPEID::BroadcastLike:
     {
         auto tmp = static_cast<const op::BroadcastLike*>(&n);
index e3b42c0..db754b1 100644 (file)
@@ -106,15 +106,6 @@ namespace
         EXPECT_FALSE(op::is_binary_elementwise_logical(&node));
     }
 
-    void op_is_BroadcastDistributed()
-    {
-        op::BroadcastDistributed node;
-        EXPECT_FALSE(op::is_unary_elementwise_arithmetic(&node));
-        EXPECT_FALSE(op::is_binary_elementwise_arithmetic(&node));
-        EXPECT_FALSE(op::is_binary_elementwise_comparison(&node));
-        EXPECT_FALSE(op::is_binary_elementwise_logical(&node));
-    }
-
     void op_is_BroadcastLike()
     {
         op::BroadcastLike node;
index f9472b3..edc0fc4 100644 (file)
@@ -37,7 +37,6 @@
 #include "ngraph/runtime/reference/avg_pool.hpp"
 #include "ngraph/runtime/reference/batch_norm.hpp"
 #include "ngraph/runtime/reference/broadcast.hpp"
-#include "ngraph/runtime/reference/broadcast_distributed.hpp"
 #include "ngraph/runtime/reference/ceiling.hpp"
 #include "ngraph/runtime/reference/concat.hpp"
 #include "ngraph/runtime/reference/constant.hpp"
@@ -274,33 +273,6 @@ protected:
                                                node.get_input_shape(2));
             break;
         }
-        case OP_TYPEID::BroadcastDistributed:
-        {
-            const ngraph::op::BroadcastDistributed* broadcast =
-                static_cast<const ngraph::op::BroadcastDistributed*>(&node);
-            int rank_ID;
-            rank_ID = get_distributed_interface()->get_rank();
-            int root_id = broadcast->get_root_id();
-            if (rank_ID == root_id)
-            {
-                reference::broadcastdistributed<T>(
-                    args[0]->get_data_ptr<T>(),
-                    node.get_input_element_type(0),
-                    static_cast<int>(shape_size(node.get_input_shape(0))),
-                    root_id);
-                auto memSize = static_cast<int>(shape_size(node.get_input_shape(0))) * sizeof(T);
-                memcpy(out[0]->get_data_ptr<T>(), args[0]->get_data_ptr<T>(), memSize);
-            }
-            else
-            {
-                reference::broadcastdistributed<T>(
-                    out[0]->get_data_ptr<T>(),
-                    node.get_input_element_type(0),
-                    static_cast<int>(shape_size(node.get_input_shape(0))),
-                    root_id);
-            }
-            break;
-        }
         case OP_TYPEID::BroadcastLike: break;
         case OP_TYPEID::Ceiling:
         {
index c7b4af0..1526f73 100644 (file)
@@ -59,7 +59,6 @@ NGRAPH_OP(Atan, ngraph::op)
 NGRAPH_OP(AvgPool, ngraph::op::v0)
 NGRAPH_OP(BatchNormInference, ngraph::op)
 NGRAPH_OP(Broadcast, ngraph::op)
-NGRAPH_OP(BroadcastDistributed, ngraph::op)
 NGRAPH_OP(BroadcastLike, ngraph::op)
 NGRAPH_OP(Ceiling, ngraph::op)
 NGRAPH_OP(Clamp, ngraph::op)