[Paddle] Add paddle frontend developer guide. (#13464)

* Update src/frontends/paddle/README.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* [Paddle] Add paddle frontend developer guide.

* add png.

* Update src/frontends/paddle/docs/paddle_frontend_architecture.md

Co-authored-by: Ilya Churaev <ilyachur@gmail.com>

* Update src/frontends/paddle/README.md

Co-authored-by: Ilya Churaev <ilyachur@gmail.com>

* Update src/frontends/paddle/README.md

Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Update src/frontends/paddle/README.md

Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Update src/frontends/paddle/docs/paddle_frontend_architecture.md

Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Update src/frontends/paddle/docs/paddle_frontend_architecture.md

Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Update src/frontends/paddle/docs/tests.md

Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Update src/frontends/paddle/docs/paddle_frontend_architecture.md

Co-authored-by: mei, yang <yang.mei@intel.com>

* fix CR.

* unit test path

* Update src/frontends/paddle/docs/paddle_frontend_architecture.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update src/frontends/paddle/docs/tests.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update src/frontends/paddle/docs/paddle_frontend_architecture.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update src/frontends/paddle/README.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update src/frontends/paddle/README.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update src/frontends/paddle/README.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update src/frontends/paddle/README.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* fix with mermaid.

* fix

* fix

* Update src/frontends/paddle/README.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* fix

* fix

* Update src/frontends/paddle/README.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update src/frontends/paddle/README.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update src/frontends/paddle/docs/tests.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update src/frontends/paddle/docs/tests.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update src/frontends/paddle/README.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update src/frontends/paddle/docs/paddle_frontend_architecture.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update src/frontends/paddle/docs/tests.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update src/frontends/paddle/README.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* more specific

* Apply suggestions from code review

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>
Co-authored-by: Ilya Churaev <ilyachur@gmail.com>
Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
Co-authored-by: mei, yang <yang.mei@intel.com>
Co-authored-by: Ilya Churaev <ilya.churaev@intel.com>
This commit is contained in:
cecilia peng 2022-12-20 17:01:43 +08:00 committed by GitHub
parent 88456e6c3c
commit 8ef6ad3665
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 100 additions and 0 deletions

View File

@ -0,0 +1,34 @@
# OpenVINO™ Paddle Frontend
OpenVINO Paddle Frontend is one of the OpenVINO Frontend libraries created for the Baidu PaddlePaddle™ framework.
The component is responsible for:
* Paddle Reader - reads a PaddlePaddle protobuf model and parses it to the frontend InputModel. [Learn more about Paddle Frontend architecture.](./docs/paddle_frontend_architecture.md).
* Paddle Converter - decodes a PaddlePaddle model and operators and maps them semantically to the OpenVINO opset. [Learn more about the operator mapping flow.](./docs/operation_mapping_flow.md).
OpenVINO Paddle Frontend uses [the common coding style rules](../../../docs/dev/coding_style.md).
## Key contacts
People from the [openvino-ie-paddle-maintainers](https://github.com/orgs/openvinotoolkit/teams/openvino-ie-paddle-maintainers) have the rights to approve and merge PRs to the Paddle frontend component. They can assist with any questions about the component.
## Components
OpenVINO Paddle Frontend has the following structure:
* [docs](./docs) contains developer documentation for the component.
* [include](./include) contains module API and detailed information about the provided API.
* [src](./src) folder contains sources of the component.
* [tests](./tests) contains tests for the component. To get more information, read [How to run and add tests](./docs/tests.md) page.
## Debug capabilities
Developers can use OpenVINO Model debug capabilities that are described in the [OpenVINO Model User Guide](https://docs.openvino.ai/nightly/openvino_docs_OV_UG_Model_Representation.html#model-debug-capabilities).
## Tutorials
* [How to support a new operator](./docs/operation_mapping_flow.md)
* [How to run and add tests](./docs/tests.md)
## See also
* [OpenVINO™ README](../../README.md)
* [OpenVINO Core Components](../README.md)
* [Developer Documentation](../../../docs/dev/index.md)

View File

@ -0,0 +1,13 @@
# OpenVINO Paddle Frontend Operator Enabling Flow
1. Declare `CreatorFunction` for the Paddle operator and register it to the map in `src/op_table.cpp`.
* The map is retrived from:
https://github.com/openvinotoolkit/openvino/blob/7d5e0abcaa03703de9918ece2115e6ea652c39e0/src/frontends/paddle/src/op_table.cpp#L106
2. Implement the operator mapper `CreatorFunction` in the `src/op/` path.
3. Add unit-tests. For more information, refer to the [OpenVINO™ Paddle Frontend unit-tests readme](tests.md)
## See also
* [OpenVINO™ Paddle Frontend README](../README.md)
* [OpenVINO™ Frontend README](../../README.md)

View File

@ -0,0 +1,36 @@
# OpenVINO™ Paddle Frontend Architecture
The diagram below shows the Paddle Frontend architecture and its interaction with OpenVINO Frontend API and Core APIs.
```mermaid
flowchart TB
fw_model[(Paddle Model)]
style fw_model fill:#427cb0
protobuf([protobuf])
subgraph frontend [ov::frontend::paddle::FrontEnd]
load_impl["load_impl()"]
end
fw_model--as stream-->load_impl
load_impl--load stream-->protobuf
protobuf--parsed object-->load_impl
subgraph input_model [ov::frontend::paddle::InputModel]
convert["convert()"]
end
load_impl--create-->input_model
ov_model[ov::Model]
convert--recursively parse all operations from the model-->ov_model
```
* The input to the Paddle Frontend is a PaddlePaddle protobuf model, and the output is the `ov::Model` which is semantically equivalent to the input.
* Paddle Frontend is an implementation of the OpenVINO Frontend, which implements two main interfaces. The first interface is `load`, which reads a Paddle protobuf model and represents it using `InputModel` with `OpPlaces` and `TensorPlaces`. The second interface is `convert`, which represents the `InputModel` with `ov::Model` by semantically mapping these Places to the OpenVINO opset.
## See also
* [OpenVINO™ Paddle Frontend README](../README.md)
* [OpenVINO™ Frontend README](../../README.md)

View File

@ -0,0 +1,17 @@
# OpenVINO Paddle Frontend Tests
OpenVINO Paddle Frontend [tests](../tests) have the following structure:
* `test_models/gen_scripts/` - Python script to generate PaddlePaddle test models with handy helpers.
* `standalone_build` - PaddlePaddle frontend standalone build test.
* a couple of files - PaddlePaddle frontend operator set unit-test framework and Paddle frontend API unit-test written using Google Test.
## How to build and run tests
OpenVINO Paddle Frontend is covered by tests from the binary `paddle_tests`. This binary can be built by the target with the same name.
## How to add a unit-test
1. Implement python script in `test_models/gen_scripts/` to get the PaddlePaddle test model and the reference inputs and outputs from PaddlePaddle.
2. Register the test case name to `tests/src/op_fuzzy.cpp`, which is part of the operator set unit-test framework.
## See also
* [OpenVINO™ Paddle Frontend README](../README.md)