Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install testing environment
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pytest pytest-mock pytest-cov
python3 -m pip install pytest pytest-mock pytest-cov deepdiff
- name: Install package
uses: Wandalen/wretry.action@master
with:
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Description
-----------
The ``gpu_tracker`` package provides a ``Tracker`` class and a commandline-interface that tracks (profiles) the usage of compute time, CPU utilization, maximum RAM, GPU utilization, and maximum GPU RAM.
The compute time is a measurement of the real time taken by the task as opposed to the CPU-utilization time.
The GPU tracking is for Nvidia GPUs and uses the ``nvidia-smi`` command. If the Nvidia drivers have not been installed, then the max GPU RAM is not tracked and measurements are reported as 0.
The GPU tracking is for both Nvidia and AMD GPUs and respectively uses the nvidia-smi and amd-smi command-line tools to pull GPU usage information. Also, if neither the appropriate Nvidia nor AMD driver is installed, then the GPU-related metrics are not tracked and are reported as 0.
Computational resources are tracked throughout the duration of a context manager or the duration of explicit calls to the ``start()`` and ``stop()`` methods of the ``Tracker`` class.
The ``gpu-tracker`` command-line interface alternatively tracks the computational-resource-usage of an arbitrary shell command.

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'gpu_tracker'
copyright = '2024, Erik Huckvale, Hunter N. B. Moseley'
author = 'Erik Huckvale, Hunter N. B. Moseley'
copyright = '2024, Erik D. Huckvale, Hunter N. B. Moseley'
author = 'Erik D. Huckvale, Hunter N. B. Moseley'
version = __version__
release = __version__

Expand Down
25 changes: 25 additions & 0 deletions docs/notebook/combined-file.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
process_id,code_block_name,position,timestamp
265016,my-code-block,0,1746129778.99568
265016,my-code-block,1,1746129781.7855892
265016,my-function,0,1746129781.7872624
265016,my-function,1,1746129784.3252733
265016,my-code-block,0,1746129784.3266726
265016,my-code-block,1,1746129786.9071054
265016,my-function,0,1746129786.9082048
265016,my-function,1,1746129789.4858837
265016,my-code-block,0,1746129789.486994
265016,my-code-block,1,1746129792.0702057
265016,my-function,0,1746129792.0713246
265016,my-function,1,1746129794.6151624
265016,my-code-block,0,1746129778.99568
265016,my-code-block,1,1746129781.7855892
265016,my-function,0,1746129781.7872624
265016,my-function,1,1746129784.3252733
265016,my-code-block,0,1746129784.3266726
265016,my-code-block,1,1746129786.9071054
265016,my-function,0,1746129786.9082048
265016,my-function,1,1746129789.4858837
265016,my-code-block,0,1746129789.486994
265016,my-code-block,1,1746129792.0702057
265016,my-function,0,1746129792.0713246
265016,my-function,1,1746129794.6151624
6 changes: 6 additions & 0 deletions docs/notebook/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sleep_time": 0.5,
"ram_unit": "megabytes",
"gpu_ram_unit": "megabytes",
"time_unit": "seconds"
}
1 change: 1 addition & 0 deletions docs/notebook/correct_nbconvert.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
contents: str = contents.replace('python3\n\n !', 'none\n\n !')
contents: str = contents.replace('parsed-literal::', 'code:: none')
contents: str = contents.replace('!', '$ ')
contents: str = contents.replace('os._exit(0)', '')
contents = '.. _tutorial-label:\n\n' + contents

