docs: resolve sphinx warnings

Signed-off-by: Xuehai Pan <XuehaiPan@pku.edu.cn>
This commit is contained in:
Xuehai Pan 2022-07-02 16:54:06 +08:00
parent 13cfad8eec
commit d5f7ada23b
8 changed files with 41 additions and 8 deletions

View file

@ -15,7 +15,7 @@ build:
sphinx:
builder: html
configuration: docs/source/conf.py
fail_on_warning: false
fail_on_warning: true
# Optionally declare the Python requirements required to build your docs
python:

22
docs/README.md Normal file
View file

@ -0,0 +1,22 @@
# The `nvitop`'s Documentation
This directory contains the documentation of `nvitop`, the one-stop solution for GPU process management.
### Requirements <!-- markdownlint-disable heading-increment -->
- `sphinx`
- `sphinx-autoapi`
- `sphinx-autobuild`
- `sphinx-copybutton`
- `sphinx-rtd-theme`
- `make`
### Steps to build the documentation <!-- markdownlint-disable heading-increment -->
```bash
cd docs # navigate to this directory
python3 -m venv --upgrade-deps .venv
source .venv/bin/activate
pip3 install -r ../requirements.txt -r requirements.txt
sphinx-autobuild --watch ../nvitop --open-browser source build
```

View file

@ -1,6 +1,8 @@
sphinx
sphinx-rtd-theme
sphinx >= 5.0
sphinx-autoapi
sphinx-autobuild
sphinx-copybutton
sphinx-rtd-theme
pytorch-lightning >= 1.5.0
tensorflow >= 2.0

View file

@ -6,3 +6,4 @@ nvitop.core.libnvml module
:undoc-members:
:show-inheritance:
:member-order: bysource
:noindex: pynvml.NVMLError

View file

@ -22,3 +22,4 @@ Module contents
:members:
:undoc-members:
:show-inheritance:
:member-order: bysource

View file

@ -4,6 +4,8 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# pylint: disable=all
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
@ -102,8 +104,13 @@ html_css_files = [
#
# html_sidebars = {}
suppress_warnings = [
'ref.python'
]
extlinks = {
'gitcode': ('https://github.com/XuehaiPan/nvitop/blob/HEAD/%s', '')
'gitcode': ('https://github.com/XuehaiPan/nvitop/blob/HEAD/%s', '%s'),
'issue': ('https://github.com/XuehaiPan/nvitop/issues/%s', 'issue %s')
}

View file

@ -40,8 +40,8 @@ def take_snapshots(
devices (Optional[Union[Device, Iterable[Device]]]):
Requested devices for snapshots. If not given, the devices will be
determined from GPU processes:
- All devices (no GPU processes are given)
- Devices that used by given GPU processes
- All devices (no GPU processes are given)
- Devices that used by given GPU processes
gpu_processes (Optional[Union[GpuProcess, Iterable[GpuProcess]]]):
Requested GPU processes snapshots. If not given, all GPU processes
running on the requested device will be returned.

View file

@ -275,8 +275,8 @@ class Device: # pylint: disable=too-many-instance-attributes,too-many-public-me
indices (Iterable[Union[int, Tuple[int, int]]]):
Indices of the devices. For each index, get ``PhysicalDevice`` for single int
and ``MigDevice`` for tuple (int, int). That is:
- (int) -> PhysicalDevice
- ((int, int)) -> MigDevice
- (int) -> PhysicalDevice
- ((int, int)) -> MigDevice
Returns: List[Union[PhysicalDevice, MigDevice]]
A list of ``PhysicalDevice`` and/or ``MigDevice`` instances of the given indices.