-
Notifications
You must be signed in to change notification settings - Fork 79
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
--track-energy feature #125
base: main
Are you sure you want to change the base?
Conversation
@@ -420,7 +423,7 @@ def _main(self, task): | |||
if task.name in self._bench_names: | |||
raise ValueError("duplicated benchmark name: %r" % task.name) | |||
self._bench_names.add(task.name) | |||
|
|||
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.
Unnecessary spaces in an empty line.
|
What is LIBREADEN? Where does it come from? Please write documentation. |
I am sorry, this is my first open-source contribution ever. I tried to be instructive in this PR's initial text. What qualifies as 'documentation' exactly? Do you mean editing the repo's README? Something else? |
@cappadokes |
OK, I will do my best to expand below. It would be great if you could then direct me on what specific places of this repo other than our thread here this information should exist. The present PR introduces the implementation of a simple energy consumption benchmarking feature. It was developed and tested on an Intel(R) Core(TM) i7-8750H x86_64 Linux machine for Requirements
Usage export ENFILE= # Absolute path to energy_uj or equivalent resource
export LIBREADEN= # Absolute path to pyperf/pyperf/dummy_c_library.so
python3 pyperf_using_benchmark.py --track-energy --inherit-environ ENFILE,LIBREADEN Motivation First experiences Limitation |
The documentation source lives in the doc/ subdirectory and is rendered at: https://pyperf.readthedocs.io/ |
And should I directly edit the .rst files in doc/ ? Are they a result of some automatic docs generation utility (and thus require that I edit the |
Hi all. I have now updated the documentation so as to include There is nothing more to be done at this point. |
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.
@cappadokes Sorry for the delay, I will take a look at this PR ASAP
cc @vstinner
Python is popular, even on resource-constrained devices. Energy is important. A nice-to-have feature would be a
pyperf
option that, if enabled, measures energy consumption instead of execution time. The only requirement for this pull request to bear meaning is the availability of some always-increasing measurement of the total energy spent by a device component. An example is the interface exposed by Intel's RAPL, which was used as the environment for this pull request.Instructions for utilizing the
--track-energy
option are:libreaden.so
, the corresponding source file beingread_file.c
). Save the library inpyperf/pyperf
.LIBREADEN
, containing the path to the C library.ENFILE
, containing the path to the energy measurement file.pyperf
script with--track-energy
and--inherit-environ LIBREADEN,ENFILE
.Measurements saved will now be energy instead of execution time.