Open gkrivor opened 11 months ago
Hello I woulld like to work on this issue.
Thank you for giving me this issue to work on.
I have created a table regarding the differences and changes in different versions of average pooling, however I am not getting on how to put these changes into the repository as mentioned in the issue. It would be great if I could get some help regarding this.
Hi, could you put your table here?
Sure, here is the table of differences I infered and created from the documentation link provided in the issue.
I am also attatching my fork so you can see the changes which I have made till now https://github.com/Sukhvansh2004/openvino.git
@gkrivor sir, I had forgotten to put a small change in op-7 to the initial version of avg pool. Could you furthur assist me regarding the onnx frontend on how and where all to change the code. I have read the frontend docs but still facing some difficulties and issues, would be great if you could assist.
@p-wysocki @gkrivor Sir, I have quite some changes in the repo to align op-7, 10, 11 and 19, however to make any changes furthur I would need to run test cases for which I would be required to build the repo, but for some reason my CMake command is giving errors while building the repo could you pls help me with this.
I am getting the following error.
-- CMAKE_VERSION ......................... 3.28.1 -- OpenVINO_SOURCE_DIR ................... C:/Users/Sukhvansh Jain/Desktop/Open source/OpenVINO/openvino -- OpenVINO_BINARY_DIR ................... C:/Users/Sukhvansh Jain/Desktop/Open source/OpenVINO/openvino/build -- CMAKE_GENERATOR ....................... Visual Studio 16 2019 -- CPACK_GENERATOR ....................... TGZ -- CMAKE_C_COMPILER_ID ................... MSVC -- CMAKE_CXX_COMPILER_ID ................. MSVC -- CMAKE_CXX_STANDARD .................... 14 -- CMAKE_CONFIGURATION_TYPES ............. Debug Release MinSizeRel RelWithDebInfo CMake Error at thirdparty/ocl/CMakeLists.txt:41 (add_subdirectory): The source directory
C:/Users/Sukhvansh Jain/Desktop/Open source/OpenVINO/openvino/thirdparty/ocl/icd_loader
does not contain a CMakeLists.txt file.
CMake Error at thirdparty/ocl/CMakeLists.txt:44 (target_compile_definitions): Cannot specify compile definitions for target "OpenCL" which is not built by this project.
CMake Error at thirdparty/ocl/CMakeLists.txt:46 (target_include_directories): Cannot specify include directories for target "OpenCL" which is not built by this project.
CMake Error at thirdparty/dependencies.cmake:98 (get_target_property): get_target_property() called with non-existent target "OpenCL::OpenCL". Call Stack (most recent call first): CMakeLists.txt:136 (include)
-- 3.20.3.0 -- Configuration script parsing status [ -- Description : Protocol Buffers -- Version : 3.20.3.0 (3.20.3) -- Contact : protobuf@googlegroups.com -- ] -- Protocol Buffers Configuring done -- Proceeding with version: 23.3.3.0 -- CMAKE_CXX_FLAGS: /DWIN32 /D_WINDOWS /GR /EHsc /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /EHsc /Gy /W3 /bigobj /MP /wd4251 /wd4275 CMake Warning (dev) at thirdparty/onnx/onnx/CMakeLists.txt:112 (find_package): Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules are removed. Run "cmake --help-policy CMP0148" for policy details. Use the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Protobuf compiler : -- Protobuf includes : -- Protobuf libraries : -- BUILD_ONNX_PYTHON : OFF -- Using the multi-header code from C:/Users/Sukhvansh Jain/Desktop/Open source/OpenVINO/openvino/thirdparty/json/nlohmann_json/include/ -- TBB (2021.2.2) is found at C:/Users/Sukhvansh Jain/Desktop/Open source/OpenVINO/openvino/temp/tbb/lib/cmake/TBB -- Static tbbbind_2_5 package usage is disabled, since oneTBB (ver. 2021.2.2) provides dynamic TBBBind 2.5+ CMake Error at src/plugins/intel_cpu/thirdparty/CMakeLists.txt:139 (add_subdirectory): The source directory
C:/Users/Sukhvansh Jain/Desktop/Open source/OpenVINO/openvino/src/plugins/intel_cpu/thirdparty/mlas
does not contain a CMakeLists.txt file.
CMake Error at src/plugins/intel_cpu/thirdparty/CMakeLists.txt:118 (add_subdirectory): The source directory
C:/Users/Sukhvansh Jain/Desktop/Open source/OpenVINO/openvino/src/plugins/intel_cpu/thirdparty/onednn
does not contain a CMakeLists.txt file. Call Stack (most recent call first): src/plugins/intel_cpu/thirdparty/CMakeLists.txt:143 (ov_add_onednn)
-- Python3 executable: C:/Users/Sukhvansh Jain/AppData/Local/Programs/Python/Python310/python.exe -- Python3 version: 3.10.9 -- Python3 interpreter ID: Python -- Python3 SOABI: cp310-win_amd64 -- Python3 include dirs: C:/Users/Sukhvansh Jain/AppData/Local/Programs/Python/Python310/include -- Python3 libraries: C:/Users/Sukhvansh Jain/AppData/Local/Programs/Python/Python310/libs/python310.lib CMake Warning at samples/cpp/common/format_reader/CMakeLists.txt:22 (message): OpenCV ver. 3.0+ is not found, format_reader will be built without OpenCV support
CMake Warning at samples/cpp/benchmark_app/CMakeLists.txt:104 (message): OpenCL CPP header is not found, benchmark_app will be built without OpenCL support and you will not be able to use the '-use_device_mem' option. Please, install '<apt | yum> install opencl-headers' to enable the option
CMake Warning at samples/cpp/benchmark_app/CMakeLists.txt:112 (message): OpenCV ver. 3.0+ is not found, benchmark_app will be built without OpenCV support. Set OpenCV_DIR
CMake Warning at samples/c/common/opencv_c_wrapper/CMakeLists.txt:20 (message): OpenCV ver. 3.0+ is not found, opencv_c_wrapper is built without OPENCV support
-- Register template to be built in build-modules/template -- Register template_extension to be built in build-modules/template_extension CMake Warning at tools/mo/CMakeLists.txt:5 (message): Please enable OpenVINO Runtime Python API (set -DENABLE_PYTHON=ON) targets to enable Model Optimizer target
CMake Warning at cmake/developer_package/shellcheck/shellcheck.cmake:22 (message): shellcheck tool is not found Call Stack (most recent call first): scripts/CMakeLists.txt:18 (ov_shellcheck_process)
-- Configuring incomplete, errors occurred!
Hi, sorry for a delay, I have a time to check github tuesday-wednesday :(
Looks like a great solution, but you touched a core part of OpenVINO, I'm not sure it is necessary.
I think you've overcomplicated the solution. Let me check. I thought about something like this, it should be enough: https://github.com/openvinotoolkit/openvino/blob/master/src/frontends/onnx/frontend/src/op/softmax.cpp
Currently, biggest problem which requires are alignment/refactoring is a "some common implementation" of a translation function. What does it mean? It means it looks like as an any of documented opset (for example, 7,10,11,19), but doesn't implement exact opset functionality (allows to use an undocumented input types, use wrong inputs, etc).
That's why we want to align behavior with the original documentation. Because otherwise, when you pass a model with a 19 opset it fails due to a common implementation uses wrong input (input instead of an attribute, as example), but you will get any possible error and will spend a lot of time to understand what goes wrong. I'm sure previous approach was very good for a fast implementation. But now it cause a misunderstanding while debugging and enabling new opsets.
Hello, I've left review comments within the mentioned PR #22075, but let me put the summary here as well.
Most of the currently failing ONNX AvgPool compliance tests are related to the "dilations" attribute, and in fact to cover it, new version of the ov AvgPool is needed (as it was done for ov MaxPool op). But to enable new ov Op not only new class of AvgPool is needed, but also the plugin implementation.
@gkrivor We should cover such request internally or by a separate, precisely described task for contributors.
.take
Thank you for looking into this issue! Please let us know if you have any questions or require any help.
Hello @awayzjj, are you still working on this? Do you need any help?
Hello @awayzjj, are you still working on this? Do you need any help?
Yes, sorry for the late, I will create a PR this weekend.
@gkrivor @mitruska Hi I aligned the behavior of AveragePool-7, 10, and 11, and created a PR.
The AveragePool-19 added the dilations
attribute as referenced in the ONNX documentation, but the average_pool operator in OpenVINO does not support it. I want to reference how the max-pool operator handles the dilations
attribute:
Here is how the max-pool operator handles the dilations
attribute in its evaluate
method:
https://github.com/openvinotoolkit/openvino/blob/999e20a0e7831fb945dc118980c8bcb10ec1191f/src/core/src/op/max_pool.cpp#L419-L429
Its evaluate method ultimately calls reference::max_pool
:
https://github.com/openvinotoolkit/openvino/blob/999e20a0e7831fb945dc118980c8bcb10ec1191f/src/core/src/op/max_pool.cpp#L189-L196
However, I found that the AvgPool operator does not override the evaluate
method:
https://github.com/openvinotoolkit/openvino/blob/999e20a0e7831fb945dc118980c8bcb10ec1191f/src/core/include/openvino/op/avg_pool.hpp#L51-L91
Could you provide some guidance on where and how I should add the dilations
attribute to the op?
@p-wysocki fyi
Context
Neural networks are graphs consisting of nodes called operators. Each operator corresponds to a mathematical function, usually described in framework's documentation or an AI standard, such as ONNX. OpenVINO ONNX Frontend is a component responsible for working with ONNX graphs and requires implementation of different ONNX operators in order to use ONNX models. This task requires alignment between OpenVINO ONNX Frontend and original framework implementations of AveragePool for next list of opsets: opset 7, opset 10, opset 11, opset 19 Necessary help will be provided by ONNX Fronted team.
What needs to be done?
Operator details can be found in ONNX Operators More details can be found in ONNX Changelog: opset 7, opset 10, opset 11, opset 19
Example Pull Requests
No response
Resources
Contact points
@gkrivor
Ticket
No response