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

How to debug OpenVINO and OpenVINO Python bindings using VS Code #23122

Open
2 tasks
sanbuphy opened this issue Feb 28, 2024 · 9 comments
Open
2 tasks

How to debug OpenVINO and OpenVINO Python bindings using VS Code #23122

sanbuphy opened this issue Feb 28, 2024 · 9 comments
Assignees
Labels
category: docs OpenVINO documentation no_stale Do not mark as stale

Comments

@sanbuphy
Copy link

Context

Many beginners struggle with not knowing how to debug the internal code and its corresponding binding code, and they lack a fast and best practice reference, which makes it difficult for them to get started. Therefore, we need a well-documented process that covers using VS Code to debug the source code, reproduce issues, and perform testing.

What needs to be done?

  • Provide a documentation on compiling OpenVINO using VS Code in a Linux environment.

  • Provide documentation on using VS Code to debug OpenVINO C++ and Python components.

Example Pull Requests

No response

Resources

Contact points

@p-wysocki

Ticket

No response

@sanbuphy sanbuphy added good first issue Good for newcomers no_stale Do not mark as stale labels Feb 28, 2024
@github-project-automation github-project-automation bot moved this to Contributors Needed in Good first issues Feb 28, 2024
@sanbuphy
Copy link
Author

.take

Copy link
Contributor

Thank you for looking into this issue! Please let us know if you have any questions or require any help.

@mlukasze mlukasze moved this from Contributors Needed to Assigned in Good first issues Feb 28, 2024
@andrei-kochin andrei-kochin added the category: docs OpenVINO documentation label Feb 29, 2024
@p-wysocki
Copy link
Contributor

Hello @sanbuphy, is there anything we could help you with?

@sanbuphy
Copy link
Author

sanbuphy commented Mar 12, 2024

Hello @sanbuphy, is there anything we could help you with?

Don't worry! i'm still wrting the article, (in cn we work too busy so it looks slow,but i will try to create a draft pull request this week :)

@sanbuphy
Copy link
Author

sanbuphy commented Mar 20, 2024

Hello @sanbuphy, is there anything we could help you with?

Hi wysocki,Could you tell me where should i create the PR about how to debug python and c++ code in openvino?
Which directory would be better to place this document in?

@p-wysocki
Copy link
Contributor

Question has been answered in Discord, I apologize for missing your question here. :)

@sanbuphy
Copy link
Author

sanbuphy commented May 5, 2024

Question has been answered in Discord, I apologize for missing your question here. :)

That's OK, got it; Thank you.

I am currently writing this tutorial but I've encountered a problem. I would like to ask:
If I want to debug the execution process of specific OpenVINO ops or nodes, in which cpp file should I set breakpoints? Which Python file needs to be run with pytest, and what compilation options should be enabled? For example, how should I proceed if I want to debug the convolution node or EP ? Thank you ,i need some file to make tutorial or you can recommand some easy function (including the cpp and python bindings) to me

@p-wysocki
Copy link
Contributor

p-wysocki commented May 6, 2024

If I want to debug the execution process of specific OpenVINO ops or nodes

I think we should stick to debugging the Python bindings themselves, because op definitions and so on are usually tested natively in C++, especially that in the bindings tests for operators we only run shape inference and type propagation, but no actual data calculations.

i need some file to make tutorial or you can recommand some easy function (including the cpp and python bindings) to me

I think that any non-trivial binding (I mean one that has enough lines that there's actually something to check) can be an example. You can choose any binding from src/bindings/python/src/pyopenvino/. I think that a common function such as compile_model would be perfect:

cls.def(
"compile_model",
[](ov::Core& self,
const py::object& model_buffer,
const py::object& weight_buffer,
const std::string& device_name,
const std::map<std::string, py::object>& properties) {

@jiwaszki @akuporos what do you think? Do you have an idea of what we would like that guide to look like?

@sanbuphy
Copy link
Author

sanbuphy commented May 6, 2024

If I want to debug the execution process of specific OpenVINO ops or nodes

I think we should stick to debugging the Python bindings themselves, because op definitions and so on are usually tested natively in C++, especially that in the bindings tests for operators we only run shape inference and type propagation, but no actual data calculations.

i need some file to make tutorial or you can recommand some easy function (including the cpp and python bindings) to me

I think that any non-trivial binding (I mean one that has enough lines that there's actually something to check) can be an example. You can choose any binding from src/bindings/python/src/pyopenvino/. I think that a common function such as compile_model would be perfect:

cls.def(
"compile_model",
[](ov::Core& self,
const py::object& model_buffer,
const py::object& weight_buffer,
const std::string& device_name,
const std::map<std::string, py::object>& properties) {

@jiwaszki @akuporos what do you think? Do you have an idea of what we would like that guide to look like?

Thanks ! get it , and i also want to write the guide how to debug op definitions in c++ test file (The debug guide will include common situation in vino debugging)

But i have another question : how can i see the c++ variable inside in vscode ? it will looks like :
image

@mlukasze mlukasze changed the title [Good First Issue]: How to debug OpenVINO and OpenVINO Python bindings using VS Code How to debug OpenVINO and OpenVINO Python bindings using VS Code Jul 25, 2024
@mlukasze mlukasze removed the good first issue Good for newcomers label Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: docs OpenVINO documentation no_stale Do not mark as stale
Projects
None yet
Development

No branches or pull requests

4 participants