-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Improve logging of the matching process #28587
Open
CuriousPanCake
wants to merge
42
commits into
openvinotoolkit:master
Choose a base branch
from
CuriousPanCake:CVS-151312_exp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
37532da
wip
CuriousPanCake c11593f
some git fix
CuriousPanCake a25fa61
wip2
CuriousPanCake 21daf79
wip3
CuriousPanCake 2b6ebe6
wip4: very working prototype
CuriousPanCake 2e050e6
working version
CuriousPanCake 0f08cbc
fix namespace
CuriousPanCake d3c03db
clear code
CuriousPanCake 738578b
more cleaning
CuriousPanCake 7331229
more clean up
CuriousPanCake 77e1c75
Merge branch 'master' into CVS-151312_exp
CuriousPanCake dd54af5
cleaning
CuriousPanCake 1fec8fc
supported GenericPattern, many other small improvements
CuriousPanCake 4029bf9
fix exception throwing
CuriousPanCake 14f34d9
add verbose option
CuriousPanCake 1b660bf
added switching on/off using env variable
CuriousPanCake ec2d547
added colors
CuriousPanCake b4de07d
almost done
CuriousPanCake 62e4e79
clearing code
CuriousPanCake d531cbe
more cleaning
CuriousPanCake 8a2258c
removed unnecessary comment
CuriousPanCake 1b290bc
Merge branch 'master' into CVS-151312_exp
CuriousPanCake 6a95342
add linux/macos includes only
CuriousPanCake 0cb7ae3
move readme.md to transformations/docs
CuriousPanCake 66d2bb3
some review concerns
CuriousPanCake 5614250
Merge branch 'master' into CVS-151312_exp
CuriousPanCake 64ecc2f
replace level strings with macro def
CuriousPanCake 9493efe
code style, move docs
CuriousPanCake ddde0c7
make level string a singleton, rework logs into macro, apply review c…
CuriousPanCake 70eaefc
clear code
CuriousPanCake b3f222b
code style
CuriousPanCake 6857d04
OPENVINO_LOG_OR
CuriousPanCake e9d035b
fix review concerns
CuriousPanCake 7497667
rename doc files
CuriousPanCake 614958d
fixed multiple review concerns
CuriousPanCake 169262f
add images
CuriousPanCake 310f6d7
remove images
CuriousPanCake 164be9b
clear code
CuriousPanCake 688ae40
code style
CuriousPanCake 4e55038
Using the friendly name instead of the autogenerated
itikhono 2c525f3
Merge branch 'master' into CVS-151312_exp
itikhono 695db12
Merge branch 'master' into CVS-151312_exp
dorloff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Transformations documentation | ||
|
||
## Debug capabilities | ||
|
||
* [Matcher logging README](./debug_capabilities/LOGGING_README.md) | ||
|
||
## Key Contacts | ||
|
||
For assistance regarding snippets, contact a member of [openvino-ie-transformations-maintainers](https://github.com/orgs/openvinotoolkit/teams/openvino-ie-transformations-maintainers) group. | ||
|
||
## See also | ||
|
||
* [OpenVINO™ README](../../../README.md) | ||
* [OpenVINO Core Components](../../README.md) | ||
* [Developer documentation](../../../docs/dev/index.md) |
22 changes: 22 additions & 0 deletions
22
src/common/transformations/docs/debug_capabilities/matcher_logging.md
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,22 @@ | ||
# Logging of the pattern matching | ||
|
||
The logging functionality allows to observe/debug the pattern matching process. | ||
|
||
## Usage | ||
In order to utilzie the logging, first, you need to set the CMake flag ```-DENABLE_OPENVINO_DEBUG=ON``` | ||
|
||
_NOTE: the logging would also work if your build is configured as Release_ | ||
|
||
In order to start logging, set the environmental variable ```OV_MATCHER_LOGGING``` to ``true/ON`` before running your executable or script as following: | ||
```OV_MATCHER_LOGGING=true ./your_amazing_program``` | ||
|
||
If you want to log only specific matchers, use the ```OV_MATCHERS_TO_LOG``` environmental variable and provide their names separated as commas: | ||
```OV_MATCHER_LOGGING=true OV_MATCHERS_TO_LOG=EliminateSplitConcat,MarkDequantization ./your_amazing_program``` | ||
|
||
You can also set the environmental variable ```OV_VERBOSE_LOGGING``` to ```true```, to turn on more verbose logging that would print more information about the nodes taking part in the matching process: | ||
```OV_MATCHER_LOGGING=true OV_VERBOSE_LOGGING=true ./your_amazing_program``` | ||
|
||
## Useful feature: | ||
If you redirect the logging output into a .json file (extension is important for the correct processing of the file in Visual Studio Code). This allows collapsing blocks in Visual Studio Code as you would do with a normal .json file. | ||
|
||
If you have any suggestions for improvement or you observe a bug in logging, feel free to submit changes or contact Andrii Staikov <[email protected]> |
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 | ||||
---|---|---|---|---|---|---|
|
@@ -6,7 +6,7 @@ | |||||
|
||||||
#include <cstdint> | ||||||
#include <string> | ||||||
|
||||||
#include <unordered_set> | ||||||
namespace ov { | ||||||
namespace util { | ||||||
/// \brief Get the names environment variable as a string. | ||||||
|
@@ -31,5 +31,12 @@ int32_t getenv_int(const char* env_var, int32_t default_value = -1); | |||||
/// \param default_value The value to return if the environment variable is not set. | ||||||
/// \return Returns the boolean value of the environment variable. | ||||||
bool getenv_bool(const char* env_var, bool default_value = false); | ||||||
|
||||||
/// \brief Splits a string using by a single character delimiter | ||||||
/// without modifying the original string | ||||||
/// \param str String to split | ||||||
/// \param delimiter Delimiter to use for splitting | ||||||
/// \return Returns an unordered set of split strings | ||||||
std::unordered_set<std::string> split_by_delimiter(const std::string& str, char delimiter); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move it to "common_util.hpp"
Suggested change
Return value can remove some split strings, it can be always created from vector. |
||||||
} // namespace util | ||||||
} // namespace ov |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just topic for future improvements, maybe is possible to merge these two log macros into one?