Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snippets] Added support of Port Descriptor #106

Conversation

a-sidorova
Copy link
Owner

Details:

  • item1
  • ...

Tickets:

  • ticket-id

@a-sidorova a-sidorova force-pushed the feature/snippets/lin_ir/port_desc branch from 34e4cc0 to 938afe3 Compare May 4, 2023 07:21
Copy link
Collaborator

@IvanNovoselov IvanNovoselov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1st part

src/common/snippets/src/lowered/expression.cpp Outdated Show resolved Hide resolved
src/common/snippets/include/snippets/port_descriptor.hpp Outdated Show resolved Hide resolved
src/common/snippets/src/lowered/linear_ir.cpp Show resolved Hide resolved
src/common/snippets/src/lowered/linear_ir.cpp Outdated Show resolved Hide resolved
src/common/snippets/src/lowered/linear_ir.cpp Outdated Show resolved Hide resolved
src/common/snippets/src/lowered/linear_ir.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@IvanNovoselov IvanNovoselov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2nd part

src/common/snippets/include/snippets/op/brgemm.hpp Outdated Show resolved Hide resolved
src/common/snippets/src/pass/matmul_to_brgemm.cpp Outdated Show resolved Hide resolved
src/common/snippets/src/lowered/expression_factory.cpp Outdated Show resolved Hide resolved
src/common/snippets/src/port_descriptor.cpp Outdated Show resolved Hide resolved
}
}

PortDescriptor PortDescriptor::deserialize(const std::string& serialized_info) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor for discussion: do we really need deserialization of Port descriptor? If we do, than is it sufficient to enable correct serialization-deserialization of the subgraph?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know because I just moved it from TensorDescriptor too. I don't know for what it, to be honest. I removed it.
Moreover, I don't understand why we need serialization :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's discuss it on review of the main PR.

template<typename T>
void set_full_port_desc(const T& port) {
const auto& shape = port.get_shape();
ngraph::snippets::PortManager::set_port_descriptor_ptr(port, std::make_shared<ngraph::snippets::PortDescriptor>(shape,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we absolutely need subtensor filled with FULL_DIM here? Can it just be equal to shape?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use in general shape for subtensor. Because just image that we have Brgemm with input_shape0=[1,16]. It's equal to common subtensor for eltwises. But we mustn't add Brgemm and Eltwise into one Loop. So to avoid these situations, I added the separate flag FULL_DIM - it fully described schedule by full axis.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Discussed offline: use VECTOR_SIZE instead of FULL_DIM

@a-sidorova a-sidorova force-pushed the feature/snippets/lin_ir/port_desc branch from ea5e09a to af947cb Compare May 10, 2023 06:47
@a-sidorova a-sidorova force-pushed the feature/snippets/lin_ir/port_desc branch from af947cb to 1f76a5d Compare May 10, 2023 08:04
@a-sidorova a-sidorova merged commit 22fd346 into feature/snippets/lin_ir/loop_fusion_insert May 11, 2023
a-sidorova added a commit that referenced this pull request May 11, 2023
* [Snippets] Added support of Port Descriptor

* review

* Added Softmax support via common pipeline

* Added Brgemm marking via general pipeline

* TensorDescriptor -> ExpressionPort

* Refactored expression factory

* ExpressionPort - is interface

* refactoring

* fixed init loops

* fixed brgemm ops

* Moved PortDescriptor to lowered level

* Removed PortDesc getters and setters from ExpressionPort and Tensor

* Applied comments
a-sidorova added a commit that referenced this pull request May 16, 2023
* [Snippets] Added support of Port Descriptor

* review

* Added Softmax support via common pipeline

* Added Brgemm marking via general pipeline

* TensorDescriptor -> ExpressionPort

* Refactored expression factory

* ExpressionPort - is interface

* refactoring

* fixed init loops

* fixed brgemm ops

* Moved PortDescriptor to lowered level

* Removed PortDesc getters and setters from ExpressionPort and Tensor

* Applied comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants