From: Ilya Churaev Date: Thu, 30 Jul 2020 13:27:21 +0000 (+0300) Subject: Removed classes for DistributedInterface, State and Send, Resv v0 operations (#1549) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf4dedbb92cb0d66285042f7cbc64979a6c13118;p=platform%2Fupstream%2Fdldt.git Removed classes for DistributedInterface, State and Send, Resv v0 operations (#1549) * Removed State * Removed Recv and Send operations * Remoced distributed interface --- diff --git a/ngraph/src/ngraph/CMakeLists.txt b/ngraph/src/ngraph/CMakeLists.txt index ac35f31..ce0f291 100644 --- a/ngraph/src/ngraph/CMakeLists.txt +++ b/ngraph/src/ngraph/CMakeLists.txt @@ -64,8 +64,6 @@ set (SRC descriptor/tensor.hpp dimension.cpp dimension.hpp - distributed/null.cpp - distributed/null.hpp distributed.cpp distributed.hpp enum_names.hpp @@ -284,8 +282,6 @@ set (SRC op/quantized_dot.hpp op/range.cpp op/range.hpp - op/recv.cpp - op/recv.hpp op/relu.cpp op/relu.hpp op/replace_slice.cpp @@ -306,8 +302,6 @@ set (SRC op/scatter_update.hpp op/select.cpp op/select.hpp - op/send.cpp - op/send.hpp op/shape_of.cpp op/shape_of.hpp op/sigmoid.cpp @@ -528,10 +522,6 @@ set (SRC slice_plan.hpp specialize_function.cpp specialize_function.hpp - state/bernoulli_rng_state.cpp - state/bernoulli_rng_state.hpp - state/uniform_rng_state.cpp - state/uniform_rng_state.hpp strides.cpp strides.hpp type/bfloat16.cpp diff --git a/ngraph/src/ngraph/distributed.cpp b/ngraph/src/ngraph/distributed.cpp index 24f360b..81fc65e 100644 --- a/ngraph/src/ngraph/distributed.cpp +++ b/ngraph/src/ngraph/distributed.cpp @@ -15,7 +15,6 @@ //***************************************************************************** #include "ngraph/distributed.hpp" -#include "ngraph/distributed/null.hpp" #include "ngraph/log.hpp" #include "ngraph/type.hpp" @@ -41,21 +40,3 @@ std::ostream& reduction::operator<<(std::ostream& out, const reduction::Type& ob { return out << as_string(obj); } - -static std::unique_ptr s_distributed_interface; - -void ngraph::set_distributed_interface(std::unique_ptr distributed_interface) -{ - NGRAPH_DEBUG << "Setting distributed interface to: " << distributed_interface->get_name(); - s_distributed_interface = std::move(distributed_interface); -} - -DistributedInterface* ngraph::get_distributed_interface() -{ - if (nullptr == s_distributed_interface) - { - set_distributed_interface( - std::unique_ptr(new ngraph::distributed::Null())); - } - return s_distributed_interface.get(); -} diff --git a/ngraph/src/ngraph/distributed.hpp b/ngraph/src/ngraph/distributed.hpp index 81ff253..5ca18dd 100644 --- a/ngraph/src/ngraph/distributed.hpp +++ b/ngraph/src/ngraph/distributed.hpp @@ -53,29 +53,4 @@ namespace ngraph static constexpr DiscreteTypeInfo type_info{"AttributeAdapter", 0}; const DiscreteTypeInfo& get_type_info() const override { return type_info; } }; - - class DistributedInterface - { - public: - virtual ~DistributedInterface() {} - virtual const std::string& get_name() const = 0; - virtual int get_size() = 0; - virtual int get_rank() = 0; - - virtual void all_reduce(void* in, - void* out, - element::Type_t element_type, - reduction::Type reduce_type, - size_t count) = 0; - virtual void - broadcast(void* in, element::Type_t element_type, size_t count, int root_id) = 0; - virtual void recv(void* in, element::Type_t element_type, size_t count, int src_id) = 0; - virtual void - send(const void* in, element::Type_t element_type, size_t count, int dest_id) = 0; - }; - - void set_distributed_interface(std::unique_ptr distributed_interface); - - NGRAPH_API - DistributedInterface* get_distributed_interface(); } diff --git a/ngraph/src/ngraph/distributed/null.cpp b/ngraph/src/ngraph/distributed/null.cpp deleted file mode 100644 index 55c5adb..0000000 --- a/ngraph/src/ngraph/distributed/null.cpp +++ /dev/null @@ -1,56 +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 -#include - -#include "ngraph/distributed/null.hpp" -#include "ngraph/except.hpp" - -const std::string& ngraph::distributed::Null::get_name() const -{ - return m_name; -} - -int ngraph::distributed::Null::get_size() -{ - return 0; -} - -int ngraph::distributed::Null::get_rank() -{ - return 0; -} - -void ngraph::distributed::Null::all_reduce(void*, void*, element::Type_t, reduction::Type, size_t) -{ - throw ngraph_error("Distributed Library not supported/mentioned"); -} - -void ngraph::distributed::Null::broadcast(void*, element::Type_t, size_t, int) -{ - throw ngraph_error("Distributed Library not supported/mentioned"); -} - -void ngraph::distributed::Null::recv(void*, element::Type_t, size_t, int) -{ - throw ngraph_error("Distributed Library not supported/mentioned"); -} - -void ngraph::distributed::Null::send(const void*, element::Type_t, size_t, int) -{ - throw ngraph_error("Distributed Library not supported/mentioned"); -} diff --git a/ngraph/src/ngraph/distributed/null.hpp b/ngraph/src/ngraph/distributed/null.hpp deleted file mode 100644 index ff3777a..0000000 --- a/ngraph/src/ngraph/distributed/null.hpp +++ /dev/null @@ -1,55 +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 -#include - -#include "ngraph/distributed.hpp" - -namespace ngraph -{ - namespace distributed - { - class Null : public DistributedInterface - { - const std::string& get_name() const override; - int get_size() override; - int get_rank() override; - void all_reduce(void* in, - void* out, - element::Type_t element_type, - reduction::Type reduce_type, - size_t count) override; - - void broadcast(void* in, - element::Type_t element_type, - size_t count, - int root_id) override; - - void recv(void* in, element::Type_t element_type, size_t count, int src_id) override; - - void send(const void* in, - element::Type_t element_type, - size_t count, - int dest_id) override; - - protected: - std::string m_name{"NULL"}; - }; - } -} diff --git a/ngraph/src/ngraph/op/op_version_tbl.hpp b/ngraph/src/ngraph/op/op_version_tbl.hpp index 04fb7e2..5b5136c 100644 --- a/ngraph/src/ngraph/op/op_version_tbl.hpp +++ b/ngraph/src/ngraph/op/op_version_tbl.hpp @@ -150,7 +150,6 @@ NGRAPH_OP(QuantizedDot, ngraph::op::v0, 0) NGRAPH_OP(RNNCell, ngraph::op::v0, 0) NGRAPH_OP(ROIPooling, ngraph::op::v0, 0) NGRAPH_OP(Range, ngraph::op::v0, 0) -NGRAPH_OP(Recv, ngraph::op::v0, 0) NGRAPH_OP(ReduceMax, ngraph::op::v1, 1) NGRAPH_OP(ReduceLogicalAnd, ngraph::op::v1, 1) NGRAPH_OP(ReduceLogicalOr, ngraph::op::v1, 1) @@ -175,7 +174,6 @@ NGRAPH_OP(ScatterUpdate, ngraph::op::v3, 3) NGRAPH_OP(Select, ngraph::op::v0, 0) NGRAPH_OP(Select, ngraph::op::v1, 1) NGRAPH_OP(Selu, ngraph::op::v0, 0) -NGRAPH_OP(Send, ngraph::op::v0, 0) NGRAPH_OP(ShapeOf, ngraph::op::v0, 0) NGRAPH_OP(ShapeOf, ngraph::op::v3, 3) NGRAPH_OP(ShuffleChannels, ngraph::op::v0, 0) diff --git a/ngraph/src/ngraph/op/recv.cpp b/ngraph/src/ngraph/op/recv.cpp deleted file mode 100644 index 9e29230..0000000 --- a/ngraph/src/ngraph/op/recv.cpp +++ /dev/null @@ -1,53 +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/recv.hpp" - -using namespace std; -using namespace ngraph; - -constexpr NodeTypeInfo op::Recv::type_info; - -op::Recv::Recv(const Output& arg, int src_id) - : Op({arg}) - , m_src_id(src_id) -{ - constructor_validate_and_infer_types(); -} - -void op::Recv::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 op::Recv::clone_with_new_inputs(const OutputVector& new_args) const -{ - check_new_args_count(this, new_args); - return make_shared(new_args.at(0), m_src_id); -} - -int op::Recv::get_src_id() const -{ - return m_src_id; -} diff --git a/ngraph/src/ngraph/op/recv.hpp b/ngraph/src/ngraph/op/recv.hpp deleted file mode 100644 index 1efb29e..0000000 --- a/ngraph/src/ngraph/op/recv.hpp +++ /dev/null @@ -1,54 +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 - -#include "ngraph/op/op.hpp" - -namespace ngraph -{ - namespace op - { - namespace v0 - { - class NGRAPH_API Recv : public Op - { - public: - static constexpr NodeTypeInfo type_info{"Recv", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } - /// \brief Constructs an unitialized recv operation. - Recv() = default; - /// \brief Constructs a Recv operation. - /// - /// \param arg The node for tensor to receive data - /// \param src_id the source id which could be rank or node id. - Recv(const Output& arg, int src_id); - - void validate_and_infer_types() override; - - virtual std::shared_ptr - clone_with_new_inputs(const OutputVector& new_args) const override; - int get_src_id() const; - - private: - int m_src_id; - }; - } - using v0::Recv; - } -} diff --git a/ngraph/src/ngraph/op/send.cpp b/ngraph/src/ngraph/op/send.cpp deleted file mode 100644 index 650f8c6..0000000 --- a/ngraph/src/ngraph/op/send.cpp +++ /dev/null @@ -1,53 +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/send.hpp" - -using namespace std; -using namespace ngraph; - -constexpr NodeTypeInfo op::Send::type_info; - -op::Send::Send(const Output& arg, int dest_id) - : Op({arg}) - , m_dest_id(dest_id) -{ - constructor_validate_and_infer_types(); -} - -void op::Send::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 op::Send::clone_with_new_inputs(const OutputVector& new_args) const -{ - check_new_args_count(this, new_args); - return make_shared(new_args.at(0), m_dest_id); -} - -int op::Send::get_dest_id() const -{ - return m_dest_id; -} diff --git a/ngraph/src/ngraph/op/send.hpp b/ngraph/src/ngraph/op/send.hpp deleted file mode 100644 index 7779a3e..0000000 --- a/ngraph/src/ngraph/op/send.hpp +++ /dev/null @@ -1,54 +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 - -#include "ngraph/op/op.hpp" - -namespace ngraph -{ - namespace op - { - namespace v0 - { - class NGRAPH_API Send : public Op - { - public: - static constexpr NodeTypeInfo type_info{"Send", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } - /// \brief Constructs an unitialized send operation. - Send() = default; - /// \brief Constructs a send operation. - /// - /// \param arg The node for input tensor - /// \param dest_id the target id which could be rank of node id. - Send(const Output& arg, int dest_id); - - void validate_and_infer_types() override; - - virtual std::shared_ptr - clone_with_new_inputs(const OutputVector& new_args) const override; - int get_dest_id() const; - - private: - int m_dest_id; - }; - } - using v0::Send; - } -} diff --git a/ngraph/src/ngraph/ops.hpp b/ngraph/src/ngraph/ops.hpp index c3e3aec..9cdc9b6 100644 --- a/ngraph/src/ngraph/ops.hpp +++ b/ngraph/src/ngraph/ops.hpp @@ -124,7 +124,6 @@ #include "ngraph/op/quantized_dot.hpp" #include "ngraph/op/range.hpp" #include "ngraph/op/read_value.hpp" -#include "ngraph/op/recv.hpp" #include "ngraph/op/reduce_logical_and.hpp" #include "ngraph/op/reduce_logical_or.hpp" #include "ngraph/op/reduce_mean.hpp" @@ -145,7 +144,6 @@ #include "ngraph/op/scatter_nd_update.hpp" #include "ngraph/op/scatter_update.hpp" #include "ngraph/op/select.hpp" -#include "ngraph/op/send.hpp" #include "ngraph/op/shape_of.hpp" #include "ngraph/op/sigmoid.hpp" #include "ngraph/op/sign.hpp" diff --git a/ngraph/src/ngraph/runtime/reference/recv.hpp b/ngraph/src/ngraph/runtime/reference/recv.hpp deleted file mode 100644 index 28f2835..0000000 --- a/ngraph/src/ngraph/runtime/reference/recv.hpp +++ /dev/null @@ -1,34 +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 "ngraph/distributed.hpp" - -namespace ngraph -{ - namespace runtime - { - namespace reference - { - template - void recv(T* arg, const element::Type_t element_type, size_t count, int src_id) - { - get_distributed_interface()->recv(arg, element_type, count, src_id); - } - } - } -} diff --git a/ngraph/src/ngraph/runtime/reference/send.hpp b/ngraph/src/ngraph/runtime/reference/send.hpp deleted file mode 100644 index f7a7e69..0000000 --- a/ngraph/src/ngraph/runtime/reference/send.hpp +++ /dev/null @@ -1,34 +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 "ngraph/distributed.hpp" - -namespace ngraph -{ - namespace runtime - { - namespace reference - { - template - void send(const T* arg, const element::Type_t element_type, size_t count, int dest_id) - { - get_distributed_interface()->send(arg, element_type, count, dest_id); - } - } - } -} diff --git a/ngraph/src/ngraph/serializer.cpp b/ngraph/src/ngraph/serializer.cpp index 0c62509..c0f005a 100644 --- a/ngraph/src/ngraph/serializer.cpp +++ b/ngraph/src/ngraph/serializer.cpp @@ -1701,12 +1701,6 @@ shared_ptr JSONDeserializer::deserialize_node(json node_js) break; } - case OP_TYPEID::Recv: - { - auto src_id = node_js.at("source_id").get(); - node = make_shared(args[0], src_id); - break; - } case OP_TYPEID::Range: { node = make_shared(args[0], args[1], args[2]); @@ -1815,12 +1809,6 @@ shared_ptr JSONDeserializer::deserialize_node(json node_js) node = make_shared(args[0], args[1], args[2]); break; } - case OP_TYPEID::Send: - { - auto dest_id = node_js.at("dest_id").get(); - node = make_shared(args[0], dest_id); - break; - } case OP_TYPEID::ShapeOf: { node = make_shared(args[0]); @@ -2693,12 +2681,6 @@ json JSONSerializer::serialize_node(const Node& n) } case OP_TYPEID::Range: { break; } - case OP_TYPEID::Recv: - { - auto tmp = static_cast(&n); - node["source_id"] = tmp->get_src_id(); - break; - } case OP_TYPEID::Relu: { break; } case OP_TYPEID::ReplaceSlice: @@ -2749,12 +2731,6 @@ json JSONSerializer::serialize_node(const Node& n) } case OP_TYPEID::Selu: { break; } - case OP_TYPEID::Send: - { - auto tmp = static_cast(&n); - node["dest_id"] = tmp->get_dest_id(); - break; - } case OP_TYPEID::ShapeOf: { break; } case OP_TYPEID::ShuffleChannels: diff --git a/ngraph/src/ngraph/state/bernoulli_rng_state.cpp b/ngraph/src/ngraph/state/bernoulli_rng_state.cpp deleted file mode 100644 index 5816b59..0000000 --- a/ngraph/src/ngraph/state/bernoulli_rng_state.cpp +++ /dev/null @@ -1,31 +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 - -#include "bernoulli_rng_state.hpp" -#include "except.hpp" - -using namespace std; -using namespace ngraph; - -void ngraph::BernoulliRNGState::activate() -{ -} - -void ngraph::BernoulliRNGState::deactivate() -{ -} diff --git a/ngraph/src/ngraph/state/bernoulli_rng_state.hpp b/ngraph/src/ngraph/state/bernoulli_rng_state.hpp deleted file mode 100644 index 141fa2e..0000000 --- a/ngraph/src/ngraph/state/bernoulli_rng_state.hpp +++ /dev/null @@ -1,45 +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 -#include -#include - -#include "state.hpp" - -namespace ngraph -{ - class NGRAPH_API BernoulliRNGState : public State - { - public: - BernoulliRNGState(unsigned int seed, double probability) - : State() - , m_generator(seed) - , m_distribution(probability) - { - } - virtual void activate() override; - virtual void deactivate() override; - virtual ~BernoulliRNGState() override {} - std::mt19937& get_generator() { return m_generator; } - std::bernoulli_distribution& get_distribution() { return m_distribution; } - protected: - std::mt19937 m_generator; - std::bernoulli_distribution m_distribution; - }; -} diff --git a/ngraph/src/ngraph/state/state.hpp b/ngraph/src/ngraph/state/state.hpp deleted file mode 100644 index 3930f71..0000000 --- a/ngraph/src/ngraph/state/state.hpp +++ /dev/null @@ -1,36 +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 - -namespace ngraph -{ - class State - { - public: - // TODO: add name and id - State() {} - virtual void activate() = 0; - virtual void deactivate() = 0; - bool is_active() const { return m_is_active; } - void set_active(bool flag) { m_is_active = flag; } - virtual ~State() {} - protected: - bool m_is_active = false; - }; -} diff --git a/ngraph/src/ngraph/state/uniform_rng_state.cpp b/ngraph/src/ngraph/state/uniform_rng_state.cpp deleted file mode 100644 index d70499e..0000000 --- a/ngraph/src/ngraph/state/uniform_rng_state.cpp +++ /dev/null @@ -1,17 +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/state/uniform_rng_state.hpp" diff --git a/ngraph/src/ngraph/state/uniform_rng_state.hpp b/ngraph/src/ngraph/state/uniform_rng_state.hpp deleted file mode 100644 index 45ff945..0000000 --- a/ngraph/src/ngraph/state/uniform_rng_state.hpp +++ /dev/null @@ -1,51 +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 -#include -#include - -#include "state.hpp" - -namespace ngraph -{ - class UniformRNGState : public State - { - public: - UniformRNGState(std::mt19937::result_type seed) - : State() - , m_generator(std::mt19937::result_type(seed)) - , m_distribution() - { - } - UniformRNGState() - : State() - , m_generator(std::random_device()()) - , m_distribution() - { - } - virtual void activate() override {} - virtual void deactivate() override {} - virtual ~UniformRNGState() override {} - std::mt19937& get_generator() { return m_generator; } - std::uniform_real_distribution& get_distribution() { return m_distribution; } - private: - std::mt19937 m_generator; - std::uniform_real_distribution m_distribution; - }; -} diff --git a/ngraph/test/op_is.cpp b/ngraph/test/op_is.cpp index ab319b1..074c1d9 100644 --- a/ngraph/test/op_is.cpp +++ b/ngraph/test/op_is.cpp @@ -691,15 +691,6 @@ namespace EXPECT_FALSE(op::is_binary_elementwise_logical(&node)); } - void op_is_Recv() - { - op::Recv 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_Range() { op::Range node; @@ -799,15 +790,6 @@ namespace EXPECT_FALSE(op::is_binary_elementwise_logical(&node)); } - void op_is_Send() - { - op::Send 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_ShapeOf() { op::ShapeOf node; diff --git a/ngraph/test/runtime/interpreter/int_executable.hpp b/ngraph/test/runtime/interpreter/int_executable.hpp index 55a4f99..9db6fc3 100644 --- a/ngraph/test/runtime/interpreter/int_executable.hpp +++ b/ngraph/test/runtime/interpreter/int_executable.hpp @@ -69,7 +69,6 @@ #include "ngraph/runtime/reference/pad.hpp" #include "ngraph/runtime/reference/product.hpp" #include "ngraph/runtime/reference/quantize.hpp" -#include "ngraph/runtime/reference/recv.hpp" #include "ngraph/runtime/reference/relu.hpp" #include "ngraph/runtime/reference/replace_slice.hpp" #include "ngraph/runtime/reference/reshape.hpp" @@ -78,7 +77,6 @@ #include "ngraph/runtime/reference/reverse_sequence.hpp" #include "ngraph/runtime/reference/round.hpp" #include "ngraph/runtime/reference/select.hpp" -#include "ngraph/runtime/reference/send.hpp" #include "ngraph/runtime/reference/sigmoid.hpp" #include "ngraph/runtime/reference/sign.hpp" #include "ngraph/runtime/reference/sin.hpp" @@ -91,8 +89,6 @@ #include "ngraph/runtime/reference/tanh.hpp" #include "ngraph/runtime/reference/topk.hpp" #include "ngraph/runtime/tensor.hpp" -#include "ngraph/state/bernoulli_rng_state.hpp" -#include "ngraph/state/uniform_rng_state.hpp" #include "op/avg_pool.hpp" namespace ngraph @@ -159,7 +155,6 @@ protected: std::shared_ptr m_function; std::unordered_map, stopwatch> m_timer_map; std::vector> m_nodes; - std::unordered_map> m_states; std::set m_unsupported_op_name_list; static OP_TYPEID get_typeid(const Node& node); @@ -972,19 +967,6 @@ protected: break; } - case OP_TYPEID::Recv: - { - size_t element_count = shape_size(node.get_output_shape(0)); - size_t memSize = element_count * sizeof(T); - const auto* op = static_cast(&node); - int src_id = op->get_src_id(); - - reference::recv( - args[0]->get_data_ptr(), node.get_input_element_type(0), element_count, src_id); - - memcpy(out[0]->get_data_ptr(), args[0]->get_data_ptr(), memSize); - break; - } case OP_TYPEID::Relu: { size_t element_count = shape_size(node.get_output_shape(0)); @@ -1051,21 +1033,6 @@ protected: element_count); break; } - case OP_TYPEID::Send: - { - size_t element_count = shape_size(node.get_output_shape(0)); - size_t memSize = element_count * sizeof(T); - const auto* op = static_cast(&node); - int dest_id = op->get_dest_id(); - - reference::send(args[0]->get_data_ptr(), - node.get_input_element_type(0), - element_count, - dest_id); - - memcpy(out[0]->get_data_ptr(), args[0]->get_data_ptr(), memSize); - break; - } case OP_TYPEID::Sigmoid: { size_t element_count = shape_size(node.get_output_shape(0)); diff --git a/ngraph/test/runtime/opset0_tbl.hpp b/ngraph/test/runtime/opset0_tbl.hpp index 5a40ecd..2575b7b 100644 --- a/ngraph/test/runtime/opset0_tbl.hpp +++ b/ngraph/test/runtime/opset0_tbl.hpp @@ -120,7 +120,6 @@ NGRAPH_OP(Product, ngraph::op) NGRAPH_OP(Quantize, ngraph::op) NGRAPH_OP(QuantizedConvolution, ngraph::op) NGRAPH_OP(QuantizedDot, ngraph::op) -NGRAPH_OP(Recv, ngraph::op) NGRAPH_OP(Range, ngraph::op) NGRAPH_OP(Relu, ngraph::op) NGRAPH_OP(ReplaceSlice, ngraph::op) @@ -132,7 +131,6 @@ NGRAPH_OP(RNNCell, ngraph::op) NGRAPH_OP(Round, ngraph::op) NGRAPH_OP(Select, ngraph::op) NGRAPH_OP(Selu, ngraph::op) -NGRAPH_OP(Send, ngraph::op) NGRAPH_OP(ShapeOf, ngraph::op) NGRAPH_OP(ShuffleChannels, ngraph::op) NGRAPH_OP(Sigmoid, ngraph::op)