From a35d3b9caf03a55cfe32e209583c623a128e3a25 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Tue, 5 Jul 2022 10:54:33 +0800 Subject: [PATCH] docs(core/collector): update docstrings Signed-off-by: Xuehai Pan --- README.md | 4 ++-- nvitop/core/collector.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7dc4e90..f3de898 100644 --- a/README.md +++ b/README.md @@ -575,7 +575,7 @@ In [1]: from nvitop import ResourceMetricCollector, Device ...: import os ...: os.environ['CUDA_VISIBLE_DEVICES'] = '3,2,1,0' # comma-separated integers or UUID strings -In [2]: collector = ResourceMetricCollector() # log all devices and children processes of the current process on the GPUs +In [2]: collector = ResourceMetricCollector() # log all devices and descendant processes of the current process on the GPUs In [3]: collector = ResourceMetricCollector(root_pids={1}) # log all devices and all GPU processes In [4]: collector = ResourceMetricCollector(devices=Device(0), root_pids={1}) # log and all GPU processes on In [5]: collector = ResourceMetricCollector(devices=Device.cuda.all()) # use the CUDA ordinal @@ -645,7 +645,7 @@ from nvitop.callbacks.tensorboard import add_scalar_dict # Logger and status collector writer = SummaryWriter() collector = ResourceMetricCollector(devices=CudaDevice.all(), # log all visible CUDA devices and use the CUDA ordinal - root_pids={os.getpid()}, # only log the children processes of the current process + root_pids={os.getpid()}, # only log the descendant processes of the current process interval=1.0) # snapshot interval for background daemon thread # Start training diff --git a/nvitop/core/collector.py b/nvitop/core/collector.py index 6789598..5f2e3b4 100644 --- a/nvitop/core/collector.py +++ b/nvitop/core/collector.py @@ -165,9 +165,9 @@ class ResourceMetricCollector: # pylint: disable=too-many-instance-attributes Set of Device instances for logging. If not given, all physical devices on board will be used. root_pids (Set[int]): - A set of PIDs, only the status of the children processes on the GPUs - will be collected. If not given, the PID of the current process will - be used. + A set of PIDs, only the status of the descendant processes on the + GPUs will be collected. If not given, the PID of the current process + will be used. interval (float): The snapshot interval for background daemon thread. Core methods: @@ -187,7 +187,7 @@ class ResourceMetricCollector: # pylint: disable=too-many-instance-attributes >>> from nvitop import ResourceMetricCollector, Device - >>> collector = ResourceMetricCollector() # log all devices and children processes of the current process on the GPUs + >>> collector = ResourceMetricCollector() # log all devices and descendant processes of the current process on the GPUs >>> collector = ResourceMetricCollector(root_pids={1}) # log all devices and all GPU processes >>> collector = ResourceMetricCollector(devices=Device.cuda.all()) # use the CUDA ordinal