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

Monitor Framework #24079

Merged
merged 6 commits into from
Jun 16, 2020
Merged

Monitor Framework #24079

merged 6 commits into from
Jun 16, 2020

Conversation

hutuxian
Copy link
Contributor

@hutuxian hutuxian commented Apr 22, 2020

PR types

New features

PR changes

Others

Describe

Monitor Framework
This PR is mainly for developer to monitor some runtime states in Paddle. Developer can use this feature in the following scenario :

  • running with a shared library, and want to know how many resources used belong to paddle.
  • need to observe the real-time changes of system or application states.

Design

  • Add a StatValue class in the backend to represent a stat.
  • Add a singleton StatRegistry to maintain the collection of stats.
  • For the sake of code neatness, we only support type of int and float, which can cover most of the scenarios.

Usage

  • Registration your stat in monitor.cpp, using DEFINE_INT_STATUS or DEFINE_FLOAT_STATUS
  • Call USE_INT_STAT or USE_INT_STAT in the source file where you want to update the stat.
  • Call STAT_ADD or STAT_SUB to update your state value.
  • Through the PyBind interface, the value of each state is exposed to the python side.
  • After get the real-time state value in python, you can do whatever you want, such as print it to text file or display it by monitoring service.

Others

  • We will give a complete example later, please stay tuned.

@hutuxian hutuxian force-pushed the monitor branch 4 times, most recently from 8f35b48 to d1e10a5 Compare June 13, 2020 09:58
@hutuxian hutuxian changed the title Monitor Monitor Framework Jun 16, 2020
Copy link
Collaborator

@gavin1332 gavin1332 left a comment

Choose a reason for hiding this comment

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

LGTM

@hutuxian hutuxian merged commit 5822862 into PaddlePaddle:develop Jun 16, 2020
@hutuxian hutuxian deleted the monitor branch June 16, 2020 12:05
hutuxian added a commit to hutuxian/Paddle that referenced this pull request Jun 18, 2020
* Add a StatValue class in the backend to represent a stat.
* Add a singleton StatRegistry to maintain the collection of stats.
* For the sake of code neatness, we only support type of int and float, which can cover most of the scenarios.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants