forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Snippets increase subgraph size (#3)
- Implement static TileScheduler to handle compile params processing. Now compile params are accessed only here - TileScheduler should emit code only for necessary scalar/vector Tiles - Perform abstract-to-physical register mapping in one place (currently KernelEmitter constructor) - Implement more precise register mapping, so larger subgraphs could be created (now up to 12 i/o regs instead of 7)
- Loading branch information
1 parent
b33f22c
commit e23ada1
Showing
27 changed files
with
1,189 additions
and
617 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
39 changes: 39 additions & 0 deletions
39
src/common/snippets/include/snippets/op/tile_scheduler.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,39 @@ | ||
// Copyright (C) 2022 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include "ngraph/op/op.hpp" | ||
#include "snippets/emitter.hpp" | ||
#include "tile.hpp" | ||
|
||
namespace ngraph { | ||
namespace snippets { | ||
namespace op { | ||
|
||
/** | ||
* @interface TileScheduler | ||
* @brief Contains a set of Tiles (currently one vector and one scalar) and performs necessary preparations | ||
* before the Tiles could be executed: calculates offsets, sets proper work amounts, decrement pointers if the same data | ||
* have to be read several times (broadcasting). | ||
* @ingroup snippets | ||
*/ | ||
class TileScheduler : public ngraph::op::Op { | ||
public: | ||
OPENVINO_OP("TileScheduler", "SnippetsOpset"); | ||
|
||
TileScheduler(const AllocatedEmitter& vector_region, const AllocatedEmitter& scalar_region); | ||
TileScheduler() = default; | ||
AllocatedEmitter vector_region; | ||
AllocatedEmitter scalar_region; | ||
// todo: this clone_with_new_inputs is irrelevant | ||
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& inputs) const override { | ||
return std::make_shared<TileScheduler>(vector_region, scalar_region); | ||
} | ||
const void *compile_params; | ||
}; | ||
|
||
} // namespace op | ||
} // namespace snippets | ||
} // namespace ngraph |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright (C) 2018-2022 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "snippets/op/tile_scheduler.hpp" | ||
#include "snippets/generator.hpp" | ||
|
||
ngraph::snippets::op::TileScheduler::TileScheduler(const AllocatedEmitter& vector_region, const AllocatedEmitter& scalar_region) | ||
: Op(), vector_region{vector_region}, scalar_region{scalar_region} { | ||
} |
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.