Removed BroadcastDistributed (#1430)
This commit is contained in:
parent
98ad4ac869
commit
3bbdda6b48
@ -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
|
||||
|
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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)
|
||||
|
@ -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"
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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:
|
||||
{
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user