forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into river/device_name_policy
- Loading branch information
Showing
66 changed files
with
1,181 additions
and
488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/common/snippets/include/snippets/lowered/pass/reduce_decomposition.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (C) 2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include "pass.hpp" | ||
|
||
namespace ov { | ||
namespace snippets { | ||
namespace lowered { | ||
namespace pass { | ||
|
||
/** | ||
* @interface ReduceDecomposition | ||
* @brief Decomposes snippets::Reduce operations to a range of low-level operations on linear IR | ||
* @attention Only Reduce by last dimension is supported | ||
* @ingroup snippets | ||
*/ | ||
class ReduceDecomposition : public RangedPass { | ||
public: | ||
OPENVINO_RTTI("ReduceDecomposition", "RangedPass") | ||
explicit ReduceDecomposition(size_t vector_size); | ||
bool run(LinearIR& linear_ir, LinearIR::constExprIt begin, LinearIR::constExprIt end) override; | ||
|
||
private: | ||
size_t m_vector_size = 0; | ||
}; | ||
|
||
} // namespace pass | ||
} // namespace lowered | ||
} // namespace snippets | ||
} // namespace ov |
32 changes: 0 additions & 32 deletions
32
src/common/snippets/include/snippets/lowered/pass/softmax_decomposition.hpp
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright (C) 2018-2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include "openvino/op/op.hpp" | ||
#include "snippets/shape_inference/shape_infer_instances.hpp" | ||
|
||
namespace ov { | ||
namespace snippets { | ||
namespace op { | ||
|
||
/** | ||
* @interface ReduceBase | ||
* @brief Base class for reduce operations. | ||
* @param m_axis reduce axis. | ||
* @ingroup snippets | ||
*/ | ||
class ReduceBase : public ov::op::Op { | ||
public: | ||
OPENVINO_OP("ReduceBase", "SnippetsOpset"); | ||
|
||
ReduceBase(const Output<Node>& x, size_t axis); | ||
ReduceBase() = default; | ||
|
||
bool visit_attributes(AttributeVisitor& visitor) override; | ||
void validate_and_infer_types() override; | ||
size_t get_axis() const { return m_axis; } | ||
static void compute_and_set_reduce_subtensors(const std::shared_ptr<ReduceBase>& reduce); | ||
|
||
protected: | ||
size_t m_axis = 0; | ||
}; | ||
|
||
class ReduceSum : public ReduceBase { | ||
public: | ||
OPENVINO_OP("ReduceSum", "SnippetsOpset", ReduceBase); | ||
ReduceSum(const Output<Node>& x, size_t axis) : ReduceBase(x, axis) {} | ||
ReduceSum() = default; | ||
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const override; | ||
}; | ||
|
||
class ReduceMax : public ReduceBase { | ||
public: | ||
OPENVINO_OP("ReduceMax", "SnippetsOpset", ReduceBase); | ||
ReduceMax(const Output<Node>& x, size_t axis) : ReduceBase(x, axis) {} | ||
ReduceMax() = default; | ||
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const override; | ||
}; | ||
|
||
} // namespace op | ||
} // namespace snippets | ||
} // namespace ov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/common/snippets/include/snippets/pass/softmax_decomposition.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (C) 2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include "openvino/pass/graph_rewrite.hpp" | ||
#include "openvino/pass/pattern/matcher.hpp" | ||
|
||
namespace ov { | ||
namespace snippets { | ||
namespace pass { | ||
|
||
/** | ||
* @interface SoftmaxDecomposition | ||
* @brief Decomposes Softmax to a range of low-level operations | ||
* @ingroup snippets | ||
*/ | ||
class SoftmaxDecomposition: public ov::pass::MatcherPass { | ||
public: | ||
OPENVINO_RTTI("SoftmaxDecomposition", "0"); | ||
SoftmaxDecomposition(); | ||
}; | ||
|
||
} // namespace pass | ||
} // namespace snippets | ||
} // namespace ov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.