with open('tutorial.rst', 'w') as file:
Expand Down
Binary file added docs/notebook/my-results.pkl
Binary file not shown.
Binary file added docs/notebook/results.pkl
Binary file not shown.
Binary file added docs/notebook/results2.pkl
Binary file not shown.
13 changes: 13 additions & 0 deletions docs/notebook/sub-tracking.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
process_id,code_block_name,position,timestamp
265016,my-code-block,0,1746129778.99568
265016,my-code-block,1,1746129781.7855892
265016,my-function,0,1746129781.7872624
265016,my-function,1,1746129784.3252733
265016,my-code-block,0,1746129784.3266726
265016,my-code-block,1,1746129786.9071054
265016,my-function,0,1746129786.9082048
265016,my-function,1,1746129789.4858837
265016,my-code-block,0,1746129789.486994
265016,my-code-block,1,1746129792.0702055
265016,my-function,0,1746129792.0713246
265016,my-function,1,1746129794.6151624
13 changes: 13 additions & 0 deletions docs/notebook/sub-tracking1.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
process_id,code_block_name,position,timestamp
265016,my-code-block,0,1746129778.99568
265016,my-code-block,1,1746129781.7855892
265016,my-function,0,1746129781.7872624
265016,my-function,1,1746129784.3252733
265016,my-code-block,0,1746129784.3266726
265016,my-code-block,1,1746129786.9071054
265016,my-function,0,1746129786.9082048
265016,my-function,1,1746129789.4858837
265016,my-code-block,0,1746129789.486994
265016,my-code-block,1,1746129792.0702055
265016,my-function,0,1746129792.0713246
265016,my-function,1,1746129794.6151624
13 changes: 13 additions & 0 deletions docs/notebook/sub-tracking2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
process_id,code_block_name,position,timestamp
265016,my-code-block,0,1746129778.99568
265016,my-code-block,1,1746129781.7855892
265016,my-function,0,1746129781.7872624
265016,my-function,1,1746129784.3252733
265016,my-code-block,0,1746129784.3266726
265016,my-code-block,1,1746129786.9071054
265016,my-function,0,1746129786.9082048
265016,my-function,1,1746129789.4858837
265016,my-code-block,0,1746129789.486994
265016,my-code-block,1,1746129792.0702055
265016,my-function,0,1746129792.0713246
265016,my-function,1,1746129794.6151624
28 changes: 28 additions & 0 deletions docs/notebook/tracking.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ram_unit,gpu_ram_unit,time_unit,ram_system_capacity,gpu_ram_system_capacity,system_core_count,n_expected_cores,system_gpu_count,n_expected_gpus
gigabytes,gigabytes,hours,67.254165504,16.376,12,12,1,1
main_ram,descendants_ram,combined_ram,system_ram,main_gpu_ram,descendants_gpu_ram,combined_gpu_ram,system_gpu_ram,gpu_sum_utilization_percent,gpu_hardware_utilization_percent,main_n_threads,descendants_n_threads,combined_n_threads,cpu_system_sum_utilization_percent,cpu_system_hardware_utilization_percent,cpu_main_sum_utilization_percent,cpu_main_hardware_utilization_percent,cpu_descendants_sum_utilization_percent,cpu_descendants_hardware_utilization_percent,cpu_combined_sum_utilization_percent,cpu_combined_hardware_utilization_percent,timestamp
0.341860352,0.0,0.341860352,4.859711488,0.0,0.0,0.0,0.215,0.0,0.0,12,0,12,11.900000000000002,0.9916666666666668,100.3,8.358333333333333,0,0.0,100.3,8.358333333333333,1746129779.2048252
0.731631616,0.0,0.731631616,5.008326656,0.0,0.0,0.0,0.215,0.0,0.0,12,0,12,127.5,10.625,103.1,8.591666666666667,0,0.0,103.1,8.591666666666667,1746129779.8564913
0.661712896,0.0,0.661712896,5.115432960000001,0.0,0.0,0.0,0.218,0.0,0.0,14,0,14,116.89999999999999,9.741666666666665,79.6,6.633333333333333,0,0.0,79.6,6.633333333333333,1746129780.5009012
0.851456,0.0,0.851456,5.207662592,0.314,0.0,0.314,0.535,0.0,0.0,15,0,15,123.1,10.258333333333333,99.2,8.266666666666667,0,0.0,99.2,8.266666666666667,1746129781.1513443
0.912490496,0.0,0.912490496,5.279162368000001,0.314,0.0,0.314,0.535,0.0,0.0,15,0,15,124.39999999999999,10.366666666666665,101.5,8.458333333333334,0,0.0,101.5,8.458333333333334,1746129781.8066156
0.8645918720000001,0.0,0.8645918720000001,5.239013376,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,124.3,10.358333333333333,97.1,8.091666666666667,0,0.0,97.1,8.091666666666667,1746129782.4623022
0.9303490560000001,0.0,0.9303490560000001,5.31324928,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,133.4,11.116666666666667,100.4,8.366666666666667,0,0.0,100.4,8.366666666666667,1746129783.1200194
0.8646123520000001,0.0,0.8646123520000001,5.274169344000001,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,125.9,10.491666666666667,100.0,8.333333333333334,0,0.0,100.0,8.333333333333334,1746129783.7685237
0.936558592,0.0,0.936558592,5.288230912,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,122.9,10.241666666666667,98.3,8.191666666666666,0,0.0,98.3,8.191666666666666,1746129784.421019
0.864616448,0.0,0.864616448,5.5536435200000005,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,123.39999999999999,10.283333333333333,102.7,8.558333333333334,0,0.0,102.7,8.558333333333334,1746129785.064131
0.9364152320000001,0.0,0.9364152320000001,5.527478272000001,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,122.4,10.200000000000001,98.2,8.183333333333334,0,0.0,98.2,8.183333333333334,1746129785.716852
0.86462464,0.0,0.86462464,5.200162816000001,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,127.4,10.616666666666667,95.2,7.933333333333334,0,0.0,95.2,7.933333333333334,1746129786.3666322
0.9391349760000001,0.0,0.9391349760000001,5.265408000000001,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,121.8,10.15,99.4,8.283333333333333,0,0.0,99.4,8.283333333333333,1746129787.0165348
0.8646492160000001,0.0,0.8646492160000001,5.20341504,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,130.8,10.9,103.2,8.6,0,0.0,103.2,8.6,1746129787.6673303
0.9443737600000001,0.0,0.9443737600000001,5.268512768,0.506,0.0,0.506,0.727,3.0,3.0,15,0,15,121.9,10.158333333333333,94.7,7.891666666666667,0,0.0,94.7,7.891666666666667,1746129788.3078256
0.864997376,0.0,0.864997376,5.209337856,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,123.0,10.25,95.9,7.991666666666667,0,0.0,95.9,7.991666666666667,1746129788.9610796
0.8579727360000001,0.0,0.8579727360000001,5.234085888,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,114.39999999999999,9.533333333333333,87.5,7.291666666666667,0,0.0,87.5,7.291666666666667,1746129789.588663
0.8650014720000001,0.0,0.8650014720000001,5.219196928000001,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,120.0,10.0,100.7,8.391666666666667,0,0.0,100.7,8.391666666666667,1746129790.1870134
0.927977472,0.0,0.927977472,5.271433216,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,130.8,10.9,97.9,8.158333333333333,0,0.0,97.9,8.158333333333333,1746129790.7797492
0.8650096640000001,0.0,0.8650096640000001,5.296881664000001,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,123.0,10.25,96.3,8.025,0,0.0,96.3,8.025,1746129791.4257803
0.9221242880000001,0.0,0.9221242880000001,5.315219456,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,122.99999999999999,10.249999999999998,100.6,8.383333333333333,0,0.0,100.6,8.383333333333333,1746129792.0727892
0.8650137600000001,0.0,0.8650137600000001,5.314588672,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,120.29999999999998,10.024999999999999,99.9,8.325000000000001,0,0.0,99.9,8.325000000000001,1746129792.721361
0.9266216960000001,0.0,0.9266216960000001,5.3080064,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,120.29999999999998,10.024999999999999,94.9,7.908333333333334,0,0.0,94.9,7.908333333333334,1746129793.3718987
0.865017856,0.0,0.865017856,5.268705280000001,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,125.7,10.475,98.5,8.208333333333334,0,0.0,98.5,8.208333333333334,1746129794.023684
0.932110336,0.0,0.932110336,5.2950917120000005,0.506,0.0,0.506,0.727,0.0,0.0,15,0,15,121.8,10.15,78.0,6.5,0,0.0,78.0,6.5,1746129794.6729133
Loading
Loading